diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-01-04 15:43:54 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-01-04 15:43:54 +0300 |
commit | bd57f359cbdea0f435e4b041f239437682b63bf8 (patch) | |
tree | 32251e5bef5afd67a2e525381626fd2872e74e50 /cypress | |
parent | 7af53363b6919fa1af1cf8bf6c6846ff8fdb98b5 (diff) |
Clear cookies for logout
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/support/commands.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cypress/support/commands.js b/cypress/support/commands.js index a70605462..e29fefb9d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -41,10 +41,15 @@ Cypress.Commands.add('login', (user, password, route = '/apps/files') => { }) Cypress.Commands.add('logout', () => { - cy.get('#expanddiv li[data-id="logout"] a').then(logout => { - if (logout) { - cy.visit(logout[0].href) - } + Cypress.Cookies.defaults({ + whitelist: [] + }) + + cy.clearLocalStorage() + cy.clearCookies() + + Cypress.Cookies.defaults({ + whitelist: /^(oc|nc)/ }) }) |