import { expect, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord profile setup advances to property details", async ({ page }) => { await applyDeterministicPage(page); await useE2EUser(page, "landlord-onboarding"); await page.goto("/landlord/onboarding/profile"); await page.getByLabel(/full name/i).fill("Jordan Landlord"); await page.getByLabel(/email address/i).fill("jordan.landlord@example.com"); await page.getByLabel(/phone number/i).fill("555-0222"); await page.getByLabel(/^street address/i).fill("901 Aurora Ave"); await page.getByLabel(/apartment, suite/i).fill("Suite 5"); await page.getByLabel(/^city/i).fill("Seattle"); await page.getByLabel(/^state/i).fill("WA"); await page.getByLabel(/zip/i).fill("98104"); await page.getByLabel(/^country/i).selectOption("US"); await page.getByRole("button", { name: /continue|next|save/i }).click(); await expect(page).toHaveURL(/\/landlord\/onboarding\/property-setup/); await expect( page.getByRole("heading", { name: /add your first rental property/i }), ).toBeVisible(); }); test("property setup submits and lands on landlord dashboard", async ({ page }) => { await applyDeterministicPage(page); await useE2EUser(page, "landlord-onboarding"); await page.goto("/landlord/onboarding/property-setup"); await page.getByLabel(/^street address/i).fill("701 Pine St"); await page.getByLabel(/city/i).fill("Seattle"); await page.getByLabel(/^state/i).fill("WA"); await page.getByLabel(/zip/i).fill("98101"); await page.getByLabel(/country/i).selectOption("US"); await page.getByLabel(/property type/i).selectOption("apartment"); await page.getByLabel(/bedrooms/i).selectOption("2"); await page.getByLabel(/bathrooms/i).selectOption("2"); await page.getByLabel(/monthly rent/i).fill("2600"); await page.getByLabel(/security deposit/i).fill("2600"); await page.getByRole("button", { name: /complete onboarding|finish|submit/i }) .click(); await expect(page).toHaveURL(/\/landlord\/dashboard/); await expect(page.getByRole("heading", { name: /landlord dashboard/i })) .toBeVisible(); });