Test Overview
This test verifies that Cypress correctly loads and applies settings from the cypress.config.js file, such as baseUrl and viewport size.
This test verifies that Cypress correctly loads and applies settings from the cypress.config.js file, such as baseUrl and viewport size.
describe('Cypress Config Settings Test', () => { it('should use baseUrl and viewport from cypress.config.js', () => { cy.visit('/') cy.url().should('eq', `${Cypress.config('baseUrl')}/`) cy.window().then((win) => { expect(win.innerWidth).to.equal(Cypress.config('viewportWidth')) expect(win.innerHeight).to.equal(Cypress.config('viewportHeight')) }) }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Cypress test runner is initialized with cypress.config.js settings loaded | - | PASS |
| 2 | Cypress opens browser and applies viewport size from config | Browser window is set to viewportWidth and viewportHeight from cypress.config.js | - | PASS |
| 3 | Test navigates to baseUrl '/' using cy.visit('/') | Browser navigates to the URL defined by baseUrl in cypress.config.js | Verify current URL equals baseUrl + '/' | PASS |
| 4 | Test retrieves viewport size using cy.window() and compares with config | Viewport size is available from Cypress API | Viewport width and height match viewportWidth and viewportHeight from config | PASS |
| 5 | Test ends successfully | All assertions passed, test completes | - | PASS |