A blocker I'm facing when creating test in playwright

I am writing tests using playwright but I want my test to check for a condition before it runs else another test should run. I don’t know if this is possible in playwright but I think it should.

I have tried using conditional statements but it’s not working.

I am using POM

Please I need any help I can get

1 Like

I only used Playwight a while ago and stopped. But have a look at this page

It has a section on skipping a test based on condition. Maybe it helps

test(‘skip this test’, async ({ page, browserName }) => {
test.skip(browserName === ‘firefox’, ‘Still working on it’);