diff --git a/test/hooks-errors/package.json b/test/hooks-errors/package.json index 61692124..de610253 100644 --- a/test/hooks-errors/package.json +++ b/test/hooks-errors/package.json @@ -1,4 +1,3 @@ { - "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts.", - "smoke": true + "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts." } diff --git a/test/hooks-skip/package.json b/test/hooks-skip/package.json index 61692124..de610253 100644 --- a/test/hooks-skip/package.json +++ b/test/hooks-skip/package.json @@ -1,4 +1,3 @@ { - "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts.", - "smoke": true + "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts." } diff --git a/test/hooks-skip/test.mjs b/test/hooks-skip/test.mjs index 15225f4d..21d5dd54 100644 --- a/test/hooks-skip/test.mjs +++ b/test/hooks-skip/test.mjs @@ -4,6 +4,8 @@ const testDir = new TestDir(import.meta); test(testDir.name, () => { const stdout = execPlaywrightTest(testDir.name, { env: { WORKERS: 1 } }); + + // skipped hooks: BeforeAll 2, Before 2, AfterAll 2, After 2 expectCalls('worker 0: ', stdout, [ 'workerFixtureCommon setup', 'BeforeAll 1', diff --git a/test/special-tag-slow/package.json b/test/special-tag-slow/package.json index 61692124..de610253 100644 --- a/test/special-tag-slow/package.json +++ b/test/special-tag-slow/package.json @@ -1,4 +1,3 @@ { - "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts.", - "smoke": true + "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts." } diff --git a/test/special-tag-timeout/package.json b/test/special-tag-timeout/package.json index 61692124..de610253 100644 --- a/test/special-tag-timeout/package.json +++ b/test/special-tag-timeout/package.json @@ -1,4 +1,3 @@ { - "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts.", - "smoke": true + "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts." } diff --git a/test/step-functions/package.json b/test/step-functions/package.json deleted file mode 100644 index de610253..00000000 --- a/test/step-functions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "This file is required for Playwright to consider this dir as a . It ensures to load 'playwright-bdd' from './test/node_modules/playwright-bdd' and output './test-results' here to avoid conflicts." -} diff --git a/test/step-functions/playwright.config.ts b/test/step-functions/playwright.config.ts deleted file mode 100644 index 167ad723..00000000 --- a/test/step-functions/playwright.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { defineConfig } from '@playwright/test'; -import { defineBddConfig } from 'playwright-bdd'; - -const testDir = defineBddConfig({ - paths: ['*.feature'], - require: ['steps.ts'], -}); - -export default defineConfig({ - testDir, -}); diff --git a/test/step-functions/sample.feature b/test/step-functions/sample.feature deleted file mode 100644 index d3a25c6e..00000000 --- a/test/step-functions/sample.feature +++ /dev/null @@ -1,12 +0,0 @@ -Feature: Playwright style bdd - - Scenario: Check fixtures - Given state with fixtures - arrow fn - Given state without fixtures - arrow fn - Given state with fixtures - function - Given state without fixtures - function - When action 1 - Then result with fixtures and arg equals to "bar" - function - Then result with fixtures and arg equals to "bar" - arrow fn - Then $testInfo is available as a fixture and its title equals to "Check fixtures" - Then $test is available as a fixture and its title equals to "Check fixtures" diff --git a/test/step-functions/sample2.feature b/test/step-functions/sample2.feature deleted file mode 100644 index 59011201..00000000 --- a/test/step-functions/sample2.feature +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Another feature - - Scenario: Another scenario - Given state with fixtures - arrow fn - When action 2 - When async action 3 - Then result with fixtures and arg equals to "bar" - arrow fn diff --git a/test/step-functions/steps.ts b/test/step-functions/steps.ts deleted file mode 100644 index 0c0ce5d9..00000000 --- a/test/step-functions/steps.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { expect } from '@playwright/test'; -import { createBdd } from 'playwright-bdd'; - -const { Given, When, Then } = createBdd(); - -Given('state with fixtures - arrow fn', async ({ page }) => { - expect(page).toBeDefined(); -}); - -Given('state without fixtures - arrow fn', async () => {}); - -Given('state with fixtures - function', async function ({ page }) { - expect(page).toBeDefined(); -}); - -Given('state without fixtures - function', function () {}); - -When('action {int}', ({}, n: number) => { - expect(typeof n).toEqual('number'); -}); - -When(/^async action (\d+)$/, async ({}, n: number) => { - expect(typeof n).toEqual('number'); -}); - -Then( - 'result with fixtures and arg equals to {string} - arrow fn', - async ({ page, browserName }, arg: string) => { - expect(page).toBeDefined(); - expect(browserName).toEqual('chromium'); - expect(arg).toEqual('bar'); - }, -); - -Then( - 'result with fixtures and arg equals to {string} - function', - async function ({ page, browserName }, arg: string) { - expect(page).toBeDefined(); - expect(browserName).toEqual('chromium'); - expect(arg).toEqual('bar'); - }, -); - -Then( - '$testInfo is available as a fixture and its title equals to {string}', - async ({ $testInfo }, title: string) => { - expect($testInfo.title).toEqual(title); - }, -); - -Then( - '$test is available as a fixture and its title equals to {string}', - async ({ $test }, title: string) => { - expect($test.info().title).toEqual(title); - }, -); diff --git a/test/step-functions/test.mjs b/test/step-functions/test.mjs deleted file mode 100644 index 7bbb8cea..00000000 --- a/test/step-functions/test.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { test, TestDir, execPlaywrightTest } from '../_helpers/index.mjs'; - -const testDir = new TestDir(import.meta); - -test(testDir.name, () => execPlaywrightTest(testDir.name));