update: background user token persistance
This commit is contained in:
@ -36,19 +36,22 @@ Cypress.Commands.add('login', () => {
|
||||
cy.get('.accept-button').click();
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.pathname).to.eq('/');
|
||||
cy.wrap(Cypress.localStorage.getItem('solid-auth-client')).as('currentUser');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('setToken', () => {
|
||||
if ( this.currentUser ) {
|
||||
Cypress.localStorage.setItem('solid-auth-client', this.currentUser);
|
||||
}
|
||||
});
|
||||
|
||||
Cypress.Commands.add('naviagte', route => {
|
||||
cy.visit(route);
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.pathname).to.eq(route);
|
||||
});
|
||||
// Workaround - seems to be a bug when accessing the route directly
|
||||
cy.get('.accept-button').click();
|
||||
cy.wait(2000);
|
||||
// End workaround
|
||||
});
|
||||
|
||||
Cypress.Commands.add('userLogin', () => {
|
||||
|
Reference in New Issue
Block a user