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]: Codegen can't track openPage #31493

Open
mtsmfm opened this issue Jul 1, 2024 · 0 comments
Open

[Bug]: Codegen can't track openPage #31493

mtsmfm opened this issue Jul 1, 2024 · 0 comments

Comments

@mtsmfm
Copy link
Contributor

mtsmfm commented Jul 1, 2024

Version

1.45.0

Steps to reproduce

  1. npx playwright codegen https://example.com
  2. Open new tab
  3. Enter https://example.com/

Expected behavior

Codegen generates valid test code like this:

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

test('test', async ({ page, context }) => {
  await page.goto('https://example.com/');
  const page1 = await context.newPage()
  await page1.goto('https://example.com/');
});

Actual behavior

2024-07-01.11-47-10.mp4

Codegen generates invalid code:

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

test('test', async ({ page }) => {
  await page.goto('https://example.com/');
  await page1.goto('https://example.com/');
});

Additional context

I believe it worked at some point but it doesn't work with Playwright 1.44.1 as well.
Perhaps browser version can be related to the cause.

Environment

$ npx envinfo --preset playwright

  System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 9.00 GB / 15.54 GB
    Container: Yes
  Binaries:
    Node: 20.13.1 - ~/.local/share/mise/installs/node/20/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 10.8.0 - ~/.local/share/mise/installs/node/20/bin/npm
  IDEs:
    VSCode: 1.90.2 - /home/mtsmfm/.vscode-server/bin/5437499feb04f7a586f677b155b039bc2b3669eb/bin/remote-cli/code
  Languages:
    Bash: 5.0.17 - /usr/bin/bash
  npmPackages:
    @playwright/test: 1.45.0 => 1.45.0 
    playwright: 1.45.0 => 1.45.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants