microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
778 stars 34 forks source link

Parameterized tests w/ test.each #34

Closed jperl closed 4 years ago

jperl commented 4 years ago

It would be nice to support parameterized tests, similar to jest's test.each

JoelEinbinder commented 4 years ago

Parameterized tests is a must!

I've been playing with AVA's macros, and I really like how they help the typescript story. Maybe we should have both macros and test.each? For reference, here's the issue in AVA where they discuss this functionality: https://github.com/avajs/ava/issues/1967

jperl commented 4 years ago

Does this runner support defining tests at runtime? I know the default Jest runner does not, which is why they need test.each. Then a for each loop would just work without needing another API to learn.

JoelEinbinder commented 4 years ago

A for each loop works for now. I'm not sure why jest-runner doesn't support defining tests at runtime. Maybe they are doing some static analysis to decide which tests to run? There's a good chance that if they need it, we will find out we need it as well.

I think I need parameterized tests internally in order to do multiple browsers, so I'll work on describe.each anyway.