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
Changes from 3 commits
e52a302
0fd07f4
5be8e0e
ea293d0
5a680e0
95b9b86
dd12bd2
074fb91
591279f
5e48708
011345d
4085536
f9bd5c6
d74be30
a1b896a
3e0ae08
1b1e7cf
49a0bf2
1fc3eb6
021a913
309c6bc
40cb8eb
3740af7
4b6bbed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* 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.getByTitle("Open Extension Console").click(); | ||
|
||
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 = sideBarPage.frameLocator("iframe").first(); | ||
// 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) |
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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