Newer
Older
bugtrail / packages / extension / verify-brand.mjs
@Eugene Sukhodolskiy Eugene Sukhodolskiy 1 day ago 1 KB Rename the service to BugTrail
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: 800 } });
const stamp = Date.now();
await page.request.post("http://localhost:8001/api/auth/register", {
  data: { nickname: `brand-${stamp}`, email: `brand-${stamp}@example.com`, password: "brand-check-1" },
});
await page.goto("http://localhost:5173/login");
await page.fill("input.input", `brand-${stamp}@example.com`);
await page.fill('input[type="password"]', "brand-check-1");
await page.click("button:has-text('Sign in'), button:has-text('Войти')");
await page.waitForSelector("text=BugTrail", { timeout: 15000 });
await page.screenshot({ path: "/tmp/ltt-shots/27-brand-panel.png", clip: { x: 0, y: 0, width: 1280, height: 260 } });
await browser.close();
console.log("done");