diff --git a/web-admin/tests/explores.spec.ts b/web-admin/tests/explores.spec.ts new file mode 100644 index 00000000000..74b5013cf37 --- /dev/null +++ b/web-admin/tests/explores.spec.ts @@ -0,0 +1,21 @@ +import { expect } from "@playwright/test"; +import { test } from "./setup/base"; + +test.describe("Explores", () => { + test("should have data", async ({ project, page }) => { + // Wait for reconciliation to complete + // (But, really, the dashboard link should be disabled until it's been reconciled) + await page.waitForTimeout(5000); + + // Navigate to the explore + await page + .getByRole("link", { name: "Programmatic Ads Auction" }) + .first() + .click(); + + // Check the Big Number + await expect( + page.getByRole("button", { name: "Requests 635M" }), + ).toBeVisible(); + }); +}); diff --git a/web-admin/tests/setup/base.ts b/web-admin/tests/setup/base.ts index b80b16b9067..dd686524fe4 100644 --- a/web-admin/tests/setup/base.ts +++ b/web-admin/tests/setup/base.ts @@ -1,11 +1,13 @@ import { test as base, type Page } from "@playwright/test"; import { cliLogin, cliLogout } from "./fixtures/cli"; import { orgCreate, orgDelete } from "./fixtures/org"; +import { projectDelete, projectDeploy } from "./fixtures/project"; type MyFixtures = { anonPage: Page; cli: void; organization: void; + project: void; }; export const test = base.extend({ @@ -29,4 +31,10 @@ export const test = base.extend({ await use(); await orgDelete(); }, + + project: async ({ organization, page }, use) => { + await projectDeploy(page); + await use(); + await projectDelete(); + }, }); diff --git a/web-admin/tests/setup/fixtures/project.ts b/web-admin/tests/setup/fixtures/project.ts new file mode 100644 index 00000000000..a5fe8ef66db --- /dev/null +++ b/web-admin/tests/setup/fixtures/project.ts @@ -0,0 +1,19 @@ +import type { Page } from "@playwright/test"; +import { exec } from "child_process"; +import { promisify } from "util"; + +const execAsync = promisify(exec); + +export async function projectDeploy(page: Page) { + await execAsync( + "rill deploy --path tests/setup/git/repos/rill-examples --subpath rill-openrtb-prog-ads --project openrtb --github true", + ); + await page.goto("/e2e/openrtb"); +} + +export async function projectDelete() { + await execAsync("rill project delete openrtb --force"); + await execAsync( + "rm -rf tests/setup/git/repos/rill-examples/rill-openrtb-prog-ads/.rillcloud", + ); +}