Hello Playwright team, currentlly for passing parameters in tests we can use 'for loop'.
// example.spec.ts
const people = ['Alice', 'Bob'];
for (const name of people) {
test(`testing with ${name}`, async () => {
});
}
We tent to use multiple params and I was wondering if it is possible to have more elegant and easy to read representation like we have for example in other test runners:
NUnit:
[TestCase(10,10,10,90)]
[TestCase(10,10,0,100)]
public void testCalculate(double price,int quantity,double discount,double expectedFinalAmount) {...}
Cucumber:
Scenario Outline: Test Name
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
Jest
test.each`
a | b | expected
${1} | ${1} | ${2}
${1} | ${2} | ${3}
${2} | ${1} | ${3}
`('returns $expected when $a is added to $b', ({a, b, expected}) => { expect(a + b).toBe(expected); });
Hello Playwright team, currentlly for passing parameters in tests we can use 'for loop'.
We tent to use multiple params and I was wondering if it is possible to have more elegant and easy to read representation like we have for example in other test runners:
NUnit:
Cucumber:
Jest