Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/uuv-github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
checks: write

env:
NODE_VERSION: 20.16.0
NODE_VERSION: 22.17.0
NPM_PACKAGE_SCOPE: uuv
UUV_BASE_URL: https://e2e-test-quest.github.io

Expand Down
20,144 changes: 5,967 additions & 14,177 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"packages/*"
],
"engines": {
"node": "^20.0.0"
"node": "^22.17.0"
},
"funding": {
"type": "opencollective",
Expand Down
2 changes: 1 addition & 1 deletion packages/assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@uiw/codemirror-theme-github": "^4.22.1",
"@uiw/react-codemirror": "^4.22.1",
"@uuv/runner-commons": "2.59.2",
"antd": "5.26.5",
"antd": "5.27.1",
"eslint-config-react-app": "7.0.1",
"figlet": "1.8.1",
"playwright-chromium": "1.52.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/runner-playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"dependencies": {
"@cucumber/cucumber": "11.0.1",
"@cucumber/tag-expressions": "6.2.0",
"@playwright/test": "1.52.0",
"@playwright/test": "^1.55.0",
"@uuv/a11y": "1.0.0-beta.77",
"@uuv/runner-commons": "2.59.2",
"axe-core": "4.10.3",
Expand All @@ -56,7 +56,7 @@
"lodash": "^4.17.21",
"multiple-cucumber-html-reporter": "3.9.0",
"nanoid": "3.3.11",
"playwright-bdd": "8.3.0",
"playwright-bdd": "8.4.0",
"ts-node": "10.9.2",
"typescript": "5.8.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/runner-playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
"src/cucumber/step_definitions/playwright/**/*.{ts,js}"
],
"tests/.features-gen",
"e2e"
"."
),
testMatch: ["**/*.spec.ts", "**/*.{ts,js}"],
/* Run tests in files in parallel */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DEFAULT_TIMEOUT, fs, KEY_PRESS } from "@uuv/runner-commons";
import { key } from "@uuv/runner-commons/wording/web";
import { checkA11y, injectAxe } from "axe-playwright";
import { devices, expect } from "@playwright/test";
import { Locator, Page } from "playwright";
import { Locator } from "playwright";
import { DataTable } from "@cucumber/cucumber";
import {
addCookie,
Expand Down Expand Up @@ -373,8 +373,8 @@ Then(`${key.then.element.not.withTestId}`, async function(testId: string) {
Then(
`${key.then.a11y.axecore.default}`,
async function() {
await injectAxe(this.page as Page);
await checkA11y(this.page as Page);
await injectAxe(this.page as any);
await checkA11y(this.page as any);
});

/**
Expand All @@ -383,10 +383,10 @@ Then(
Then(
`${key.then.a11y.axecore.withFixtureOption}`,
async function(option: any) {
await injectAxe(this.page as Page);
await injectAxe(this.page as any);
const optionFile = await fs.readFileSync(path.join(getConfigDir(), `playwright/fixtures/${option}`));
const optionJson = JSON.parse(optionFile.toString());
await checkA11y(this.page as Page, undefined, {
await checkA11y(this.page as any, undefined, {
axeOptions: optionJson as RunOptions
});
});
Expand All @@ -402,11 +402,11 @@ function getConfigDir(): string {
Then(
`${key.then.a11y.axecore.withFixtureContextAndFixtureOption}`,
async function(context: any, option: any) {
await injectAxe(this.page as Page);
await injectAxe(this.page as any);
const contextFile = await fs.readFileSync(path.join(getConfigDir(), `playwright/fixtures/${context}`));
const optionFile = await fs.readFileSync(path.join(getConfigDir(), `playwright/fixtures/${option}`));
const optionJson = JSON.parse(optionFile.toString());
await checkA11y(this.page as Page, JSON.parse(contextFile.toString()) as ContextObject, {
await checkA11y(this.page as any, JSON.parse(contextFile.toString()) as ContextObject, {
axeOptions: optionJson as RunOptions
});
});
Expand All @@ -417,8 +417,8 @@ Then(
Then(
`${key.then.a11y.axecore.onlyCritical}`,
async function() {
await injectAxe(this.page as Page);
await checkA11y(this.page as Page, undefined, {
await injectAxe(this.page as any);
await checkA11y(this.page as any, undefined, {
includedImpacts: ["critical"]
});
});
Expand All @@ -429,8 +429,8 @@ Then(
Then(
`${key.then.a11y.axecore.withImpacts}`,
async function(impacts: any) {
await injectAxe(this.page as Page);
await checkA11y(this.page as Page, undefined, {
await injectAxe(this.page as any);
await checkA11y(this.page as any, undefined, {
includedImpacts: [impacts]
});
});
Expand All @@ -441,8 +441,8 @@ Then(
Then(
`${key.then.a11y.axecore.withTags}`,
async function(tags: any) {
await injectAxe(this.page as Page);
await checkA11y(this.page as Page, undefined, {
await injectAxe(this.page as any);
await checkA11y(this.page as any, undefined, {
axeOptions: {
runOnly: {
type: "tag",
Expand Down
2 changes: 1 addition & 1 deletion packages/runner-playwright/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function buildConfig(
"../node_modules/@uuv/playwright/dist/cucumber/step_definitions/playwright/**/*.js"
],
output = ".uuv-features-gen",
featuresRoot: "uuv/e2e") {
featuresRoot = ".") {
return defineBddConfig({
features: features,
steps: steps,
Expand Down
37 changes: 21 additions & 16 deletions packages/runner-playwright/src/tests/report/report.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,50 @@ describe("Runner Playwright JunitReport", () => {
});

test("Should fail for test : Error when waiting a mock without instanciate a mock before", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › Error when waiting a mock without instanciate a mock before");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › Error when waiting a mock without instanciate a mock before");
expect(testCase?.failure._).toContain("Mock uuvFixture must be defined before use this sentence");
});

test("Should fail for test : Ko Homepage - Bad title", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › Homepage - Bad title");
expect(testCase?.failure._).toContain("Error: Timed out 6000ms waiting for expect(locator).toHaveCount(expected)");
expect(testCase?.failure._).toContain("Locator: getByRole('heading', { name: 'Welcome to Weather App - ko', exact: true })");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › Homepage - Bad title");
expect(testCase?.failure._).toContain("Error: expect(locator).toHaveCount(expected) failed");
expect(testCase?.failure._).toContain("Timeout: 6000ms");
expect(testCase?.failure._).toContain("Locator: getByRole('heading', { name: 'Welcome to Weather App - ko', exact: true })");
});

test("Should fail for test : Ko TownResearch - Bad textbox name", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › TownResearch - Bad textbox name");
expect(testCase?.failure._).toContain("Error: Timed out 6000ms waiting for expect(locator).toHaveCount(expected)");
expect(testCase?.failure._).toContain("Locator: getByRole('textbox', { name: 'Search for a town3', exact: true })");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › TownResearch - Bad textbox name");
expect(testCase?.failure._).toContain("Error: expect(locator).toHaveCount(expected) failed");
expect(testCase?.failure._).toContain("Timeout: 6000ms");
expect(testCase?.failure._).toContain("Locator: getByRole('textbox', { name: 'Search for a town3', exact: true })");
});

test("Should fail for test : Ko click failed with custom timeout", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › click failed with custom timeout");
expect(testCase?.failure._).toContain("Error: Timed out 9000ms waiting for expect(locator).toHaveCount(expected)");
expect(testCase?.failure._).toContain("Locator: getByRole('button', { name: 'Timer ended', exact: true })");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › click failed with custom timeout");
expect(testCase?.failure._).toContain("Error: expect(locator).toHaveCount(expected) failed");
expect(testCase?.failure._).toContain("Timeout: 9000ms");
expect(testCase?.failure._).toContain("Locator: getByRole('button', { name: 'Timer ended', exact: true })");
});

test("Should fail for test : Ko table", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › Table content should failed when wrong content");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › Table content should failed when wrong content");
expect(testCase?.failure._).toContain("Error: cell at index [2, 1] should be Etienne Daaho");
expect(testCase?.failure._).toContain("Locator: getByRole('row').nth(2).getByRole('cell').nth(1)");
expect(testCase?.failure._).toContain("Expected string: \"Etienne Daaho\"");
expect(testCase?.failure._).toContain("Received string: \"Francisco Chang\"");
});

test("Should fail for test : Select a value in combo box then check - Bad value", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › Select a value in combo box then check - Bad value");
expect(testCase?.failure._).toContain("Error: Timed out 6000ms waiting for expect(locator).toHaveCount(expected)");
expect(testCase?.failure._).toContain("Locator: getByRole('combobox', { name: 'Town type', exact: true }).getByRole('option', { name: 'Unreal1', exact: true, selected: true })");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › Select a value in combo box then check - Bad value");
expect(testCase?.failure._).toContain("Error: expect(locator).toHaveCount(expected) failed");
expect(testCase?.failure._).toContain("Timeout: 6000ms");
expect(testCase?.failure._).toContain("Locator: getByRole('combobox', { name: 'Town type', exact: true }).getByRole('option', { name: 'Unreal1', exact: true, selected: true })");
});

test("Should fail for test : Set a input text value then check - Bad value", () => {
const testCase = JunitReportHelper.getTestCase(report, "ko.feature.spec.js", "Ko › Set a input text value then check - Bad value");
expect(testCase?.failure._).toContain("Error: Timed out 6000ms waiting for expect(locator).toHaveValue(expected)");
const testCase = JunitReportHelper.getTestCase(report, "e2e/ko.feature.spec.js", "Ko › Set a input text value then check - Bad value");
expect(testCase?.failure._).toContain("Error: expect(locator).toHaveValue(expected) failed");
expect(testCase?.failure._).toContain("Timeout: 6000ms");
expect(testCase?.failure._).toContain("Locator: getByRole('textbox', { name: 'Town name', exact: true })");
expect(testCase?.failure._).toContain("Expected string: \"Qwerty\"");
expect(testCase?.failure._).toContain("Received string: \"Azerty\"");
Expand Down
Loading