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] playwright test with webkit will only lead to browserContext.newPage: Target closed on macOS (M1, Apple Silicon) #10108

Closed
imWildCat opened this issue Nov 6, 2021 · 6 comments

Comments

@imWildCat
Copy link

imWildCat commented Nov 6, 2021

Context:

  • Playwright Version: 1.16.3
  • Operating System: macOS 12.0.1 (21A559)
  • Browser: WebKit
  • Extra: ARM64

System:

  • OS: macOS 11.6
  • Memory: 2.85 GB / 32.00 GB

Binaries:

  • Node: 16.3.0 - /usr/local/bin/node
  • Yarn: 1.22.10 - /usr/local/bin/yarn
  • npm: 7.7.6 - /usr/local/bin/npm

Languages:

  • Bash: 5.1.4 - /usr/local/bin/bash

Code Snippet

import { expect, test } from '@playwright/test';

async function delay(ms: number) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}
test('twitter', async ({page}) => {
  await page.goto('https://twitter.com/dan_abramov/status/1086215004808978434');

  await delay(5000);

  const title = await page.evaluate(() => document.title);
  const text = await page.evaluate(() => document.body.textContent);

  console.log('[trace] title:', title);
  expect(title.startsWith('Dan on Twitter')).toBeTruthy();
  console.log('[trace] text:', text);
});

Describe the bug

➜  demo_project yarn playwright test src/t.spec.ts --browser webkit
yarn run v1.22.11
$ /Users/username/Downloads/202111/temp/demo_project/node_modules/.bin/playwright test src/t.spec.ts --browser webkit

Running 1 test using 1 worker

  ✘  [webkit] › src/t.spec.ts:6:1 › twitter (5s)


  1) [webkit] › src/t.spec.ts:6:1 › twitter ========================================================

    browserContext.newPage: Target closed





  1 failed
    [webkit] › src/t.spec.ts:6:1 › twitter =========================================================
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
➜  demo_project

Also tested both headless / non-headless webkit on Ubuntu 20.04 (amd64), it worked well.

@KenPrehoda
Copy link

I'm seeing the same bug. When I try to run pw_run.sh in webkit-1564:

./pw_run.sh
Playwright[14659:4089449] WebContent process crashed; reloading

@dshaplyko
Copy link

dshaplyko commented Nov 7, 2021

I'm having the same issue, but looks like it is not related to M1 since I have mac on 1,4 GHz Quad-Core Intel Core i5
Maybe it is related to Operating System: macOS 12.0.1 (21A559)?

@mxschmitt
Copy link
Member

Closing as a duplicate of #9811.

You can fix it by npm i @playwright/test@1.17.0-next-alpha-nov-5-2021 or wait for 1.17.0.

@imWildCat
Copy link
Author

Awesome! Thanks for the quick turnaround!

@TheRobBrennan
Copy link

TheRobBrennan commented Nov 20, 2021

Thank you so much for this. I was experiencing the same issue 🤓

@ghost
Copy link

ghost commented Dec 5, 2022

Screenshot (334)
Hi,
I am Getting a Context issue wrt to firefox browser in playwright, how to solve this issue using the global config in playwright?

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

5 participants