diff --git a/cypress/integration/filesystem.js b/cypress/integration/filesystem.js index 78223236..d672d94f 100644 --- a/cypress/integration/filesystem.js +++ b/cypress/integration/filesystem.js @@ -3,11 +3,25 @@ import "../support/index"; describe("The filesystem page", () => { beforeEach(() => { cy.log("Login before every test"); - cy.loginWithUrl("/file"); + }); it("changes the url when you click on a file", () => { - cy.get("div").contains("user1").click(); - cy.url().should("include", "/user1"); + cy.loginWithUrl("/file"); + cy.get("div.col-md-4.col-7").contains("Admin").click(); + cy.url().should("include", "/admin"); + }); + + it("goes back to the home of the filesystem", () => { + cy.loginWithUrl("/file/admin"); + cy.get("div").contains("Home").click(); + cy.url().should("not.include", "/admin"); + }); + + it("shows error message when a path does not exist", () => { + cy.loginWithUrl("/file/fghdhjghjdfhjhdfkhg/dfghjkhghjdfhj"); + cy.get("div").contains("Folder does not exist, or you are not allowed to see the folder.") }); }); + + diff --git a/cypress/integration/login_spec.js b/cypress/integration/login_spec.js index 8ddfdefb..3acb4ec2 100644 --- a/cypress/integration/login_spec.js +++ b/cypress/integration/login_spec.js @@ -6,8 +6,8 @@ describe('The Home Page', () => { it('sets auth cookie when logging in via form submission', function () { // destructuring assignment of the this.currentUser object - const username = 'user1'; - const password = '12345'; + const username = 'admin'; + const password = 'admin'; //cy.visit('/login') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index a7ccf96b..8de3bda3 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -11,7 +11,7 @@ // // -- This is a parent command -- Cypress.Commands.add('loginWithUrl', (path) => { - const user = {username:"user",password:"1234"} + const user = {username:"admin",password:"admin"} cy.visit(path) cy.get('input[id=formBasicUsername]')