Newer
Older
bugtrail / packages / extension / verify-timeline-icon.mjs
import { chromium } from "playwright-core";
import { join } from "node:path";
import { homedir } from "node:os";
const exe = join(homedir(), ".cache/ms-playwright/chromium-1234/chrome-linux64/chrome");
const browser = await chromium.launch({ executablePath: exe, headless: true });
const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
await page.goto("http://localhost:5173/r/7plqZdUjtENDerdie2F1zw");
await page.waitForSelector(".timeline-marker", { timeout: 15000, state: "attached" });
await page.getByRole("button", { name: /шаги/i }).first().click({ timeout: 10000 }).catch(async () => {
  await page.locator("button:has-text('Шаги')").first().click({ force: true });
});
await page.waitForTimeout(800);
const first = page.locator("#steps-panel article").first();
await first.waitFor({ state: "visible", timeout: 10000 }).catch(() => {});
await first.scrollIntoViewIfNeeded().catch(() => {});
await page.waitForTimeout(300);
await page.screenshot({ path: "/tmp/ltt-shots/26-timeline-icons.png" });
await browser.close();
console.log("done");