-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean URL for community share button, proposal link tests for events …
…committee (#888) * test events committee proposal link sharing * clean URL for community share button fixes #889 * show URL during test
- Loading branch information
1 parent
b48b7ac
commit 2ab1c58
Showing
5 changed files
with
60 additions
and
8 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
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,39 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { pauseIfVideoRecording, showPageURLInTest } from "../../testUtils.js"; | ||
|
||
test.describe("share links", () => { | ||
test.use({ | ||
contextOptions: { | ||
permissions: ["clipboard-read", "clipboard-write"], | ||
}, | ||
}); | ||
|
||
test("community share button should create a clean URL", async ({ page }) => { | ||
await page.goto( | ||
"/devhub.near/widget/app?page=community&handle=webassemblymusic" | ||
); | ||
await showPageURLInTest(page); | ||
|
||
const shareButton = await page.locator("button", { hasText: "Share" }); | ||
await expect(shareButton).toBeVisible(); | ||
|
||
await shareButton.hover(); | ||
await pauseIfVideoRecording(page); | ||
await shareButton.click(); | ||
|
||
const linkUrlFromClipboard = await page.evaluate( | ||
"navigator.clipboard.readText()" | ||
); | ||
expect(linkUrlFromClipboard).toEqual( | ||
"https://devhub.near.page/community/webassemblymusic" | ||
); | ||
await pauseIfVideoRecording(page); | ||
await page.goto(linkUrlFromClipboard); | ||
|
||
await showPageURLInTest(page); | ||
await expect(await page.getByText("WebAssembly Music")).toBeVisible({ | ||
timeout: 10000, | ||
}); | ||
await pauseIfVideoRecording(page); | ||
}); | ||
}); |