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

[Question] Playwright-chromium is freezing #2030

Closed
munrocket opened this issue Apr 29, 2020 · 3 comments
Closed

[Question] Playwright-chromium is freezing #2030

munrocket opened this issue Apr 29, 2020 · 3 comments

Comments

@munrocket
Copy link

Hello, recently I am tried to migrate three.js library from puppeteer to playwright, we used it in WebGL testing. But for some reason it freezes on some of the screenshots (at least in linux). I will appreciate if you help me with it, because I am stuck.

Steps to reproduce a problem

git clone https://github.com/mrdoob/three.js
cd three.js
npm un puppeteer && npm i -D playwright-chromium
curl https://pastebin.com/raw/UjYAKxAN --output playwright.js
cp playwright.js ./test/e2e/puppeteer.js
npm run test-e2e

Expected result

All examples are tested with screenshot without freezing

Actual result

diff: 0.002, file: css2d_label
diff: 0.000, file: css3d_molecules
diff: 0.000, file: css3d_orthographic
diff: 0.000, file: css3d_panorama
<freezing here>
@yury-s
Copy link
Member

yury-s commented Apr 29, 2020

Looks like a bug in how you pass eval parameters in https://pastebin.com/raw/UjYAKxAN. Note that in Playwright you can pass at most one argument to the function in eval, otherwise you need to wrap parameters in an object and then destructure it.

Try applying the following patch on top of your changes, it fixed the problem for me:
fix.txt

{ pageSize, pageSizeMinTax, pageSizeMaxTax, networkTax, renderTimeout, attemptProgress }

Typescript compiler would have caught that, we should probably do a better job catching this in runtime in playwright and throw when there is more than one parameter.

@arjunattam
Copy link
Contributor

If you're using VS Code, you can add //@ts-check to the beginning of the file to see errors from the TS compiler in the editor.

@munrocket
Copy link
Author

@arjun27 found another error with it, interesting.
@yury-s Thank you very much! Closing issue.

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

No branches or pull requests

3 participants