Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions e2e/app-smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { expect, type Page, test } from "@playwright/test";
import { expect, test } from "@playwright/test";

async function closeBlockingDialog(page: Page) {
const dialog = page.getByRole("dialog").first();
await dialog.waitFor({ state: "visible", timeout: 5_000 }).catch(() => undefined);
if (!(await dialog.isVisible().catch(() => false))) {
return;
}
import { APP_VERSION } from "../lib/version";

const closeButton = dialog.getByRole("button", { name: /^(Do not show again|Close|Done)$/ }).first();
if (await closeButton.isVisible().catch(() => false)) {
await closeButton.click();
} else {
await page.keyboard.press("Escape");
}
test.beforeEach(async ({ request }) => {
// Establish a returning operator before navigation so startup dialogs cannot race assertions.
const response = await request.patch("/api/v1/me/product-state", {
data: {
gettingStartedDismissedAt: new Date().toISOString(),
lastSeenReleaseVersion: APP_VERSION,
},
});

await expect(dialog).toBeHidden();
}
await expect(response).toBeOK();
expect(await response.json()).toMatchObject({
gettingStartedDismissedAt: expect.any(String),
lastSeenReleaseVersion: APP_VERSION,
});
});

test("loads the authenticated dashboard with the development actor", async ({ page }) => {
await page.goto("/dashboard");
Expand Down Expand Up @@ -46,7 +47,7 @@ test("renders the new scan form without queueing a real scan", async ({ page })
await page.goto("/scans/new");

await expect(page.getByRole("heading", { name: "New Scan" })).toBeVisible();
await expect(page.getByText("Scan Configuration", { exact: true })).toBeVisible();
await expect(page.getByRole("main").getByText("Scan Configuration", { exact: true })).toBeVisible();
await expect(page.getByRole("textbox", { name: "Target" })).toHaveValue("https://primary.example.test");
await expect(page.getByRole("button", { name: "Queue Scan" })).toBeVisible();
});
Expand All @@ -56,7 +57,6 @@ test("queues a scan from the new scan form", async ({ page }) => {

await page.goto(`/scans/new?target=${encodeURIComponent(target)}`);
await expect(page.getByRole("textbox", { name: "Target" })).toHaveValue(target);
await closeBlockingDialog(page);

const createScanResponse = page.waitForResponse((response) => (
response.url().endsWith("/api/v1/scans")
Expand Down
2 changes: 1 addition & 1 deletion worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FROM golang:1.26-bookworm AS nuclei-builder
ARG NUCLEI_VERSION=v3.11.1
ARG SUBFINDER_VERSION=v2.16.0
ARG NUCLEI_TEMPLATES_REPO=https://github.com/projectdiscovery/nuclei-templates.git
ARG NUCLEI_TEMPLATES_REF=4f708d5ca2f3bd295d9d6a7fa41274e71d92a8c5
ARG NUCLEI_TEMPLATES_REF=9c896aebeb5fd19fa7ce3f1b01603b775e54f803

RUN go install "github.com/projectdiscovery/nuclei/v3/cmd/nuclei@${NUCLEI_VERSION}"
RUN go install "github.com/projectdiscovery/subfinder/v2/cmd/subfinder@${SUBFINDER_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion worker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FROM golang:1.26-bookworm AS nuclei-builder
ARG NUCLEI_VERSION=v3.11.1
ARG SUBFINDER_VERSION=v2.16.0
ARG NUCLEI_TEMPLATES_REPO=https://github.com/projectdiscovery/nuclei-templates.git
ARG NUCLEI_TEMPLATES_REF=4f708d5ca2f3bd295d9d6a7fa41274e71d92a8c5
ARG NUCLEI_TEMPLATES_REF=9c896aebeb5fd19fa7ce3f1b01603b775e54f803

RUN go install "github.com/projectdiscovery/nuclei/v3/cmd/nuclei@${NUCLEI_VERSION}"
RUN go install "github.com/projectdiscovery/subfinder/v2/cmd/subfinder@${SUBFINDER_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion worker/scanner-pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"repo": "projectdiscovery/nuclei-templates",
"gitUrl": "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/projectdiscovery/nuclei-templates.git",
"sourceRef": "main",
"ref": "4f708d5ca2f3bd295d9d6a7fa41274e71d92a8c5"
"ref": "9c896aebeb5fd19fa7ce3f1b01603b775e54f803"
}
}
Loading