@@ -12,6 +12,12 @@ async function goToLesson(page, chapterName, lessonName) {
1212 await expect ( page . getByRole ( 'heading' , { level : 2 , name : lessonName } ) ) . toBeVisible ( ) ;
1313}
1414
15+ /** Open the gear menu then click the solve/reset button inside it. */
16+ async function clickSolve ( page ) {
17+ await page . getByTestId ( 'options-button' ) . click ( ) ;
18+ await page . getByTestId ( 'solve-button' ) . click ( ) ;
19+ }
20+
1521async function expectInterpretMode ( logs ) {
1622 await expect ( logs ) . toContainText ( '--mode interpret' ) ;
1723 await expect ( logs ) . not . toContainText ( '--compiled' ) ;
@@ -34,14 +40,24 @@ test('solve/reset toggles between solution and starter', async ({ page }) => {
3440 await page . goto ( '/' ) ;
3541 await page . getByRole ( 'button' , { name : 'next' } ) . click ( ) ;
3642
43+ // Open menu and verify initial state
44+ await page . getByTestId ( 'options-button' ) . click ( ) ;
3745 const solveBtn = page . getByTestId ( 'solve-button' ) ;
38- await expect ( solveBtn ) . toHaveText ( 'solve ' ) ;
46+ await expect ( solveBtn ) . toHaveText ( 'Show solution ' ) ;
3947
48+ // Apply solution
4049 await solveBtn . click ( ) ;
41- await expect ( solveBtn ) . toHaveText ( 'reset' ) ;
4250
51+ // Reopen menu and verify reset state
52+ await page . getByTestId ( 'options-button' ) . click ( ) ;
53+ await expect ( solveBtn ) . toHaveText ( 'Reset to starter' ) ;
54+
55+ // Reset
4356 await solveBtn . click ( ) ;
44- await expect ( solveBtn ) . toHaveText ( 'solve' ) ;
57+
58+ // Reopen menu and verify back to solve
59+ await page . getByTestId ( 'options-button' ) . click ( ) ;
60+ await expect ( solveBtn ) . toHaveText ( 'Show solution' ) ;
4561} ) ;
4662
4763// ── SystemVerilog Basics ──────────────────────────────────────────────────────
@@ -60,7 +76,7 @@ test('Welcome: run outputs Hello World', async ({ page }) => {
6076test ( 'Up-Counter: solution simulates and produces a waveform' , async ( { page } ) => {
6177 await goToLesson ( page , 'Sequential Logic' , 'Up-Counter' ) ;
6278
63- await page . getByTestId ( 'solve-button' ) . click ( ) ;
79+ await clickSolve ( page ) ;
6480 await page . getByTestId ( 'run-button' ) . click ( ) ;
6581
6682 const logs = page . getByTestId ( 'runtime-logs' ) ;
@@ -87,7 +103,7 @@ test('Modules and Ports: waveform renders after solve and run', async ({ page })
87103 await page . getByRole ( 'button' , { name : 'next' } ) . click ( ) ;
88104 await expect ( page . getByTestId ( 'lesson-title' ) ) . toHaveText ( 'Modules and Ports' ) ;
89105
90- await page . getByTestId ( 'solve-button' ) . click ( ) ;
106+ await clickSolve ( page ) ;
91107 await page . getByTestId ( 'run-button' ) . click ( ) ;
92108
93109 const logs = page . getByTestId ( 'runtime-logs' ) ;
@@ -105,9 +121,9 @@ test('Modules and Ports: waveform renders after solve and run', async ({ page })
105121// ── SystemVerilog Assertions ──────────────────────────────────────────────────
106122
107123test ( 'immediate-assert: solution passes assertions' , async ( { page } ) => {
108- await goToLesson ( page , 'Your First Assertion' , 'Immediate Assertions' ) ;
124+ await goToLesson ( page , 'Your First Formal Assertion' , 'Immediate Assertions' ) ;
109125
110- await page . getByTestId ( 'solve-button' ) . click ( ) ;
126+ await clickSolve ( page ) ;
111127 await page . getByTestId ( 'verify-button' ) . click ( ) ;
112128
113129 const logs = page . getByTestId ( 'runtime-logs' ) ;
@@ -116,9 +132,9 @@ test('immediate-assert: solution passes assertions', async ({ page }) => {
116132} ) ;
117133
118134test ( 'sequence-basics: solution runs without errors' , async ( { page } ) => {
119- await goToLesson ( page , 'Your First Assertion' , 'Sequences and Properties' ) ;
135+ await goToLesson ( page , 'Your First Formal Assertion' , 'Sequences and Properties' ) ;
120136
121- await page . getByTestId ( 'solve-button' ) . click ( ) ;
137+ await clickSolve ( page ) ;
122138 await page . getByTestId ( 'verify-button' ) . click ( ) ;
123139
124140 const logs = page . getByTestId ( 'runtime-logs' ) ;
0 commit comments