Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/admin.spec.js
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | it('should display username on top-right', function() { | ||||
cy.visit(url); | cy.visit(url); | ||||
cy.get('.swh-position-right') | cy.get('.swh-position-right') | ||||
.should('contain', 'admin'); | .should('contain', 'admin'); | ||||
logout(); | logout(); | ||||
}); | }); | ||||
it('should get info about a user logged in from javascript', function() { | |||||
cy.window().then(win => { | |||||
expect(win.swh.webapp.isUserLoggedIn()).to.be.false; | |||||
}); | |||||
cy.adminLogin(); | |||||
cy.visit(url); | |||||
cy.window().then(win => { | |||||
expect(win.swh.webapp.isUserLoggedIn()).to.be.true; | |||||
}); | |||||
logout(); | |||||
cy.visit(url); | |||||
cy.window().then(win => { | |||||
expect(win.swh.webapp.isUserLoggedIn()).to.be.false; | |||||
}); | |||||
}); | |||||
it('should prevent unauthorized access after logout', function() { | it('should prevent unauthorized access after logout', function() { | ||||
cy.visit(this.Urls.admin_origin_save()) | cy.visit(this.Urls.admin_origin_save()) | ||||
.location('pathname') | .location('pathname') | ||||
.should('be.equal', '/admin/login/'); | .should('be.equal', '/admin/login/'); | ||||
cy.visit(this.Urls.admin_deposit()) | cy.visit(this.Urls.admin_deposit()) | ||||
.location('pathname') | .location('pathname') | ||||
.should('be.equal', '/admin/login/'); | .should('be.equal', '/admin/login/'); | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |