-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Closed
Copy link
Description
Hi team. It's a proposal for Playwright Test Runner.
I really like parameterized tests, they allow to decrease amount of code:
https://playwright.dev/docs/test-parameterize#parameterized-tests
What I don't like in them: debugging.
Because I need:
- Set "only" for the
testfunction. - Comment a part of test data array (sometimes it can be really huge, so scroll up, scroll down).
- Run the test, debug, fix the problem.
- Uncomment test data and remove "only".
Feature request: it would be really nice to have something like test.first and test.last functions to easily debug parameterized tests.
test.first runs the first test only (takes the first element from test data array).
test.last runs the last only.
So it could look like:
const testData = [1, 2, 3, 4, 5];
// should pass
testData.forEach(data => {
test.first('check array value 1', () => {
expect(data).toBe(1);
});
});
// should fail
testData.forEach(data => {
test.last('check array value 2', () => {
expect(data).toBe(1);
});
});I hope it's possible to implement and you'll like the idea :)
Metadata
Metadata
Assignees
Labels
No labels