I have many playwright test cases; I want to run some of the selected test cases only on Chrome. How can that be achieved?
Example:
test('test 1', async () => {
});
test('test 2', async () => {
});
test('test 3', async () => {
});
Now I want the test 1
case to run only on Chrome and the rest of them by default should run on every browser.
I expect there is a better way to do this with some config magic, but you could conditionally skip based on the browser:
test('Hello World', async ({ browserName, page }) => {
test.skip(browserName.toLowerCase() !== 'chromium',
`Test only for chromium!`);
// rest of test
});