-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
165 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, `Option "importTestFrom" should point to separate file`), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, `createBdd() should use test extended from "playwright-bdd"`), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name, {}, 'npm test')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTestWithError(t.name, `No BDD configs found`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError( | ||
t.name, | ||
`When using custom "test" function in createBdd() you should`, | ||
), | ||
); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, `Parse error in "sample.feature" (1:1)`), | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Setup | ||
*/ | ||
import fs from 'node:fs'; | ||
import { execSync } from 'node:child_process'; | ||
|
||
setup(); | ||
|
||
function setup() { | ||
!process.env.CI && ensureNodeVersion(20); | ||
|
||
showPlaywrightVersion(); | ||
|
||
// link node_modules/playwright-bdd to dist | ||
// as generated files import { test } from "playwright-bdd" | ||
symlinkPlaywrghtBdd(); | ||
|
||
// must build project before tests as we run tests without ts-node | ||
buildDist(); | ||
} | ||
|
||
function ensureNodeVersion(version) { | ||
if (!process.version.startsWith(`v${version}.`)) { | ||
throw new Error(`Expected node version: ${version}`); | ||
} | ||
} | ||
|
||
function showPlaywrightVersion() { | ||
const { version } = JSON.parse( | ||
fs.readFileSync('node_modules/@playwright/test/package.json', 'utf8'), | ||
); | ||
|
||
console.log(`Playwright version: ${version}`); | ||
} | ||
|
||
function symlinkPlaywrghtBdd() { | ||
// symlink node_modules/playwright-bdd to dist | ||
// as generated files import { test } from "playwright-bdd" | ||
execSync('ln -sfn ../dist ./node_modules/playwright-bdd', { stdio: 'inherit' }); | ||
} | ||
|
||
function buildDist() { | ||
execSync('npm run build', { stdio: 'inherit' }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, `please manually provide different "outputDir" option`), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, [ | ||
`1. Missing step definition for "sample.feature:4:9"`, | ||
`Given('Step without parameters', async function () {`, | ||
`Given('Step with one string parameter {string}', async function (string) {`, | ||
`Missing step definitions (2)`, | ||
]), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTestWithError } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => | ||
execPlaywrightTestWithError(t.name, [ | ||
`1. Missing step definition for "sample.feature:4:9"`, | ||
`Given('Step without parameters', async ({}) => {`, | ||
`Given('Step with one string parameter {string}', async ({}, arg: string) => {`, | ||
`Given('Step with two string parameters {string} and {string}', async ({}, arg: string, arg1: string) => {`, | ||
`Given('Step with one float parameter {float}', async ({}, arg: number) => {`, | ||
`Given('Step with one int parameter {int}', async ({}, arg: number) => {`, | ||
`Given('Step with two int parameters {int} and {int}', async ({}, arg: number, arg1: number) => {`, | ||
`Given('Step with docString', async ({}, docString: string) => {`, | ||
`Given('Step with dataTable', async ({}, dataTable: DataTable) => {`, | ||
`When('I click link {string}', async ({}, arg: string) => {`, | ||
`Then('I see in title {string}', async ({}, arg: string) => {`, | ||
`Missing step definitions (10)`, | ||
]), | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import test from 'node:test'; | ||
import { getTestName, execPlaywrightTest } from '../helpers.mjs'; | ||
|
||
test(getTestName(import.meta), (t) => execPlaywrightTest(t.name)); |