Playwright

Read a code from the host profile in a new tab

Medium55 pts
  • Multiple tabs
  • Window switching
  • Reading text
Practice app · StayNest

A home-sharing marketplace: destination autocomplete, a two-month date-range calendar, a guests popover with steppers, results with a list/map toggle and a filters modal, listing pages with a photo gallery, a reserve card with a price breakdown, host profiles in a new tab, a wishlist that needs sign-in and a message-host form.

Test URL
/lab/playwright-staynest-host-verification-tab

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

Objective

The host profile opens in a new browser tab. Read the host verification code there, return to the listing and use the code to verify the host.

Your Task

  1. 1Open TEST_URL and open Casa Azulejo · Alfama Townhouse from Featured stays.
  2. 2Click “View host profile” (#host-profile-link); it opens in a new tab.
  3. 3Switch to the new tab, wait for #host-profile-name (“Marta S.”) and read the code in #host-verification-code.
  4. 4Close the tab and switch back to the listing tab.
  5. 5Type the code into #verify-host-input, click Verify (#verify-host-button) and assert #host-verify-status contains “Host verified”.

Validation Checks

  • The verification field holds Marta's code.
  • The listing shows “Host verified” and the verified badge.
  • The browser ends on the Casa Azulejo listing in the original tab.
  • The test makes at least two assertions.

Fixtures

Email
guest@staynest.test
Password
Nest@2026
Account name
Jordan Lee
Today
Tuesday, 10 November 2026 (earlier days are disabled)
Destinations
Goa · Lisbon · Kyoto · Banff · Cape Town
Service fee
14% of the nightly subtotal
Guest limits
Adults 1–16 (adults + children ≤ 16) · infants up to 5 · pets up to 5
Host verification code
Shown only on the host profile tab

Cloud Execution & Grading Guide

This Medium Playwright Challenges exercise runs inside TargetQA's managed cloud sandbox using Playwright (TypeScript, JavaScript, Python, Java, C#). Every submission runs inside an isolated headless Chromium container with pre-synced drivers, capturing live console logs, DOM assertions, and a 720p step-by-step video replay.

  • Supported stacks: TypeScript (@playwright/test) · JavaScript (@playwright/test) · Python (Playwright + pytest) · Java (Playwright for Java + JUnit 5) · C# (Playwright for .NET + NUnit)
  • Zero local setup: Use the pre-declared TEST_URL variable so your script targets the live StayNest sandbox reliably without hardcoding hosts.
  • Automated grading: Click Run to inspect step logs and behavior, then click Submit to validate all 4 acceptance checks and earn 55 points.

Playwright · Playwright Challenges Practice Track · StayNest