-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
18 changed files
with
8,562 additions
and
3,797 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ playwright-report | |
|
||
.nx/cache | ||
.env | ||
.nx | ||
update.sh | ||
cucumber-report |
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 |
---|---|---|
@@ -1,16 +1,7 @@ | ||
Feature: Playwright Home Page | ||
Feature: Playwright Home Page (app1) | ||
|
||
@firefox | ||
Scenario: Check title | ||
Given I am on Playwright home page | ||
Then I see in title "Playwright" | ||
|
||
Scenario Outline: Check get started | ||
Given I am on Playwright home page | ||
When I click link "<link>" | ||
Then I see in title "<title>" | ||
|
||
Examples: | ||
| link | title | | ||
| Get started | Installation | | ||
| API reference | Library | | ||
When I click link "Get started" | ||
Then I see in title "Installation" | ||
|
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 |
---|---|---|
@@ -1,29 +1,11 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import { defineBddConfig } from 'playwright-bdd'; | ||
import { defineConfig } from "@playwright/test"; | ||
import { defineBddConfig } from "playwright-bdd"; | ||
|
||
const testDir = defineBddConfig({ | ||
importTestFrom: 'steps/fixtures.ts', | ||
paths: ['./features'], | ||
require: ['steps/*.ts'], | ||
quotes: 'backtick', | ||
featuresRoot: './features', | ||
features: "./features", | ||
steps: "steps/*.ts", | ||
}); | ||
|
||
export default defineConfig({ | ||
testDir, | ||
reporter: 'html', | ||
use: { | ||
screenshot: 'only-on-failure', | ||
baseURL: 'http://localhost:3000', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
] | ||
}); |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"bddgen": {}, | ||
"e2e": {} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { test as base } from 'playwright-bdd'; | ||
import { TodoPage } from './TodoPage'; | ||
import { test as base, createBdd } from "playwright-bdd"; | ||
|
||
export const test = base.extend<{ todoPage: TodoPage, browserSpecificTest: void }>({ | ||
todoPage: async ({ page }, use) => use(new TodoPage(page)), | ||
browserSpecificTest: [async ({ $tags }, use, testInfo) => { | ||
if ($tags.includes('@firefox') && testInfo.project.name !== 'firefox') { | ||
testInfo.skip(); | ||
} | ||
await use(); | ||
}, { auto: true }], | ||
export const test = base.extend<{ myFixture: string }>({ | ||
myFixture: async ({}, use) => use("my custom fixture"), | ||
}); | ||
|
||
export const { Given, When, Then } = createBdd(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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { expect } from '@playwright/test'; | ||
import { createBdd } from 'playwright-bdd'; | ||
import { test } from './fixtures'; | ||
import { expect } from "@playwright/test"; | ||
import { Given, Then, When } from "./fixtures"; | ||
|
||
const { Given, When, Then } = createBdd(test); | ||
|
||
Given('I am on Playwright home page', async ({ page }) => { | ||
await page.goto('https://playwright.dev'); | ||
Given("I am on Playwright home page", async ({ page }) => { | ||
await page.goto("https://playwright.dev"); | ||
}); | ||
|
||
When('I click link {string}', async ({ page }, name: string) => { | ||
await page.getByRole('link', { name }).click(); | ||
When("I click link {string}", async ({ page }, name: string) => { | ||
await page.getByRole("link", { name }).click(); | ||
}); | ||
|
||
Then('I see in title {string}', async ({ page }, text: string) => { | ||
Then("I see in title {string}", async ({ page }, text: string) => { | ||
await expect(page).toHaveTitle(new RegExp(text)); | ||
}); |
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 |
---|---|---|
@@ -1,16 +1,7 @@ | ||
Feature: Playwright Home Page | ||
Feature: Playwright Home Page (app2 | ||
|
||
@firefox | ||
Scenario: Check title | ||
Given I am on Playwright home page | ||
Then I see in title "Playwright" | ||
|
||
Scenario Outline: Check get started | ||
Given I am on Playwright home page | ||
When I click link "<link>" | ||
Then I see in title "<title>" | ||
|
||
Examples: | ||
| link | title | | ||
| Get started | Installation | | ||
| API reference | Library | | ||
When I click link "Get started" | ||
Then I see in title "Installation" | ||
|
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 |
---|---|---|
@@ -1,29 +1,11 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import { defineBddConfig } from 'playwright-bdd'; | ||
import { defineConfig } from "@playwright/test"; | ||
import { defineBddConfig } from "playwright-bdd"; | ||
|
||
const testDir = defineBddConfig({ | ||
importTestFrom: 'steps/fixtures.ts', | ||
paths: ['./features'], | ||
require: ['steps/*.ts'], | ||
quotes: 'backtick', | ||
featuresRoot: './features', | ||
features: "./features", | ||
steps: "steps/*.ts", | ||
}); | ||
|
||
export default defineConfig({ | ||
testDir, | ||
reporter: 'html', | ||
use: { | ||
screenshot: 'only-on-failure', | ||
baseURL: 'http://localhost:3000', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
] | ||
}); |
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { test as base } from 'playwright-bdd'; | ||
import { TodoPage } from './TodoPage'; | ||
import { test as base, createBdd } from "playwright-bdd"; | ||
|
||
export const test = base.extend<{ todoPage: TodoPage, browserSpecificTest: void }>({ | ||
todoPage: async ({ page }, use) => use(new TodoPage(page)), | ||
browserSpecificTest: [async ({ $tags }, use, testInfo) => { | ||
if ($tags.includes('@firefox') && testInfo.project.name !== 'firefox') { | ||
testInfo.skip(); | ||
} | ||
await use(); | ||
}, { auto: true }], | ||
export const test = base.extend<{ myFixture: string }>({ | ||
myFixture: async ({}, use) => use("my custom fixture"), | ||
}); | ||
|
||
export const { Given, When, Then } = createBdd(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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { expect } from '@playwright/test'; | ||
import { createBdd } from 'playwright-bdd'; | ||
import { test } from './fixtures'; | ||
import { expect } from "@playwright/test"; | ||
import { Given, Then, When } from "./fixtures"; | ||
|
||
const { Given, When, Then } = createBdd(test); | ||
|
||
Given('I am on Playwright home page', async ({ page }) => { | ||
await page.goto('https://playwright.dev'); | ||
Given("I am on Playwright home page", async ({ page }) => { | ||
await page.goto("https://playwright.dev"); | ||
}); | ||
|
||
When('I click link {string}', async ({ page }, name: string) => { | ||
await page.getByRole('link', { name }).click(); | ||
When("I click link {string}", async ({ page }, name: string) => { | ||
await page.getByRole("link", { name }).click(); | ||
}); | ||
|
||
Then('I see in title {string}', async ({ page }, text: string) => { | ||
Then("I see in title {string}", async ({ page }, text: string) => { | ||
await expect(page).toHaveTitle(new RegExp(text)); | ||
}); |
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
Oops, something went wrong.