-
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
Open
kantord
wants to merge
24
commits into
main
Choose a base branch
from
set-up-playwright
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
07d6e48
test: set up BDD/E2E test support
kantord 079aa97
Merge branch 'main' into set-up-playwright
kantord ce5a53d
add inspector mode
kantord 8a2da1f
add tracing mode
kantord a3c2cd7
automate all aria roles for cucumber tests
kantord f70d24a
simplify some stuff
kantord 9da119c
.
kantord a188a5e
.
kantord 2f96c6f
.
kantord 90d40bb
Merge branch 'main' into set-up-playwright
kantord 6cc0279
fixes
kantord 4fd4ff0
login "fixture"
kantord f44313f
do not hang after successful run
kantord d5264ac
cookie injection to keep authentication fast
kantord d10417b
fix ci failure
kantord cc0d781
.
kantord 4e43d58
.
kantord 30fb891
Merge branch 'main' into set-up-playwright
kantord 5430b64
.
kantord acdc496
implement review suggestions
kantord fe563b7
cleanup
kantord 123250d
cleanup
kantord 2cd7547
remove unused rule definition
kantord d3ddb4c
stricted path for healthcheck url
kantord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,66 @@ | ||
| name: BDD E2E | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["**"] | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: Run BDD (Cucumber + Playwright) | ||
peppescg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||
kantord marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: pnpm exec playwright install --with-deps | ||
|
|
||
| - name: Start dev stack (Next + OIDC + Mock) | ||
| env: | ||
| API_BASE_URL: http://localhost:9090 | ||
| OIDC_ISSUER_URL: http://localhost:4000 | ||
| OIDC_CLIENT_ID: better-auth-dev | ||
| OIDC_CLIENT_SECRET: dev-secret-change-in-production | ||
| NEXT_PUBLIC_OIDC_PROVIDER_ID: okta | ||
| BETTER_AUTH_URL: http://localhost:3000 | ||
| BETTER_AUTH_SECRET: ci-test-secret-not-for-production | ||
| run: | | ||
| pnpm dev & | ||
| echo $! > dev.pid | ||
| # Wait for Next (3000), OIDC (4000 - use discovery endpoint), and Mock API (9090 - use health endpoint) | ||
| for url in http://localhost:3000 http://localhost:4000/.well-known/openid-configuration http://localhost:9090/health; do | ||
| echo "Waiting for $url..." | ||
| up=false | ||
| for i in {1..60}; do | ||
| if curl -sf "$url" >/dev/null; then | ||
| echo "$url is up" | ||
| up=true | ||
| break | ||
| fi | ||
| sleep 2 | ||
| done | ||
| if [ "$up" = false ]; then | ||
| echo "ERROR: $url failed to start" | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| - name: Run BDD tests | ||
| env: | ||
| BASE_URL: http://localhost:3000 | ||
| run: pnpm run test:bdd | ||
|
|
||
| - name: Cleanup dev | ||
| if: always() | ||
| run: | | ||
| if [ -f dev.pid ]; then kill $(cat dev.pid) || true; fi | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| 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"], | ||
| }, | ||
| }; | ||
|
Comment on lines
+1
to
+16
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.