Test Overview
This test types text into a username input field and verifies that the input contains the typed text.
This test types text into a username input field and verifies that the input contains the typed text.
describe('Username input test', () => { it('types text into the username field and checks the value', () => { cy.visit('https://example.com/login') cy.get('#username').type('testuser') cy.get('#username').should('have.value', 'testuser') }) })
| 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/login' | Login page is loaded with username input field visible | - | PASS |
| 3 | Finds the username input field using selector '#username' | Username input field is focused and ready for typing | - | PASS |
| 4 | Types 'testuser' into the username input field | Username input field contains text 'testuser' | - | PASS |
| 5 | Checks that the username input field's value is 'testuser' | Username input field value is 'testuser' | Assert that input value equals 'testuser' | PASS |