Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: fixed student profile login in CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilPawel committed Nov 4, 2021
1 parent 47d3f5b commit fc21a2c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions game_frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,26 @@ Cypress.Commands.add('studentLogin', () => {
failOnStatusCode: true,
form: true,
body: {
username: student_username,
password,
access_code: student_access_code,
csrfmiddlewaretoken: csrfToken.value,
}
})
cy.getCookie('csrftoken').then(csrfToken => {
cy.request({
method: 'POST',
url: `/login/student/${student_access_code}`,
failOnStatusCode: true,
form: true,
body: {
username: student_username,
password: password,
csrfmiddlewaretoken: csrfToken.value,
}
})
cy.visit('/')
})
})
})

Cypress.Commands.add('logout', () => {
cy.request('/logout/')
Expand Down

0 comments on commit fc21a2c

Please sign in to comment.