-
Notifications
You must be signed in to change notification settings - Fork 0
test: set up BDD/E2E test support #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@claude can you please give me a deep review of this PR? with special attention to the testing approach |
|
Claude finished @kantord's task —— View job Deep Review of BDD/E2E Test Setup
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces comprehensive BDD/E2E testing infrastructure using Cucumber for behavior-driven scenarios and Playwright for browser automation.
Key changes:
- Sets up Cucumber with Playwright for natural-language E2E tests
- Adds ARIA role-based test steps with custom phrase mappings for improved readability
- Implements authentication cookie reuse pattern to optimize test execution speed
- Configures CI workflow to run E2E tests with proper service orchestration
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Adds BDD test scripts and dependencies (@cucumber/cucumber, @playwright/test, aria-query, ts-node) |
cucumber.js |
Configures Cucumber runner with TypeScript support, step definitions, and feature file paths |
tsconfig.json |
Excludes BDD test directory from TypeScript compilation |
.gitignore |
Adds Playwright/Cucumber test artifacts to ignore list |
.github/workflows/bdd.yml |
Defines CI workflow for running E2E tests with dev stack orchestration |
tests/bdd/support/world.ts |
Implements Playwright World constructor with page/context management |
tests/bdd/support/hooks.ts |
Sets up Cucumber lifecycle hooks for browser management, tracing, and debugging |
tests/bdd/support/roles.ts |
Provides ARIA role phrase mapping for natural step definitions |
tests/bdd/support/parameter-types.ts |
Defines custom Cucumber parameter type for ARIA roles |
tests/bdd/support/auth.ts |
Implements authentication cookie injection helper to avoid repeated login flows |
tests/bdd/steps/global.steps.ts |
Defines reusable step definitions for navigation, interactions, and assertions |
tests/bdd/features/login.feature |
Example feature file testing authentication flow |
tests/bdd/features/catalog.feature |
Example feature file for catalog page verification |
src/mocks/server.ts |
Adds health endpoint for CI readiness checks and filters health logs |
README.md |
Documents BDD testing setup, commands, and CI integration |
CLAUDE.md |
Updates architecture documentation with BDD testing details and corrects API/auth references |
pnpm-lock.yaml |
Locks new dependencies for Cucumber, Playwright, and related packages |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| module.exports = { | ||
| default: { | ||
| requireModule: ["ts-node/register/transpile-only"], | ||
| require: [ | ||
| "tests/bdd/support/world.ts", | ||
| "tests/bdd/support/hooks.ts", | ||
| "tests/bdd/support/roles.ts", | ||
| "tests/bdd/support/parameter-types.ts", | ||
| "tests/bdd/support/auth.ts", | ||
| "tests/bdd/steps/**/*.ts", | ||
| ], | ||
| paths: ["tests/bdd/features/**/*.feature"], | ||
| publishQuiet: true, | ||
| format: ["progress"], | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why we need cucumber? we cannot handle everything within playwright? cucumber is not so common in UI as a testing framework
| let browser: Browser | undefined; | ||
| const TRACE_ENABLED = process.env.PWTRACE === "1"; | ||
|
|
||
| setDefaultTimeout(60_000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this timeout mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the default timeout for steps. but that is way more than we need so we should probably reduce it to sth like 1 second
peppescg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are using playwright for the chromium instance, but cucumber as testing framework?

this sets up "end to end" testing for the project:
gotchas: