-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adapt CI to diracx-charts changes
- Loading branch information
Showing
3 changed files
with
13 additions
and
11 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
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 |
---|---|---|
|
@@ -2,14 +2,12 @@ | |
|
||
// Make sure the user can login and logout | ||
describe("Login and Logout", () => { | ||
const baseUrl = Cypress.env("BASE_URL"); | ||
|
||
beforeEach(() => { | ||
// Cypress starts out with a blank slate for each test | ||
// so we must tell it to visit our website with the `cy.visit()` command. | ||
// Since we want to visit the same URL at the start of all our tests, | ||
// we include it in our beforeEach function so that it runs before each test | ||
cy.visit(`https://${baseUrl}:8000`); | ||
cy.visit("/"); | ||
}); | ||
|
||
it("login", () => { | ||
|
@@ -20,10 +18,15 @@ describe("Login and Logout", () => { | |
// Continue with the default parameters | ||
cy.contains("Login through your Identity Provider").click(); | ||
|
||
cy.url().should("include", `http://${baseUrl}:32002`); | ||
// Extract name from baseUrl (remove http:// and port number) | ||
const domain = Cypress.config() | ||
.baseUrl?.replace("https://", "") | ||
.split(":")[0]; | ||
|
||
cy.url().should("include", `http://${domain}:32002`); | ||
|
||
// The user is redirected to the OIDC provider login page and needs to login | ||
cy.origin(`http://${baseUrl}:32002`, () => { | ||
cy.origin(`http://${domain}:32002`, () => { | ||
// Find the username and password fields and fill them | ||
cy.get("#login").type("[email protected]"); | ||
cy.get("#password").type("password"); | ||
|
@@ -55,7 +58,7 @@ describe("Login and Logout", () => { | |
|
||
// The user tries to access the dashboard page without being connected | ||
// The user is redirected to the /auth page | ||
cy.visit(`https://${baseUrl}:8000/`); | ||
cy.visit("/"); | ||
cy.url().should("include", "/auth"); | ||
}); | ||
}); |