File tree Expand file tree Collapse file tree 5 files changed +25
-18
lines changed
Expand file tree Collapse file tree 5 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -262,26 +262,26 @@ BETTER_AUTH_URL=http://localhost:3000
262262
263263### Testing
264264
265+ #### Unit/Component Tests
266+
265267``` bash
266- # Run all tests
267- pnpm test
268+ pnpm test # Run all tests
269+ pnpm test --watch # Watch mode
270+ pnpm test --coverage # With coverage
271+ ```
268272
269- # Run tests in watch mode
270- pnpm test --watch
273+ Uses Vitest + Testing Library + MSW.
271274
272- # Run tests with coverage
273- pnpm test --coverage
275+ #### BDD E2E Tests (Cucumber + Playwright)
274276
275- # Run specific test file
276- pnpm test src/components/navbar.test.tsx
277+ ``` bash
278+ pnpm exec playwright install # One-time browser install
279+ pnpm dev # Start dev stack
280+ pnpm run test:bdd # Run scenarios (headless)
281+ pnpm run test:bdd:debug # With Playwright Inspector
282+ pnpm run test:bdd:trace # Capture traces
277283```
278284
279- Tests use:
280-
281- - ** Vitest** - Test runner
282- - ** Testing Library** - React component testing
283- - ** MSW** - API mocking
284-
285285### Mock Server
286286
287287The project includes a standalone MSW mock server for development:
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ Feature: Catalog page
33 Scenario : View catalog page header
44 Given I am logged in
55 And I am on "/catalog"
6- Then I should see a heading "MCP Server Catalog"
6+ Then I should see an "MCP Server Catalog" heading
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Feature: Login flow
44 Given I am on "/signin"
55 When I click on the "Okta" button
66 Then I should be on "/catalog"
7- And I should see a heading "MCP Server Catalog"
7+ And I should see an "MCP Server Catalog" heading
88
99 Scenario : Log out from Catalog
1010 Given I am logged in
Original file line number Diff line number Diff line change 2626) ;
2727
2828Then (
29- "I should see a heading {string}" ,
30- async function ( this : PlaywrightWorld , heading : string ) {
29+ "I should see {article} {string} heading " ,
30+ async function ( this : PlaywrightWorld , _article : null , heading : string ) {
3131 await expect (
3232 this . requirePage ( ) . getByRole ( "heading" , { name : heading } ) ,
3333 ) . toBeVisible ( ) ;
Original file line number Diff line number Diff line change @@ -17,3 +17,10 @@ defineParameterType({
1717 throw new Error ( `Unknown role phrase "${ text } ".` ) ;
1818 } ,
1919} ) ;
20+
21+ defineParameterType ( {
22+ name : "article" ,
23+ useForSnippets : false ,
24+ regexp : / a | a n / ,
25+ transformer : ( ) => null ,
26+ } ) ;
You can’t perform that action at this time.
0 commit comments