Rayrun
← Back to Discord Forum

"test.only" Only works with api tests

I can use test.only for debugging api tests, but when I try to use it for ui tests I get the following error

kuvaplaywright@1.0.0 test npx playwright test dashboard.ui.spec.js

TypeError: Cannot read properties of undefined (reading '_hasTests')

Is there something i need to update in the playwright config?

This thread is trying to answer question "Why does 'test.only' only work with API tests and not UI tests, and how can this issue be resolved?"

4 replies

nothing to be updated in config for .only

  1. use debugger from VS code for debug
  2. use npx playwright test --ui to run single test from the tool, also helps with debug As for your problem, please make sure that you have latest version of playwright and node js I had a similar issue at one point and it was because of my old node

This was a bug a couple of versions back, so definitely update your Playwright and see if it is resolved.

ok, will try to update playwright to see if that works

@_flevi: I dont like the ui test tool and prefer not to use it

I dont like the ui test tool and prefer not to use it

Related Discord Threads

TwitterGitHubLinkedIn
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.