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

Does not skip 'Galaxy S5' on Firefox: options.isMobile is not supported in Firefox #337

Closed
maurusrv opened this issue Sep 10, 2020 · 4 comments · Fixed by #338
Closed

Does not skip 'Galaxy S5' on Firefox: options.isMobile is not supported in Firefox #337

maurusrv opened this issue Sep 10, 2020 · 4 comments · Fixed by #338

Comments

@maurusrv
Copy link

maurusrv commented Sep 10, 2020

Hi, I've tried to use this lib and was able to reproduce the same bug with this example test case:

beforeAll(async () => {
  await page.goto('https://www.google.com/')
})

test.jestPlaywrightSkip({ browsers: ['firefox', 'webkit'], devices: ['Galaxy S5']}, 'should display "google" text on page', async () => {
  const url = await page.url()
  expect(url).toEqual('https://www.google.com/')
})

As you can see in the snippet below, it skipped Galaxy S5 as i intended on webkit but on firefox.

 PASS   browser: chromium  src/example/Example.test.js
  ✓ should display "google" text on page (5 ms)

 PASS   browser: chromium device: Galaxy S5  src/example/Example.test.js
  ✓ should display "google" text on page (1 ms)

 PASS   browser: firefox  src/example/Example.test.js
  ✓ should display "google" text on page (2 ms)

 FAIL   browser: firefox device: Galaxy S5  src/example/Example.test.js
  ● Test suite failed to run

    options.isMobile is not supported in Firefox

      at FFBrowser.newContext (node_modules/playwright/lib/firefox/ffBrowser.js:69:19)
      at FFBrowser.newContext (node_modules/playwright/lib/helper.js:80:31)
      at PlaywrightEnvironment.setup (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:92:49)

 PASS   browser: webkit  src/example/Example.test.js (12.123 s)
  ✓ should display "google" text on page (2 ms)

Test Suites: 1 failed, 1 skipped, 4 passed, 5 of 1 total
Tests:       1 skipped, 4 passed, 5 total

My understanding of the browsers and devices parameter for jestPlaywrightSkip is: it goes through each browser pairing it with each device. If this is right, then here i am reporting this bug. But if there's nothing wrong with the test implementation and my configuration, is this on jest-playwright side of things or on playwright side?

Thank you!

I've run this test, using Github Actions using the following yml file:

name: CI

on:
  push:
    branches:
    - master

env:
  # Force terminal colors. @see https://www.npmjs.com/package/colors
  FORCE_COLOR: 1

jobs:
  e2e-tests:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
        with:
          node-version: '12'

      - uses: microsoft/playwright-github-action@v1

      - name: Install dependencies and run tests
        run: npm install && npm test Example

As for my configuration,
jest-playwright.config.js:

module.exports = {
  browsers: [
    "chromium",
    "firefox",
    "webkit",
  ],
  devices: [
    null,
    'Galaxy S5',
  ],
}

PS. #332 might be related but i wonder if some change related to jestPlaywrightSkip might solve to really skip the firefox / Galaxy S5 permutation.

@mxschmitt
Copy link
Member

@maurusrv we try to follow up in #332 so that we test the right browsers only instead of weird combinations like Chromium and iPhone 11.

@maurusrv
Copy link
Author

maurusrv commented Sep 11, 2020

hi @mxschmitt tried running the same scenario as above, i'm not sure if i need to open this issue again but it produced a similar error log:

FAIL   browser: firefox device: Galaxy S5  src/example/Example.test.js
  ● Test suite failed to run

    browser.newContext: options.isMobile is not supported in Firefox:

      at FirefoxBrowser._wrapApiCall (node_modules/playwright/lib/client/channelOwner.js:76:15)
      at FirefoxBrowser.newContext (node_modules/playwright/lib/client/browser.js:42:21)
      at PlaywrightEnvironment.setup (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:92:49)

Thanks!

@mxschmitt
Copy link
Member

hi @mxschmitt tried running the same scenario as above, i'm not sure if i need to open this issue again but it produced a similar error log:

FAIL   browser: firefox device: Galaxy S5  src/example/Example.test.js
  ● Test suite failed to run

    browser.newContext: options.isMobile is not supported in Firefox:

      at FirefoxBrowser._wrapApiCall (node_modules/playwright/lib/client/channelOwner.js:76:15)
      at FirefoxBrowser.newContext (node_modules/playwright/lib/client/browser.js:42:21)
      at PlaywrightEnvironment.setup (node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:92:49)

Thanks!

It's not yet released.

@gkushang
Copy link

gkushang commented Apr 7, 2021

@mxschmitt I am facing the same issue. Is this issue released?

Error: browser.newContext: options.isMobile is not supported in Firefox

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

Successfully merging a pull request may close this issue.

3 participants