Skip to content

Commit

Permalink
add slow tests example
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Feb 7, 2024
1 parent d7c6ac5 commit 5e0e2ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions features/todopage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Todo Page
Background:
Given I am on todo page

@slow
Scenario: Empty list
Then visible todos count is 0
And page screenshot matches previous one
Expand Down
6 changes: 5 additions & 1 deletion steps/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { test as base } from 'playwright-bdd';
import { TodoPage } from './TodoPage';

export const test = base.extend<{ todoPage: TodoPage, browserSpecificTest: void }>({
export const test = base.extend<{ todoPage: TodoPage, browserSpecificTest: void, slowTest: void }>({
todoPage: async ({ page }, use) => use(new TodoPage(page)),
slowTest: [async ({ $tags }, use, testInfo) => {
if ($tags.includes('@slow')) testInfo.setTimeout(5000);
await use();
}, { auto: true }],
browserSpecificTest: [async ({ $tags }, use, testInfo) => {
if ($tags.includes('@firefox') && testInfo.project.name !== 'firefox') {
testInfo.skip();
Expand Down

0 comments on commit 5e0e2ed

Please sign in to comment.