-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): write some tests for dashboard
- Loading branch information
1 parent
76eebcc
commit b0574f4
Showing
9 changed files
with
94 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"pluginsFile": "tests/e2e/plugins/index.js", | ||
"baseUrl": "http://localhost:3030", | ||
"chromeWebSecurity": true | ||
"chromeWebSecurity": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
describe("Auth Scenarios", () => { | ||
|
||
beforeEach(() => { | ||
cy.setupMocks(); | ||
cy.logout(); | ||
}); | ||
|
||
it("Should land on login page when logged out", () => { | ||
cy.visit("/"); | ||
cy.url().should("contain", Cypress.env("LOGIN_BASE_URL")); | ||
}); | ||
|
||
it("Should land on home page when logged in", () => { | ||
cy.login(); | ||
cy.visit("/"); | ||
cy.wait(["@user", "@spaces", "@projects"]); | ||
|
||
cy.url().should("contain", Cypress.config("baseUrl")); | ||
cy.getHook("user-name").should("contain", "Toto LABRICO"); | ||
}); | ||
|
||
/** | ||
* This test currently fails because Cypress does not allow to visit | ||
* more than one super domain in the same test (which is probably a good thing though). | ||
* Needs refactoring. | ||
*/ | ||
// it("Should be able to log out properly", () => { | ||
// cy.login(); | ||
// cy.visit("/"); | ||
// cy.wait(["@user", "@spaces", "@projects"]); | ||
|
||
// cy.getHook("user-name").click(); | ||
// cy.getHook("btn-logout").click(); | ||
|
||
// cy.url().should("contain", Cypress.env("LOGIN_BASE_URL")); | ||
// }); | ||
|
||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe("Dashboard Scenarios", () => { | ||
|
||
beforeEach(() => { | ||
cy.setupMocks(); | ||
cy.login(); | ||
cy.visit("/"); | ||
cy.wait(["@user", "@spaces", "@projects"]); | ||
}); | ||
|
||
it("Should be able to access user spaces", () => { | ||
cy.getHook("dashboard.btn-spaces").click(); | ||
cy.location("pathname").should("eq", "/spaces"); | ||
}); | ||
|
||
it("Should be able to access user projects", () => { | ||
cy.getHook("dashboard.btn-projects").click(); | ||
cy.location("pathname").should("eq", "/projects"); | ||
}); | ||
|
||
it("Should be able to access a specific space", () => { | ||
// TODO | ||
}); | ||
|
||
it("Should be able to access a specific project", () => { | ||
// TODO | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters