Provides device emulation via --deviceName flag using playwright#132
Provides device emulation via --deviceName flag using playwright#132
Conversation
f35be5a to
9fd0cd9
Compare
|
Hey @MildMax, can you update the PR description with what else you did in this PR (I see that you upgraded playwright - was it needed for something specific?). Also, can you link the issue in this PR as well? |
|
I also see extra space, please run the |
sergeychernyshev
left a comment
There was a problem hiding this comment.
All looks great and straightforward with just a couple comments.
Still getting
Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
__tests__/emulation.test.ts
Outdated
| @@ -0,0 +1,135 @@ | |||
| import fs from 'fs'; | |||
| import { launchTest, SuccessfulTestResult } from '../src/index.js'; | |||
There was a problem hiding this comment.
My TypeScript complains that SuccessfulTestResult is only used for types and should be imported separately as such.
I got the same thing with jest and that's about it |
I'm no longer getting this timeout warning |
88e7cd9 to
0e4aa7a
Compare
ca88ad8 to
431f1c8
Compare
|
moved to draft and paused due to issues with hanging processes when emulating devices on chromium based browsers |
b77fbc0 to
079a47f
Compare
The bug: - Playwright has a workaround for Chromium with mobile emulation, which creates a new page and immediately closes the initial page: https://github.com/microsoft/playwright/blob/v1.58.2/packages/playwright-core/src/server/browserContext.ts#L440-L452 - Playwright has a bug where if ffmpeg recording is taking place, and a page is closed prior to any frames being recorded, the ffmpeg process is orphaned (left running indefinitely): https://github.com/microsoft/playwright/blob/v1.58.2/packages/playwright-core/src/server/videoRecorder.ts#L160-L161 - There's a race condition where if the closure of the initial page happens so quickly that no frames are emitted, it hits the above bug and the ffmpeg process is orphaned We're currently using v1.58.2, and this bug has been fixed in playwright's main branch, which has yet to be released in a published version: microsoft/playwright@d039c40#diff-ad6a56f7e7b3b2470f89b4add2bcd881df4247d8d29824ea1e79054c0ce6815eR166 This patch should fix the issue and can live until the next version of playwright.
Closes #4