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
base: main
Are you sure you want to change the base?
Conversation
|
||
await sideBarPage.getByRole("link", { name: "Markdown Text Link" }).click(); | ||
|
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
// 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 comment
The 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)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8216 +/- ##
==========================================
- Coverage 73.47% 73.42% -0.05%
==========================================
Files 1334 1352 +18
Lines 41259 41523 +264
Branches 7686 7778 +92
==========================================
+ Hits 30316 30490 +174
- Misses 10943 11033 +90 ☔ View full report in Codecov by Sentry. |
Playwright test results - MV2 1 failed Details Open report ↗︎ Failed testsedge › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links doesn't crash browser Flaky testschrome › tests/extensionConsoleActivation.spec.ts › can activate a mod with a database Skipped testschrome › tests/extensionConsoleActivation.spec.ts › can activate a mod with built-in integration |
Playwright test results - MV3Details Open report ↗︎ Failed testschrome › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links doesn't crash browser Flaky testschrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor |
@twschiller You can use test.skip with a conditional, either at the top of the spec file or inside the individual test you want to denote. See an example here: In your case you'll want to compare the browser type, e.g. in Playwright's example:
|
src/sidebar/Header.tsx
Outdated
aria-label="Open Extension Console" | ||
title="Open Extension Console" |
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.
Why title and aria-label?
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.
I've always been a bit confused as to the accessibility best practices for icon buttons. In a couple of places I've seen recommendations to not use title, or use both title and aria-label. It seems however that we should be able to just use title and getByRole("link", {name: "text"})
https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-get-by-title.md
https://dequeuniversity.com/rules/axe/4.1/button-name
What does this PR do?
@pixies/test/sidebar-links
for testingRemaining Work
@fregante on main and 1.8.13-alpha.1 build the gear icon isn't doing anything for me in MS Edge. It doesn't change style on hover and isn't responding to clicks when I test manually (but seems like it might be working on CI?, but closing the sidepanel): seems to be fine for me on local builds on MS Edge. Seems like my extension got into a bad stateDiscussion
Potential Improvements
Future Work
Checklist