-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove Dummy * cleans up auth tests * fmt
- Loading branch information
1 parent
297fec3
commit a456139
Showing
8 changed files
with
53 additions
and
75 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 |
---|---|---|
|
@@ -33,3 +33,4 @@ yarn-error.log* | |
target | ||
neardev | ||
data.json | ||
/test-results |
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
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,48 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { ROOT_SRC } from "../util/constants"; | ||
|
||
test.describe("User is not logged in", () => { | ||
test.use({ | ||
storageState: "playwright-tests/storage-states/wallet-not-connected.json", | ||
}); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(`/${ROOT_SRC}`); | ||
}); | ||
|
||
test("To verify that the sign in button is visible in the home page and when clicked navigates to login page", async ({ | ||
page, | ||
}) => { | ||
const signInButton = page.getByRole("button", { name: "Sign in" }).nth(1); | ||
await expect(signInButton).toBeVisible(); | ||
await signInButton.click(); | ||
expect(page.url()).toContain("/join"); | ||
}); | ||
}); | ||
|
||
test.describe("User is logged in", () => { | ||
test.use({ | ||
storageState: "playwright-tests/storage-states/wallet-connected.json", | ||
}); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(`/${ROOT_SRC}`); | ||
}); | ||
|
||
test("To verify that the user is logged in succesfully", async ({ page }) => { | ||
const LoggedInButton = page.getByRole("button", { name: "anybody.near" }); | ||
await expect(LoggedInButton).toHaveText("anybody.near"); | ||
}); | ||
|
||
test("To verify that the sign out button is visible in the dropdown and when clicked navigates to logout page", async ({ | ||
page, | ||
}) => { | ||
const LoggedInButton = page.getByRole("button", { name: "anybody.near" }); | ||
await expect(LoggedInButton).toHaveText("anybody.near"); | ||
await LoggedInButton.click(); | ||
const dropdownItems = await page.$$(".dropdown-item"); | ||
const secondDropdownItem = dropdownItems[1]; | ||
await secondDropdownItem.click(); | ||
expect(page.url()).toContain("/logout"); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/** | ||
* constants | ||
*/ | ||
|
||
export const ROOT_SRC = "builddao.testnet/widget/Index"; |
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