-
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.
* test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title * navbar-reg-tests * added page visiblity assertions * fixed source btn locator --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com>
- Loading branch information
1 parent
eae0df2
commit 3c5847f
Showing
2 changed files
with
80 additions
and
128 deletions.
There are no files selected for viewing
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,80 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { ROOT_SRC } from "../util/constants"; | ||
|
||
test.describe("Navbar", () => { | ||
test.use({ | ||
storageState: "playwright-tests/storage-states/wallet-connected.json", | ||
}); | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto(`/${ROOT_SRC}`); | ||
}); | ||
|
||
test("Notifications", async ({ page }) => { | ||
const notificationsButton = page.locator("i.bi.bi-bell").nth(0); | ||
await page.waitForTimeout(1000); | ||
await notificationsButton.click(); | ||
await expect(page).toHaveURL(/.*\?page=notifications/); | ||
}); | ||
|
||
test("View source", async ({ page }) => { | ||
const btn = page.locator("i.bi.bi-three-dots"); | ||
await page.waitForTimeout(1000); | ||
await expect(btn).toBeVisible(); | ||
await btn.click(); | ||
const viewSourceOption = page.getByText("View source", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(viewSourceOption).toBeVisible(); | ||
await viewSourceOption.click(); | ||
await expect(page).toHaveURL( | ||
/.*\?page=inspect&widgetPath=builddao.testnet\/widget\/page.home.Index/, | ||
); | ||
await page.waitForTimeout(2000); | ||
expect( | ||
page.locator("a.btn.btn-sm.btn-outline-secondary.border-0").nth(0), | ||
).toHaveText("Source"); | ||
}); | ||
|
||
test("Edit Code", async ({ page }) => { | ||
const btn1 = page.locator("i.bi.bi-three-dots"); | ||
await page.waitForTimeout(1000); | ||
await expect(btn1).toBeVisible(); | ||
await btn1.click(); | ||
const editCodeOption = page.getByText("Edit code", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(editCodeOption).toBeVisible(); | ||
await editCodeOption.click(); | ||
await expect(page).toHaveURL(/.*\/edit\//); | ||
}); | ||
test("Network Button -Mainet", async ({ page }) => { | ||
const networkButton = page.getByText("Network", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(networkButton).toBeVisible(); | ||
await networkButton.click(); | ||
const mainetOption = page.getByText("Mainnet", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(mainetOption).toBeVisible(); | ||
await mainetOption.click(); | ||
await page.waitForTimeout(1000); | ||
if (page.url().includes(ROOT_SRC)) { | ||
expect(page.url()).toContain("/builddao.near/widget/Index"); | ||
} else { | ||
expect(page.url()).toContain("https://www.nearbuilders.org/"); | ||
} | ||
}); | ||
test("Network Button -Testnet", async ({ page }) => { | ||
const networkButton = page.getByText("Network", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(networkButton).toBeVisible(); | ||
await networkButton.click(); | ||
const testnetOption = page.getByText("Testnet", { exact: true }); | ||
await page.waitForTimeout(1000); | ||
await expect(testnetOption).toBeVisible(); | ||
await testnetOption.click(); | ||
await page.waitForTimeout(1000); | ||
if (page.url().includes(ROOT_SRC)) { | ||
expect(page.url()).toContain(`/${ROOT_SRC}`); | ||
} else { | ||
expect(page.url()).toContain("https://test.nearbuilders.org/"); | ||
} | ||
}); | ||
}); |