← Back to Discord Forum

Each call to test incurs 5-6 second wait

Every single test I write has a 5-6 second startup time before successfully navigating to the root page. Is this normal? Am I missing something? Can I remedy it somehow?

This thread is trying to answer question "Why does each test run incur a 5-6 second wait before successfully navigating to the root page and how can it be remedied?"

10 replies

The same issue occurs in both headless, headed and ui mode.

Try running with DEBUG=pw:* or DEBUG=pw:browser env and see what takes the time

DEBUG=pw:browser output is quite limited, nothing interesting there as far as I can see. With DEBUG=pw:* theres a lot of output to comb through so I'll get onto that.

But am I correct in assuming that there shouldn't be such a delay on every test run?

usually not

The output from -ui shows this, as you can see the time is on page.goto, not the before hooks:


then it just looks like slow page loading

or page is slow at firing load event

you can try using waitUntil: 'domcontentloaded'

Ok - that makes more sense to me. I'll start digging in that end instead. Thanks a lot!

domcontentloaded and load events fire close to the same time, so there is no big difference there unfortunately

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.