playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: Extra page.goto navigation step in trace files

Open Nav-2d opened this issue 1 year ago • 1 comments

Version

1.49.0

Steps to reproduce

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


test.only("get started link", async ({ page }) => {
  await page.goto("https://playwright.dev/");
  await page.getByRole("link", { name: "Get started" }).click();
  await expect(
    page.getByRole("heading", { name: "Installation" })
  ).toBeVisible();
  await page.getByRole('link', { name: 'How to install Playwright' }).click();
  await expect(page.getByRole('heading', { name: 'Installing PlaywrightDirect' })).toBeVisible();
});

Launch the above test using npx playwright test --debug and using the inspector to play the test (Press Resume button). Open the trace file and observe

Expected behavior

After clicking How to install Playwright link, the assertion step should be displayed.

Actual behavior

An extra page.goto() is displayed. Image

Additional context

While debugging tests in trace file, this extra navigation throws me off. I have to go back and see why we are using page.goto here but in reality we are not.

Environment

System:
    OS: macOS 15.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 1.77 GB / 36.00 GB
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  IDEs:
    VSCode: 1.94.0 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.49.0 => 1.49.0

Nav-2d avatar Nov 27 '24 18:11 Nav-2d

Bisected to https://github.com/microsoft/playwright/compare/01b44ba0778b7ea39f71370b567679ea7236289c...17ed944a84c1f0fcb78a2b1536e354f992e984d6

1.48.0-alpha-2024-09-20 good 1.48.0-alpha-2024-09-21 bad

I can repro in Inspector and inspector with --debug and trace viewer.

mxschmitt avatar Nov 28 '24 10:11 mxschmitt