test: remove useless navigation to /login while logging in via command
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/1795>
This commit is contained in:
parent
f346b04b42
commit
6f282f984d
|
@ -1,13 +1,8 @@
|
||||||
// Currently we cannot login purely programmatically, so we need to use the
|
|
||||||
// graphical login until the vue3 branch is merged
|
|
||||||
Cypress.Commands.add('login', () => {
|
Cypress.Commands.add('login', () => {
|
||||||
cy.fixture('testuser.json').then(({ username, password }) => {
|
cy.fixture('testuser.json').then(({ username, password }) => {
|
||||||
// We need to request a page that sets the csrf cookie
|
// We need to request a page that sets the csrf cookie
|
||||||
cy.request('/api/v1/instance/nodeinfo/2.0/')
|
cy.request('/api/v1/instance/nodeinfo/2.0/')
|
||||||
|
|
||||||
// Then we can login
|
|
||||||
cy.visit('/login')
|
|
||||||
|
|
||||||
cy.getCookie('csrftoken').then(($cookie) => {
|
cy.getCookie('csrftoken').then(($cookie) => {
|
||||||
cy.request({
|
cy.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
Loading…
Reference in New Issue