Cypress 13

Set the viewport size

Easy30 pts~12 min
  • TargetQA Practice Store
Practice app · TargetQA Practice Store

A small storefront landing page for browser setup, navigation, titles, URLs and screenshots.

Test URL
/lab/cypress-set-the-viewport-size

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Set the viewport size. Practise it against the TargetQA Practice Store practice application (A small storefront landing page for browser setup, navigation, titles, URLs and screenshots.).

Your task

  1. 1Open the practice application at the test URL shown above and wait for it to finish loading.
  2. 2Inspect the page to find the elements you need — key elements include #page-title, #nav-home, #nav-products.
  3. 3Write and run a test that demonstrates: set the viewport size.
  4. 4Finish with at least one assertion on a user-visible outcome, not an internal detail.

Acceptance criteria

  • The test runs to completion without errors.
  • The test contains at least one passing assertion on a user-visible outcome.

Cypress 13 · Cypress · Setup & first test