Test Overview
This test uses a JSON fixture file to load user data and verifies that the user name is displayed correctly on the page.
This test uses a JSON fixture file to load user data and verifies that the user name is displayed correctly on the page.
describe('User Profile Test with JSON Fixture', () => { beforeEach(() => { cy.visit('/user-profile') }) it('displays user name from fixture', () => { cy.fixture('user').then((user) => { cy.get('#user-name').should('contain.text', user.name) }) }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Test runner initialized, no browser opened yet | - | PASS |
| 2 | Browser opens and navigates to '/user-profile' | User profile page is loaded in the browser | - | PASS |
| 3 | Loads JSON fixture file 'user.json' | Fixture data with user details is available | - | PASS |
| 4 | Finds element with id 'user-name' | User name element is present on the page | - | PASS |
| 5 | Checks that element '#user-name' contains text from fixture user.name | User name text is visible on the page | Assert element text equals fixture user.name | PASS |