Rayrun
← Back to Discord Forum

Playwright Test UI is not detecting tests when implemented using Page object model

So I've implemented tests using playwright with Page object model. Using the command line and VS Code Extension everything runs just fine. But when I launch the UI, it says No Tests! I've set testDir and

Here is my project structure: I've used Playwright with Typescript

Page classes are being passed to tests as fixtures using test.extend Fixtures class also exports the test, so I can import and use them in test classes.

Please let me know if you need any new details. Thanks in advance!

tmp_99cfdbd3-7a6b-48d1-bd64-404969882622.png
tmp_5cfcb5e5-95ff-41f7-a40e-3d5bea3f76ce.png

This thread is trying to answer question "Why is Playwright Test UI not detecting tests when implemented using Page object model and how can this issue be resolved?"

6 replies
tennisplayer23

I've seen this issue happen when there's an error somewhere in the code base that the playwright is loading. For me, it was importing something in one test file that Playwright didn't like which caused this issue. Similarly it was extremely hard to figure this out, I only saw it once I ran the test in vscode and the error was thrown.

hananprism
hananprism

Try to click on the console button (Mark in red in the attched image) to figure out the real reason

hananprism
hananprism
tmp_99cfdbd3-7a6b-48d1-bd64-404969882622.png

just checked whole things, no error are there

console field is empty as well.

image.png

I was able to solve the issue by removing testmatch from playwright test config file! silly me left it empty, so it was not matching any test file!!

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.