Skip to content

Commit

Permalink
chore: update examples for v7
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Jul 23, 2024
1 parent 1fb1dc2 commit 1db676e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
11 changes: 5 additions & 6 deletions examples/basic/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { defineConfig } from '@playwright/test';
import { defineBddConfig, cucumberReporter } from 'playwright-bdd';

// before playwright-bdd v7
const testDir = defineBddConfig({
paths: ['features/*.feature'],
require: ['features/steps/*.ts'],
features: 'features/*.feature',
steps: 'features/steps/*.ts',
});

// since playwright-bdd v7
// before playwright-bdd v7
/*
const testDir = defineBddConfig({
features: 'features/*.feature',
steps: 'features/steps/*.ts',
paths: ['features/*.feature'],
require: ['features/steps/*.ts'],
});
*/

Expand Down
13 changes: 6 additions & 7 deletions examples/cucumber-style/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { defineConfig } from '@playwright/test';
import { defineBddConfig, cucumberReporter } from 'playwright-bdd';

// before playwright-bdd v7
const testDir = defineBddConfig({
paths: ['features'],
require: ['features/steps/*.ts'],
importTestFrom: 'features/steps/fixtures.ts',
features: 'features',
steps: 'features/steps/*.ts',
});

// since playwright-bdd v7
// before playwright-bdd v7
/*
const testDir = defineBddConfig({
features: 'features',
steps: 'features/steps/*.ts',
paths: ['features'],
require: ['features/steps/*.ts'],
importTestFrom: 'features/steps/fixtures.ts',
});
*/

Expand Down
11 changes: 5 additions & 6 deletions examples/decorators/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { defineConfig } from '@playwright/test';
import { defineBddConfig, cucumberReporter } from 'playwright-bdd';

// before playwright-bdd v7
const testDir = defineBddConfig({
paths: ['features'],
importTestFrom: 'features/steps/fixtures.ts',
features: 'features',
steps: 'features/steps/*.ts',
});

// since playwright-bdd v7
// before playwright-bdd v7
/*
const testDir = defineBddConfig({
features: 'features',
steps: 'features/steps/*.ts',
paths: ['features'],
importTestFrom: 'features/steps/fixtures.ts',
});
*/

Expand Down
11 changes: 5 additions & 6 deletions examples/esm/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { defineConfig } from '@playwright/test';
import { defineBddConfig, cucumberReporter } from 'playwright-bdd';

// before playwright-bdd v7
const testDir = defineBddConfig({
paths: ['features/*.feature'],
import: ['features/steps/*.ts'], // <- note 'import' instead of 'require'
features: 'features/*.feature',
steps: 'features/steps/*.ts',
});

// since playwright-bdd v7
// before playwright-bdd v7
/*
const testDir = defineBddConfig({
features: 'features/*.feature',
steps: 'features/steps/*.ts',
paths: ['features/*.feature'],
import: ['features/steps/*.ts'], // <- note 'import' instead of 'require'
});
*/

Expand Down

0 comments on commit 1db676e

Please sign in to comment.