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

[BUG] Getting no video frame error for mobile chrome #7058

Closed
Nav-2d opened this issue Jun 11, 2021 · 3 comments · Fixed by #7060
Closed

[BUG] Getting no video frame error for mobile chrome #7058

Nav-2d opened this issue Jun 11, 2021 · 3 comments · Fixed by #7060

Comments

@Nav-2d
Copy link
Contributor

Nav-2d commented Jun 11, 2021

Context:

  • Playwright Version: 1.12.1
  • Operating System: Mac
  • Node.js version: 12.20
  • Browser: Chromium
  • Extra: Pixel 2 emulation

Code Snippet

// foo.spec.js
test('Find a title (desktop only)', async ({ page, isMobile }) => {
  if (isMobile) {
    // This feature does not exist in mobile browsers
    return;
  }
};
// playwright.config.js
projects: [
    {
      name: 'Pixel 2',
      use: {
        browserName: 'chromium',
        ...devices['Pixel 2'],
      },
    },
    {
      name: 'iPhone 11',
      use: {
        browserName: 'webkit',
        ...devices['iPhone 11'],
      },
    },
  ]

Describe the bug
I have a test where I want to skip execution if the device is a mobile. Using device like Pixel 2, Pixel 4, the test returns an error Error: Page did not produce any video frames while it just passes on iPhone 11 device

Screen Shot 2021-06-10 at 6 51 42 PM
Add any other details about the problem here.

// logs

Error: Page did not produce any video frames

      1 | const { test, expect } = require('@playwright/test');
      2 |
      3 | test('Find a title(desktop only)', async ({ page, isMobile }) => {

        at Video.path (/Users/test/test/test/test/node_modules/@playwright/test/lib/client/video.js:40:19)
        at /test/test/test/test/test/node_modules/@playwright/test/lib/test/index.js:174:35
        at async Promise.all (index 0)
        at Object.context [as fn] (/test/test/test/test/test/node_modules/@playwright/test/lib/test/index.js:170:13)
        at Fixture.teardown (/test/test/test/test/test/node_modules/@playwright/test/lib/test/fixtures.js:96:13)
        at FixtureRunner.teardownScope (/test/test/test/test/test/node_modules/@playwright/test/lib/test/fixtures.js:219:17)
        at WorkerRunner._runAfterHooks (/test/test/test/test/test/node_modules/@playwright/test/lib/test/workerRunner.js:320:13)
@pavelfeldman
Copy link
Member

I can't reproduce this, but I see how this can happen. While I'm fixing it, a couple of hints for your files:

  1. You don't need to pass browserName since you already pass the device, it'll pick the right engine
  2. Use test.skip
test("basic test", async ({ page, isMobile }) => {
  test.skip(isMobile);
});

@pavelfeldman
Copy link
Member

I can reproduce with video: 'retain-on-failure'

@Nav-2d
Copy link
Contributor Author

Nav-2d commented Jun 11, 2021

Thank you. test.skip fits my use-case.

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

Successfully merging a pull request may close this issue.

3 participants