Skip to content

Commit

Permalink
Changed login info according to the dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
Om-Thorat committed Jan 12, 2024
1 parent 363b944 commit 5d3a8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/auth_spec/redirect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ describe("redirect", () => {

it("Check if login redirects to the right url", () => {
cy.awaitUrl("/resource/board", true);
loginPage.loginManuallyAsStaff();
loginPage.loginAsDisctrictAdmin();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/resource/board");
});

it("Check if the redirect param works", () => {
cy.awaitUrl("login?redirect=http://localhost:4000/resource/board", true);
loginPage.loginManuallyAsStaff();
loginPage.loginAsDisctrictAdmin();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/resource/board");
});

it("Check to ensure that redirect is the same origin", () => {
cy.awaitUrl("login?redirect=https://google.com", true);
loginPage.loginManuallyAsStaff();
loginPage.loginAsDisctrictAdmin();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/facility");
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class LoginPage {
cy.loginByApi("staffdev", "Coronasafe@123");
}

loginManuallyAsStaff(): void {
cy.get("input[id='username']").type("staffdev");
loginManuallyAsDistrictAdmin(): void {
cy.get("input[id='username']").type("devdistrictadmin");
cy.get("input[id='password']").type("Coronasafe@123");
cy.get("button").contains("Login").click();
}
Expand Down

0 comments on commit 5d3a8a6

Please sign in to comment.