/**
 * MotherShip 登录页基线（Step 12.61）
 * 来源：2026-07-15 headed/browser 实探 https://dashboard.mothership.com/login
 * 注意：登录后查价表单须用 `npm run record:mothership -- --logged-in` 人工续录补全
 */
const { chromium } = require("playwright");

(async () => {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto("https://dashboard.mothership.com/login");

  // 登录表单（accessibility 名）
  await page.getByRole("textbox", { name: "Email address" }).click();
  await page.getByRole("textbox", { name: "Email address" }).fill("REPLACE_EMAIL");
  await page.getByRole("textbox", { name: "Password" }).fill("REPLACE_PASSWORD");
  await page.getByRole("button", { name: "Sign in" }).click();

  // --- 续录点：登录成功后进入查价表单 → LA/Dallas 样例 → 出报价 ---
  // await page.pause();

  await context.storageState({
    path: ".rpa/mothership-logged-in-storage.json",
  });
  await browser.close();
})();
