Open dylang opened 1 year ago
The @tag
feature does not work for this because we manage the equivalent of tags in the external test manager (Zephyr for Jira).
For example, managers can use this tool to add labels, like a customer id, and we don't want them to modify the test code to do this.
A potentially alternative is dynamically generating the grep
expression for a project because our Playwright config export can be an async function!
I'm experimenting with this now.
It's not a full fix though, because we aren't provided the list of tests, which would make this easier to implement and more powerful.
I'm willing to make a pull request for this feature if there is interest from the Playwright team.
Can we also add the ability to include fixme
/skip
tests?
Hi @gajus, I appreciate your suggestion. I'm not sure if I'll be able to implement that kind of static state change to a test. I was more thinking just simple array filtering.
Hi, I've figured out a workaround, so maybe it's a matter of documentation and examples:
playwright.config.ts
can return an async function. (Is this documented?)string[]
.Example:
E2E_TEST_CYCLE=ETOE-C4970 yarn playwright test
Wow, good to know!
It would be great to be able to pass a predicate function to a TestProject
config.
Something like testTitlePredicate?: (title: string) => boolean;
I tried doing this a while ago but never got around to finishing it: https://github.com/microsoft/playwright/compare/main...amtabug:playwright:testFilterPredicate
Hi!
Problem
We don't have a programmatic way to pick which tests are used.
Background
We have a test tracking system (Zephyr for Jira) that we use to group test in various ways, such as by feature.
How this is handled today with Playwright
Every test file has a ticket number in the filename.
We manually look in the test tracking system for, say, the 7-100 tickets associated with a feature we are interested in, and put those on the command line or in the CI system:
This is tedious and error-prone.
Proposed Solution
A programmatic API for filtering the available tests.
The API will provide an array of all tests found by Playwright based on the existing command line and project settings. The function returns a promise of the same shape array of tests, but not necessary all of the tests need to be included.
It is up to developers using the API to determine how they want to handle the filtering.
Simplified example:
Custom Filter code:
Prior work
We're doing this today in Jest using their Custom Sequencer API.