-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(browser): scale iframe for non ui case #6512
base: main
Are you sure you want to change the base?
Conversation
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.
This doesn't fix it when you call page.viewport
We already experimented with this before. Now we just need to keep the same iframe scaling that we have in ui
Ah, I didn't think about that. I've read #6257 and scaling seems more involved but I'll see what I can do. |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Only Mac chromium playwright is timing out with specs/runner.test.ts
https://github.com/vitest-dev/vitest/actions/runs/10915841527/job/30296283296?pr=6512#step:9:24
I cannot reproduce it locally on my Linux chromium headless, so it's hard to diagnose what's wrong. I would appreciate if someone can check it on Mac machine locally.
// not exact due to scaling and rounding | ||
expect(spy).toHaveBeenCalledWith({ | ||
x: 200, | ||
y: 150, | ||
x: expect.closeTo(200, -1), | ||
y: expect.closeTo(150, -1), |
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.
Scaling round issue seems to already exist for UI case. For example, I can reproduce it on main branch with firefox.
$ PROVIDER=playwright BROWSER=firefox pnpm -C test/browser test-fixtures /userEvent. -t 'x/y'
FAIL test/userEvent.test.ts > userEvent.click > clicks with x/y coords
AssertionError: expected "spy" to be called with arguments: [ { x: 200, y: 150 } ]
Received:
1st spy call:
Array [
Object {
- "x": 200,
+ "x": 199,
"y": 150,
},
]
I'm not sure if there's a way to fix this, so I loosened the assertion.
@@ -273,6 +273,21 @@ async function setIframeViewport( | |||
if (ui) { | |||
await ui.setIframeViewport(width, height) | |||
} | |||
else if (getBrowserState().provider === 'playwright') { |
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 couldn't figure out what's wrong with webdriverio, so I added scaling only for playwright
and CI seems mostly happy.
Description
The test case I added is failing on webdriverio regardless of with or without UI. I couldn't figure out webdriverio, so this PR only fixes playwright where it has inconsistency with or without UI.
todo
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.