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]: browser.close cause test information to disappear in UI mode #30894

Closed
tmasa opened this issue May 18, 2024 · 2 comments
Closed

[Bug]: browser.close cause test information to disappear in UI mode #30894

tmasa opened this issue May 18, 2024 · 2 comments
Assignees

Comments

@tmasa
Copy link

tmasa commented May 18, 2024

Version

1.44.0

Steps to reproduce

Create a very simple test that does not use any fixture, but creates a browser instance in the test case.

test('Sample Test with browser.close', async () => {
        const browser = await chromium.launch();
        const page = await browser.newPage();
        await page.goto("https://playwright.dev");
        await browser.close();
    });

Execute the test in UI mode (npx playwright test --ui)

Expected behavior

Test should be successful, test information (including screenshot, timeline, logs, etc.) should be visible in UI mode.

Actual behavior

As soon as browser.close is called, test information is gone.

image

Additional context

It works fine when using page.close instead of browser.close

image

Discord post: https://discord.com/channels/807756831384403968/1240014510593413120

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
    Memory: 15.39 GB / 31.69 GB
  Binaries:
    Node: 18.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.89.1 - C:\Users\<me>\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.44.0 => 1.44.0
@pavelfeldman
Copy link
Member

browser.close is not a graceful exit, so you should call await page.close() (or context.close()) before the test ends.

@pavelfeldman
Copy link
Member

Closing as per above, please feel free to open a new issue if this does not cover your use case.

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

3 participants