Test Overview
This test checks that the test name clearly describes what the test does. It verifies that the test name follows good naming conventions for easy understanding.
This test checks that the test name clearly describes what the test does. It verifies that the test name follows good naming conventions for easy understanding.
describe('Login Page Tests', () => { it('should display error message when login fails with invalid credentials', () => { cy.visit('/login'); cy.get('#username').type('wrongUser'); cy.get('#password').type('wrongPass'); cy.get('#login-button').click(); cy.get('.error-message').should('be.visible').and('contain', 'Invalid username or password'); }); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts with the name 'should display error message when login fails with invalid credentials' | Test framework ready to run the test | - | PASS |
| 2 | Browser opens and navigates to '/login' page | Login page is loaded in the browser | - | PASS |
| 3 | Finds username input field with id '#username' and types 'wrongUser' | Username field contains 'wrongUser' | - | PASS |
| 4 | Finds password input field with id '#password' and types 'wrongPass' | Password field contains 'wrongPass' | - | PASS |
| 5 | Finds login button with id '#login-button' and clicks it | Login form submitted | - | PASS |
| 6 | Finds element with class '.error-message' and checks it is visible and contains text 'Invalid username or password' | Error message displayed on the page | Error message is visible and text matches expected | PASS |