Complete the code to set the viewport width to 768 pixels.
cy.viewport([1], 800);
Setting the viewport width to 768 pixels simulates a tablet screen size for responsive testing.
Complete the code to check if the navigation menu is visible after resizing the viewport.
cy.get('nav').should([1], true);
exist which only checks presence in the DOM, not visibility.contain which checks text content.The assertion be.visible checks if the navigation menu is visible on the page.
Fix the error in the code to correctly set the viewport to a mobile size.
cy.viewport([1], 667);
The viewport width must be a number, so 375 is correct. Strings with units or keywords cause errors.
Fill both blanks to test if the footer is hidden on small screens.
cy.viewport([1], [2]); cy.get('footer').should('not.be.visible');
Setting viewport to 320x480 simulates a small mobile screen where the footer is expected to be hidden.
Fill all three blanks to create a test that resizes viewport and checks header visibility and width.
cy.viewport([1], [2]); cy.get('header').should('be.visible'); cy.get('header').invoke('css', 'width').should('equal', '[3]px');
The viewport is set to 768x1024 (tablet portrait). The header should be visible and have width 768 pixels.