Skip to content

Commit

Permalink
Revert "ci: Hotfix to make login work as long as we are on older cypr…
Browse files Browse the repository at this point in the history
…ess version"

This reverts commit e2d75c3.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Feb 12, 2025
1 parent 08fc079 commit f2b767e
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,8 @@ window._oc_webroot = url

addCommands()

// Copy of the new login command as long as we are blocked to upgrade @nextcloud/cypress by cypress crashes
const login = function(user) {
cy.session(user, function() {
cy.request('/csrftoken').then(({ body }) => {
const requestToken = body.token
cy.request({
method: 'POST',
url: '/login',
body: {
user: user.userId,
password: user.password,
requesttoken: requestToken,
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
// Add the Origin header so that the request is not blocked by the browser.
Origin: (Cypress.config('baseUrl') ?? '').replace('index.php/', ''),
},
followRedirect: false,
})
})
}, {
validate() {
cy.request('/apps/files').its('status').should('eq', 200)
},
})
}

// Prepare the csrf-token for axios
Cypress.Commands.overwrite('login', (_login, user) => {
Cypress.Commands.overwrite('login', (login, user) => {
cy.window(silent).then((win) => {
win.location.href = 'about:blank'
})
Expand Down

0 comments on commit f2b767e

Please sign in to comment.