File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "story" : " /home/rgardler/projects/GEngine/web/stories/demo.ink" ,
4+ "pass" : true ,
5+ "steps" : 21 ,
6+ "path" : [
7+ 3 ,
8+ 0 ,
9+ 1 ,
10+ 1 ,
11+ 1
12+ ],
13+ "rotationOpportunity" : true ,
14+ "exhausted" : false
15+ },
16+ {
17+ "story" : " /home/rgardler/projects/GEngine/web/stories/test-story.ink" ,
18+ "pass" : false ,
19+ "steps" : 0 ,
20+ "path" : [],
21+ "error" : " Parse/compile error: Compilation failed." ,
22+ "rotationOpportunity" : false ,
23+ "exhausted" : false
24+ },
25+ {
26+ "story" : " /home/rgardler/projects/GEngine/web/stories/test.ink" ,
27+ "pass" : true ,
28+ "steps" : 4 ,
29+ "path" : [
30+ 1
31+ ],
32+ "rotationOpportunity" : true ,
33+ "exhausted" : false
34+ },
35+ {
36+ "story" : " /home/rgardler/projects/GEngine/web/stories/test_minimal.ink" ,
37+ "pass" : true ,
38+ "steps" : 3 ,
39+ "path" : [
40+ 0
41+ ],
42+ "rotationOpportunity" : true ,
43+ "exhausted" : false
44+ }
45+ ]
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "story" : " /home/rgardler/projects/GEngine/web/stories/test-story.ink" ,
4+ "pass" : false ,
5+ "steps" : 0 ,
6+ "path" : [],
7+ "error" : " Parse/compile error: Compilation failed." ,
8+ "rotationOpportunity" : false ,
9+ "exhausted" : false
10+ }
11+ ]
Original file line number Diff line number Diff line change 1+ import { test , expect } from '@playwright/test' ;
2+
3+ async function collectConsoleErrors ( page ) {
4+ const errors : string [ ] = [ ] ;
5+ page . on ( 'console' , msg => {
6+ if ( msg . type ( ) === 'error' ) errors . push ( msg . text ( ) ) ;
7+ } ) ;
8+ return errors ;
9+ }
10+
11+ test ( 'demo loads test-story.ink via ?story and presents UI' , async ( { page } ) => {
12+ const errors = await collectConsoleErrors ( page ) ;
13+
14+ // Load the demo and request the test story explicitly
15+ await page . goto ( '/demo/?story=/stories/test-story.ink' ) ;
16+
17+ const story = page . locator ( '#story' ) ;
18+ await expect ( story ) . toBeVisible ( ) ;
19+
20+ // Wait until the story area has text content
21+ await page . waitForFunction ( ( ) => {
22+ const el = document . querySelector ( '#story' ) ;
23+ return ! ! el && el . textContent && el . textContent . trim ( ) . length > 0 ;
24+ } , undefined , { timeout : 5000 } ) ;
25+
26+ const choices = page . locator ( '.choice-btn' ) ;
27+ await expect . poll ( async ( ) => choices . count ( ) , { timeout : 5000 } ) . toBeGreaterThan ( 0 ) ;
28+
29+ // No console errors
30+ expect ( errors , 'Console errors should be empty' ) . toEqual ( [ ] ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments