Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions cypress/integration/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
});
});


4 changes: 2 additions & 2 deletions cypress/integration/login_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]')
Expand Down