Skip to content

Commit

Permalink
Merge branch '3222-plg-prod' of https://github.com/raft-tech/TANF-app
Browse files Browse the repository at this point in the history
…into 3222-plg-prod
  • Loading branch information
elipe17 committed Nov 14, 2024
2 parents 44d0923 + bd0c36e commit e69df5c
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions tdrs-frontend/cypress/e2e/common-steps/common-steps.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
import { When } from '@badeball/cypress-cucumber-preprocessor'

When('{string} visits the home page', (username) => {
cy.clearCookie('sessionid')
cy.clearCookie('csrftoken')
cy.intercept('/v1/stts/alpha').as('getSttSearchList')
cy.visit('/')
cy.contains('Sign into TANF Data Portal', { timeout: 30000 })
})

When('The admin logs in', () => {
cy.visit('/')
cy.adminLogin('[email protected]')
})

When('{string} logs in', (username) => {
cy.login(username)
})

When('The admin sets the approval status of {string} to {string}', (username, status) => {
cy.get('@cypressUser').then((cypressUser) => {
let body = {
username: username,
first_name: '',
last_name: '',
email: username,
stt: '6',
groups: '2',
account_approval_status: status,
access_requested_date_0: '0001-01-01',
access_requested_date_1: '00:00:00',
_save: 'Save',
}
When(
'The admin sets the approval status of {string} to {string}',
(username, status) => {
cy.get('@cypressUser').then((cypressUser) => {
let body = {
username: username,
first_name: '',
last_name: '',
email: username,
stt: '6',
groups: '2',
account_approval_status: status,
access_requested_date_0: '0001-01-01',
access_requested_date_1: '00:00:00',
_save: 'Save',
}

cy.adminApiRequest(
'POST',
`/users/user/${cypressUser.selector.id}/change/`,
body
)
})
})
cy.adminApiRequest(
'POST',
`/users/user/${cypressUser.selector.id}/change/`,
body
)
})
}
)

0 comments on commit e69df5c

Please sign in to comment.