Skip to content

Commit

Permalink
Merge branch 'develop' into 3222-plg-prod
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 authored Nov 14, 2024
2 parents b3f57ad + 69f0bb4 commit bd0c36e
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 bd0c36e

Please sign in to comment.