In Playwright, if you wish to avoid executing all tests on the mobile view, you have the option to remove the corresponding configuration. However, if you want to skip specific test or a group of tests, I recommend following the guidelines provided in the associated article.
Table of Contents
Skip Specific Test
Consider a specific test exist on Desktop View, not on mobile view:
test('Test 1', async ({ page, isMobile }) => {
if(isMobile) {
test.skip();
}
// Statements for other view
})
Test will be moved to skipped section.
Skip Group of Tests
In case set of test cases are not for mobile view. You can group them using describe and add below statement in describe block.
test.describe('Login', ()=>
{
test.skip(({ isMobile }) => isMobile == true);
})
- Log in to post comments