Verify API request completes successfully using cy.wait with alias
Preconditions (2)
Step 1: Open the test page at http://localhost:3000
Step 2: Intercept the GET request to /api/data and alias it as 'getData'
Step 3: Click the 'Load Data' button
Step 4: Wait for the 'getData' request to complete using cy.wait('@getData')
Step 5: Verify the response status code is 200
Step 6: Verify the page displays the loaded data text 'Data loaded successfully'
✅ Expected Result: The API request completes with status 200 and the page shows 'Data loaded successfully'