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

WebKit tests #4847

Merged
merged 6 commits into from May 11, 2022
Merged

WebKit tests #4847

merged 6 commits into from May 11, 2022

Conversation

timothycohen
Copy link
Contributor

While writing a test for a Safari only bug (PR #4846), the test suite exposed 13 false positives originating from browser specific behavior in the tests. This PR slightly tweaks the integration tests to be more browser agnostic and allows them to be run using WebKit. It doesn’t include changes to the Playwright config, so the WebKit tests would still be completely opt-in.

Tests changed and reasons for WebKit false positives:

"includes correct page request headers"

Test targeted headers that Safari doesn't support

1. "resets focus"
2. "focus works if page load has hash"
3. "focus works when navigating to a hash on the same page"

"Press tab to highlight each item on a webpage" accessibility setting is turned off in Playwright. Need to use Alt+Tab for WebKit instead.

"client-side error from load() is malformed"

The test matched error.stack instead of error.message and WebKit doesn't show the message as the first line of the stack trace

"prevents redirect loops"

Test checked for chrome specific error page.

"prevents navigation triggered by back button"

The browsers block attempts to prevent navigation on a frame that's never had a user gesture.

"should load stuff after reloading by goto"

Module flag wasn't reset between playwright runs

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

Test: "prevents navigation triggered by back button"

False positive? Yes

Reason for failure: The browsers block attempts to prevent navigation on a frame that's never had a user gesture.
False positive? Yes

Reason for failure: Test checked for chrome specific error page.
Test: "client-side error from load() is malformed"

False positive? Yes

Reason for failure: The test matched error.stack instead of error.message and WebKit doesn't show the message as the first line of the stack trace
Tests:
1. 'resets focus'
2. 'focus works if page load has hash'
3. 'focus works when navigating to a hash on the same page'

False positives? Yes

Reason for failure: "Press tab to highlight each item on a webpage" accessibility setting is turned off in Playwright. Need to use Alt+Tab for WebKit instead.
Test: "includes correct page request headers"

False positive? Yes

Reason for failure: Test targeted headers that Safari doesn't support.
Test: "should load stuff after reloading by goto"

False positive? Yes

Reason for failure: module flag wasn't reset between playwright runs
@changeset-bot
Copy link

changeset-bot bot commented May 7, 2022

⚠️ No Changeset found

Latest commit: 93ba168

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rich-Harris Rich-Harris merged commit 3113b79 into sveltejs:master May 11, 2022
@Rich-Harris
Copy link
Member

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants