Test Overview
This test checks that a button becomes visible within a custom timeout period and verifies it can be clicked successfully.
This test checks that a button becomes visible within a custom timeout period and verifies it can be clicked successfully.
describe('Timeout configuration test', () => { it('waits for the button to appear with custom timeout and clicks it', () => { cy.visit('https://example.com/delayed-button') cy.get('#delayed-btn', { timeout: 10000 }).should('be.visible') cy.get('#delayed-btn').click() cy.get('#result').should('contain.text', 'Button clicked') }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Test runner initialized, no browser opened yet | - | PASS |
| 2 | Browser opens and navigates to 'https://example.com/delayed-button' | Browser shows the page with delayed button loading | - | PASS |
| 3 | Find element with selector '#delayed-btn' with timeout 10000ms | Waiting up to 10 seconds for button to appear | Check if '#delayed-btn' is visible | PASS |
| 4 | Click on '#delayed-btn' | Button is visible and clickable | - | PASS |
| 5 | Verify '#result' contains text 'Button clicked' | Result element updated after click | Check if '#result' text includes 'Button clicked' | PASS |