-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#8206: playwright tests for MS Edge sidebar links #8216
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e52a302
#8206: playwright tests for links
twschiller 0fd07f4
Open the extension console
twschiller 5be8e0e
Fix jest snapshots
twschiller ea293d0
Merge branch 'main' into feature/8206-playwright
mnholtz 5a680e0
Add commentary on MS Edge behavior and try to fix
twschiller 95b9b86
#8206: add more comments on playwright issues
twschiller dd12bd2
Merge branch 'main' into feature/8206-playwright
grahamlangford 074fb91
Merge branch 'main' into feature/8206-playwright
fungairino 591279f
Work around msedge bugs
fungairino 5e48708
Merge branch 'main' into feature/8206-playwright
fungairino 011345d
fix snapshots
fungairino 4085536
Merge branch 'main' into feature/8206-playwright
fungairino f9bd5c6
wip
fungairino d74be30
fix snapshots
fungairino a1b896a
always reopen sidebar
fungairino 3e0ae08
wip
fungairino 1b1e7cf
fix e2e flakiness with deleting mods cleanup
fungairino 49a0bf2
Merge branch 'main' into feature/8206-playwright
fungairino 1fc3eb6
Merge branch 'main' into feature/8206-playwright
fungairino 021a913
lint fix
fungairino 309c6bc
skip iframe link test in linux
fungairino 40cb8eb
fix os check
fungairino 3740af7
fix os check
fungairino 4b6bbed
fix osname check
fungairino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2024 PixieBrix, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { test, expect } from "../../fixtures/extensionBase"; | ||
import { ActivateModPage } from "../../pageObjects/extensionConsole/modsPage"; | ||
// @ts-expect-error -- https://youtrack.jetbrains.com/issue/AQUA-711/Provide-a-run-configuration-for-Playwright-tests-in-specs-with-fixture-imports-only | ||
import { test as base } from "@playwright/test"; | ||
import { getSidebarPage } from "../../utils"; | ||
|
||
test("8206: clicking links doesn't crash browser", async ({ | ||
page, | ||
extensionId, | ||
}) => { | ||
const modId = "@pixies/test/sidebar-links"; | ||
|
||
const modActivationPage = new ActivateModPage(page, extensionId, modId); | ||
await modActivationPage.goto(); | ||
|
||
await modActivationPage.clickActivateAndWaitForModsPageRedirect(); | ||
|
||
await page.goto("/"); | ||
|
||
// The mod contains a trigger to open the sidebar on h1 | ||
await page.click("h1"); | ||
|
||
const sideBarPage = await getSidebarPage(page, extensionId); | ||
await expect( | ||
sideBarPage.getByRole("heading", { name: "Sidebar Links" }), | ||
).toBeVisible(); | ||
|
||
await sideBarPage.getByRole("link", { name: "Markdown Text Link" }).click(); | ||
|
||
// Is a react-bootstrap button link variant | ||
await sideBarPage.getByRole("button", { name: "Open a Tab Link" }).click(); | ||
|
||
await sideBarPage.getByRole("link", { name: "HTML Renderer Link" }).click(); | ||
|
||
await sideBarPage.getByRole("link", { name: "Embedded Form Link" }).click(); | ||
|
||
// FIXME: get these selectors working | ||
// PixieBrix uses 2 layers of frames to get around the host page CSP. Test page has 2 layers | ||
// const pixiebrixFrame = page.frameLocator("iframe").first(); | ||
fungairino marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// const mainFrame = pixiebrixFrame.frameLocator("iframe").first(); | ||
// await expect(mainFrame.getByText("Alpha")).toBeVisible(); | ||
// | ||
// const srcdocFrame = mainFrame.frameLocator("iframe").first(); | ||
// await srcdocFrame.getByRole("link", { name: "IFrame Link" }).click(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. During manual testing in MS Edge on Mac the browser crashes when clicking link in the iframe. (Because our interception logic does not intercept it) |
||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also assert that the expected page was opened. See: https://playwright.dev/docs/pages#handling-popups