Rayrun
← Back to Discord Forum

Generate a fixture dependency tree

cserby_02195posted in #help-playwright
Open in Discord

In order to identify some tests (amongst many) that don't depend on a specific fixture (like the ones that don't require page), I'd need to have a list of fixtures the test case depends on. For pytest, a plugin exists that does that: https://github.com/pytest-dev/pytest-fixture-tools#fixture-graph Would there be something similar for Playwright already? If not, what'd be the easiest way forward? I've inspected the API docs for TestInfo, but I see no solution so far.

tree-99852_640.jpg

This thread is trying to answer question "Is there a tool similar to the pytest plugin for Playwright that can generate a list of fixtures a test case depends on? If not, what is the easiest way to achieve this?"

2 replies

I'm not sure if that's what you need, but pytest have some arguments that could help.

pytest --collect-only --fixtures-per-test This would print tests and all related fixtures for that test (collect only makes it as dry-run not actually running any test)

But reading it again when you say "for playwright" you mean for nodejs?

I think the easiest way would be to add console logs to each fixture and running the test.

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 [email protected].