Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

mmarkelov
Copy link
Member

close #594

@mmarkelov mmarkelov requested a review from mxschmitt as a code owner February 27, 2021 08:41
@coveralls
Copy link

coveralls commented Feb 27, 2021

Pull Request Test Coverage Report for Build 605362498

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 95.93%

Totals Coverage Status
Change from base Build 589219928: 0.02%
Covered Lines: 106
Relevant Lines: 108

💛 - Coveralls

Copy link
Collaborator

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(tested? 😄)

@mmarkelov
Copy link
Member Author

(tested? 😄)

yes)

@mmarkelov mmarkelov merged commit a06f2af into master Feb 27, 2021
@mmarkelov mmarkelov deleted the increase-jest-timeout-for-PWDEBUG-option branch February 27, 2021 11:30
if (configTimeout) {
return configTimeout
}
return process.env.PWDEBUG ? DEBUG_TIMEOUT : DEFAULT_TEST_PLAYWRIGHT_TIMEOUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmarkelov I think you should document that you set the default timeout to 15s. I was surprised when running tests after a recent upgrade that it increased from 5 -> 15 s for each jest test. It is worth mentioning in your docs that this is the case.

Also, https://playwright.dev/docs/next/debug/#run-in-debug-mode mentions that it both runs in headful, as well as sets the playwright timeout to 0 (= no timeout). Is this the same you do? I.e. set both Jest's and Playwrights timeout to no timeout? I think it is worth mentioning in the docs what you do when a user sets PWDEBUG=1. I.e. do you, in addition to what Playwright does, also change Jest's default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhildenbiddle i believe that changes from 5 -> 15 s was made in the first versions of jest-playwright, and it was made because some interactions with page can be slow and 5 second was not enough, lots of tests are failing because of it.
I suppose no timeout for PWDEBUG mode is about playwrights timers. And we set timeout to big value, because otherwise the usage of debugging features, like page.pause() will relate to jest failure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmarkelov Did you mean to tag me really? :)

Could you document this? Two things I think of.

  1. Document somewhere that you set the default timeout for all tests to 15 sec.
  2. Document in the Debug section that when PWDEBUG is set, that you following defaults are set: https://playwright.dev/docs/next/debug/#defaults, plus that you set Jest's own timeout to a huge value. Maybe be explicit

I think that would be great :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thernstig create new issue about doc improvements #602

PWDEBUG=1 jest
```

- Jest Playwright exposes a method `jestPlaywright.debug()` that suspends test execution and gives you opportunity to see what's going on in the browser.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does jestPlaywright.debug() interact with page.pause()? https://playwright.dev/docs/api/class-page?_highlight=paus#pagepause

It would be great if jestPlaywright.debug() also pauses (and allows the user to resume) but I think this should be explicitly explained here. It is good to say here what debugging does both for the Playwright settings, as well as the Jest settings.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can rework that jestPlaywright will use playwright.pause under the hood?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhildenbiddle page.pause() was introduced only in last version. And jestPlaywright.debug() does not related to this function. Personally, I don't like jestPlaywright.debug() because it's weird and hacky solution to simplify debugging, that came from jest-puppeteer

Copy link
Member Author

@mmarkelov mmarkelov Feb 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxschmitt yes we can. But it will be breaking change. I think usage of this feature for debugging is much better that jestPlaywright.debug()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be sweet, do you want to create an issue? I can do it if you want but you can probably better explain it. Release it under a 2.0 release then, I think this awesome project has graduated enough to warrant a new major version 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thernstig yes. It will be nice if you create an issue)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set high timeout when PWDEBUG env var is set

4 participants