import { expect, test } from "@playwright/test";
const EDITOR_URL = `http://localhost:${process.env.EDITOR_PORT}`;
const GATEWAY_URL = `http://localhost:${process.env.GATEWAY_PORT}`;
test.describe("Editor UI Tests", () => {
    test.beforeEach(async ({ page }) => {
        await page.goto(EDITOR_URL);
    });
    test("Project view displays gateway and splash content", async ({ page }) => {
        const projectHeader = page.getByRole("link", { name: "Project" });
        await expect(projectHeader).toBeVisible();
        await projectHeader.click();
        await expect(page).toHaveURL(/\/dev\/project\/local$/);
        await expect(page.getByRole("heading", { name: "Welcome to your Gateway" })).toBeVisible();
        await expect(page.getByText("Gateway").first()).toBeVisible();
        await expect(page.getByRole("link", { name: GATEWAY_URL })).toBeVisible();
        await expect(page.getByText("Developer Portal")).toBeVisible();
        await expect(page.getByRole("button", { name: "Open Portal" })).toBeVisible();
        await expect(page.getByRole("link", { name: "Start Building" })).toBeVisible();
        await expect(page.getByRole("link", { name: "Quickstart" })).toBeVisible();
        await expect(page.getByRole("heading", { name: "Support" })).toBeVisible();
    });
    test("Code view displays routes and route designer", async ({ page }) => {
        const codeHeader = page.getByRole("link", { name: "Code" });
        await expect(codeHeader).toBeVisible();
        await codeHeader.click();
        await expect(page).toHaveURL(/\/dev\/project\/local\/edit/);
        await expect(page.getByRole("heading", { name: "Select a file to get started" })).toBeVisible();
        const routesFile = page.locator('[data-test="repros.oas.json"]');
        await expect(routesFile).toBeVisible();
        await routesFile.click();
        await expect(page).toHaveURL(/path=%2Fconfig%2Frepros\.oas\.json/);
        await expect(page.getByRole("tab", { name: "Route Designer" })).toBeVisible();
        await expect(page.getByRole("tab", { name: "repros.oas.json" })).toBeVisible();
        await expect(page.getByText("Create an Unsigned Transaction")).toBeVisible();
    });
});
//# sourceMappingURL=editor.spec.js.map