Test Overview
This test sets the browser viewport to a specific screen size and verifies that a responsive element is visible and correctly displayed at that size.
This test sets the browser viewport to a specific screen size and verifies that a responsive element is visible and correctly displayed at that size.
describe('Viewport size test', () => { it('sets viewport to 375x667 and checks mobile menu visibility', () => { cy.viewport(375, 667); cy.visit('https://example.cypress.io'); cy.get('.mobile-menu').should('be.visible'); }); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Set viewport size to 375x667 | Browser window resized to width 375px and height 667px | - | PASS |
| 2 | Visit the URL https://example.cypress.io | Page loads with mobile layout due to small viewport | - | PASS |
| 3 | Find element with class '.mobile-menu' | Mobile menu element is present in DOM | Check if '.mobile-menu' is visible on screen | PASS |