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

[REGRESSION]: test.setTimeout(0) no longer works #12973

Closed
alisterscott opened this issue Mar 23, 2022 · 3 comments
Closed

[REGRESSION]: test.setTimeout(0) no longer works #12973

alisterscott opened this issue Mar 23, 2022 · 3 comments

Comments

@alisterscott
Copy link
Contributor

Context:

  • GOOD Playwright Version: 1.19.2
  • BAD Playwright Version: 1.20.0
  • Operating System: MacOS

Code Snippet

  test.only('can help with manual testing', async ({ page }) => {
    test.setTimeout(0) // no timeout
    await page.goto('https://playwright.dev/')
    await page.pause()
  })

Describe the bug

A timeout of 0 is great for using a Playwright test to launch a browser to do some actions. This doesn't work in 1.20.0 as the browser always closes after 30 seconds

@benjamin-thomas
Copy link

The java version is also affected (v1.20)

I'm discovering the library and this behavior definitely got me confused :)

@Test
void PlaywrightTest() {
    Playwright playwright = Playwright.create();
    BrowserType browserType = playwright.chromium();
    Browser browser = browserType.launch(
            new BrowserType.LaunchOptions().setHeadless(false)
    );
    BrowserContext context = browser.newContext(
            new Browser.NewContextOptions().setViewportSize(800, 600)
    );
    Page page = context.newPage();
    page.navigate(getRootUrl());

    page.pause(); // <-- some timeout triggers here, causing the browser window to close

    page.context().close();
    playwright.close();
}

Reverting to 1.19 did fix the problem (meaning page.pause() keeps the browser window open forever)

// pom.xml
<dependency>
  <groupId>com.microsoft.playwright</groupId>
  <artifactId>playwright</artifactId>
  <version>1.19.0</version>
</dependency>

Great work btw, this tool is a pleasure to use!

@dgozman
Copy link
Contributor

dgozman commented Mar 23, 2022

I think this is #12974. Actually closes after a minute, and only with inspector window on MacOS. Updating to v1.20.1 should fix the issue. Thank you for filing!

@dgozman dgozman closed this as completed Mar 23, 2022
@benjamin-thomas
Copy link

I think this is #12974. Actually closes after a minute, and only with inspector window on MacOS. Updating to v1.20.1 should fix the issue. Thank you for filing!

I was on Ubuntu 20.04.4 LTS btw.

v1.20.1 works perfectly for me indeed. Thanks @dgozman!

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