-
Notifications
You must be signed in to change notification settings - Fork 44.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into aarushikansal/feature-flagging-backend
- Loading branch information
Showing
21 changed files
with
362 additions
and
71 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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 |
---|---|---|
@@ -1,46 +1,45 @@ | ||
import { test, expect } from "./fixtures"; | ||
// auth.spec.ts | ||
import { test } from "./fixtures"; | ||
|
||
test.describe("Authentication", () => { | ||
test("user can login successfully", async ({ page, loginPage, testUser }) => { | ||
await page.goto("/login"); // Make sure we're on the login page | ||
await page.goto("/login"); | ||
await loginPage.login(testUser.email, testUser.password); | ||
// expect to be redirected to the home page | ||
await expect(page).toHaveURL("/"); | ||
// expect to see the Monitor text | ||
await expect(page.getByText("Monitor")).toBeVisible(); | ||
await test.expect(page).toHaveURL("/"); | ||
await test.expect(page.getByText("Monitor")).toBeVisible(); | ||
}); | ||
|
||
test("user can logout successfully", async ({ | ||
page, | ||
loginPage, | ||
testUser, | ||
}) => { | ||
await page.goto("/login"); // Make sure we're on the login page | ||
await page.goto("/login"); | ||
await loginPage.login(testUser.email, testUser.password); | ||
|
||
// Expect to be on the home page | ||
await expect(page).toHaveURL("/"); | ||
await test.expect(page).toHaveURL("/"); | ||
|
||
// Click on the user menu | ||
await page.getByRole("button", { name: "CN" }).click(); | ||
// Click on the logout menu item | ||
await page.getByRole("menuitem", { name: "Log out" }).click(); | ||
// Expect to be redirected to the login page | ||
await expect(page).toHaveURL("/login"); | ||
|
||
await test.expect(page).toHaveURL("/login"); | ||
}); | ||
|
||
test("login in, then out, then in again", async ({ | ||
page, | ||
loginPage, | ||
testUser, | ||
}) => { | ||
await page.goto("/login"); // Make sure we're on the login page | ||
await page.goto("/login"); | ||
await loginPage.login(testUser.email, testUser.password); | ||
await page.goto("/"); | ||
await page.getByRole("button", { name: "CN" }).click(); | ||
await page.getByRole("menuitem", { name: "Log out" }).click(); | ||
await expect(page).toHaveURL("/login"); | ||
await test.expect(page).toHaveURL("/login"); | ||
await loginPage.login(testUser.email, testUser.password); | ||
await expect(page).toHaveURL("/"); | ||
await expect(page.getByText("Monitor")).toBeVisible(); | ||
await test.expect(page).toHaveURL("/"); | ||
await test.expect(page.getByText("Monitor")).toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.