Skip to content
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 24 commits into from
May 15, 2024

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Apr 10, 2024

What does this PR do?

Remaining 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 state
  • @fregante On MV3 it looks like clicking a link causes the sidebar to be closed on the current tab. So the tests I originally wrote aren't passing. Was that the intended behavior in your PR? 3e1a159#r140843795
  • Fix MV3 tests on Chrome/Edge

Discussion

  • Given that MS Edge has a different sidepanel behavior, we'll need to adjust the test to ensure the sidepanel is open for each step. @fungairino @mnholtz - do we have a best practice for writing browser-specific tests or checks?
  • event.composedPath has different behavior for open/closed Shadow DOM. Is this a problem? I think it would be a source of seeing different results on CI vs. manual testing: cc @grahamlangford @fregante

Potential Improvements

  • Assert that a new page is opened when clicking the links

Future Work

Checklist

  • Add jest or playwright tests and/or storybook stories
  • Designate a primary reviewer: @fungairino

Comment on lines 44 to 46

await sideBarPage.getByRole("link", { name: "Markdown Text Link" }).click();

Copy link
Collaborator

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

@twschiller twschiller added this to the 1.8.13 milestone Apr 10, 2024
@twschiller twschiller removed their assignment Apr 10, 2024
@twschiller twschiller changed the title #8206: add playwright tests for sidebar links #8206: [WIP] add playwright tests for sidebar links Apr 10, 2024
@twschiller twschiller marked this pull request as draft April 10, 2024 20:52
@twschiller twschiller changed the title #8206: [WIP] add playwright tests for sidebar links #8206: fix link behavior for iframe and add playwright tests for sidebar links Apr 10, 2024
// await expect(mainFrame.getByText("Alpha")).toBeVisible();
//
// const srcdocFrame = mainFrame.frameLocator("iframe").first();
// await srcdocFrame.getByRole("link", { name: "IFrame Link" }).click();
Copy link
Contributor Author

@twschiller twschiller Apr 10, 2024

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)

@twschiller twschiller changed the title #8206: fix link behavior for iframe and add playwright tests for sidebar links #8206: fix links in Sidebar for MSEdge iframe and add playwright tests for sidebar links Apr 10, 2024
@twschiller twschiller changed the title #8206: fix links in Sidebar for MSEdge iframe and add playwright tests for sidebar links #8206: fix links in Sidebar for MSEdge and add playwright tests Apr 10, 2024
@twschiller twschiller changed the title #8206: fix links in Sidebar for MSEdge and add playwright tests #8206: [WIP fix links in Sidebar for MSEdge and add playwright tests Apr 10, 2024
@twschiller twschiller changed the title #8206: [WIP fix links in Sidebar for MSEdge and add playwright tests #8206: [WIP[ fix links in Sidebar for MSEdge and add playwright tests Apr 10, 2024
@twschiller twschiller changed the title #8206: [WIP[ fix links in Sidebar for MSEdge and add playwright tests #8206: [WIP] fix links in Sidebar for MSEdge and add playwright tests Apr 10, 2024
@fungairino fungairino changed the title #8206: [WIP] playwright tests for MS Edge sidebar links #8206: playwright tests for MS Edge sidebar links May 10, 2024
@grahamlangford grahamlangford removed this from the 1.8.14 milestone May 10, 2024
@twschiller twschiller added this to the 2.0.0 milestone May 10, 2024
Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@fungairino fungairino merged commit 8a67ea8 into main May 15, 2024
22 checks passed
@fungairino fungairino deleted the feature/8206-playwright branch May 15, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants