@@ -4,20 +4,21 @@ import assert from 'assert'
44Given ( 'the register page is open' , async function ( ) {
55 const page = this . page
66 if ( ! page ) throw new Error ( 'Page not initialized' )
7- await page . goto ( 'http://localhost' )
7+ await page . goto ( 'http://localhost/register ' )
88} )
99
1010When ( 'I enter {string} as the username and submit' , async function ( username ) {
1111 const page = this . page
1212 if ( ! page ) throw new Error ( 'Page not initialized' )
13- await page . fill ( '#username' , username )
14- await page . click ( '.submit-button' )
13+ await page . fill ( 'input[autocomplete="username"]' , username )
14+ await page . fill ( 'input[autocomplete="new-password"]' , 'password123' )
15+ await page . click ( 'button[type="submit"]' )
1516} )
1617
1718Then ( 'I should see a welcome message containing {string}' , async function ( expected ) {
1819 const page = this . page
1920 if ( ! page ) throw new Error ( 'Page not initialized' )
20- await page . waitForSelector ( '.success -message' , { timeout : 5000 } )
21- const text = await page . textContent ( '.success -message' )
22- assert . ok ( text && text . includes ( expected ) , `Expected success message to include "${ expected } ", got: "${ text } "` )
21+ await page . waitForSelector ( '.MuiAlert -message' , { timeout : 5000 } )
22+ const text = await page . textContent ( '.MuiAlert -message' )
23+ assert . ok ( text && text . includes ( expected ) , `Expected "${ expected } ", got: "${ text } "` )
2324} )
0 commit comments