* fix(ci): skip unrelated required checks cleanly Matrix jobs had to start no-op runners to preserve interpolated required-check names. Static named jobs let GitHub report genuine skipped conclusions while keeping those names stable. * fix(ci): gate changes to install patching script * fix(ci): route cross-package test contracts narrowly * fix(ci): keep routed contracts merge-blocking * fix(server): exclude nested test utilities from builds * fix(ci): cover app-owned native and browser domains * refactor(ci): align tests with runtime domains Own browser specs, desktop specs, and Electron-only app code by stable directories so PR routing does not depend on filename conventions. Keep desktop integration coverage inside the required desktop check. * fix(ci): keep routing and desktop suites isolated The routing regression must run before dependency installation, and desktop Vitest must not collect Playwright-owned specs. * fix(ci): isolate desktop e2e runtime * perf(test): isolate Playwright workers * perf(test): parallelize Playwright within specs * fix(test): keep Playwright file scheduling * fix(test): share dynamic Metro fixture * fix(test): preserve own-host restart fixtures * fix(ci): preserve routed contracts after rebase * Stabilize Playwright wheel-scroll assertions
101 lines
3.7 KiB
TypeScript
101 lines
3.7 KiB
TypeScript
import { mkdir, mkdtemp, rm, stat } from "node:fs/promises";
|
|
import { tmpdir } from "node:os";
|
|
import path from "node:path";
|
|
import { expect, test } from "../support/fixtures";
|
|
import {
|
|
addProjectFlow,
|
|
addProjectFlowBack,
|
|
addProjectFlowInput,
|
|
chooseAddProjectMethod,
|
|
expectAddProjectPage,
|
|
expectNewWorkspaceForAddedProject,
|
|
openAddProjectFlow,
|
|
} from "../support/helpers/add-project-flow";
|
|
import { gotoAppShell } from "../support/helpers/app";
|
|
import {
|
|
createTempGithubRepo,
|
|
hasGithubAuth,
|
|
type GhRepoFixture,
|
|
} from "../support/helpers/github-fixtures";
|
|
import { expectOpenedProject } from "../support/helpers/project-picker-ui";
|
|
import { connectSeedClient } from "../support/helpers/seed-client";
|
|
import { getServerId } from "../support/helpers/server-id";
|
|
|
|
test.describe("Add Project GitHub flow", () => {
|
|
test.describe.configure({ timeout: 300_000 });
|
|
|
|
test("searches the host's repositories and clones into a clearly shown final path", async ({
|
|
page,
|
|
}) => {
|
|
test.skip(!hasGithubAuth(), "Requires GitHub authentication (gh auth login)");
|
|
|
|
let repository: GhRepoFixture | null = null;
|
|
const parentDirectory = await mkdtemp(path.join(tmpdir(), "paseo-e2e-github-clone-"));
|
|
let projectId: string | null = null;
|
|
|
|
try {
|
|
repository = await createTempGithubRepo({ category: "add-project" });
|
|
const checkoutPath = path.join(parentDirectory, repository.name);
|
|
|
|
await gotoAppShell(page);
|
|
await openAddProjectFlow(page);
|
|
await chooseAddProjectMethod(page, "github");
|
|
|
|
await addProjectFlowInput(page).fill("getpaseo/paseo");
|
|
await expect(addProjectFlow(page).getByText("getpaseo/paseo", { exact: true })).toBeVisible({
|
|
timeout: 30_000,
|
|
});
|
|
await addProjectFlowInput(page).fill("");
|
|
|
|
const repositoryRow = addProjectFlow(page).getByText(repository.fullName, { exact: true });
|
|
await expect(repositoryRow).toBeVisible({ timeout: 30_000 });
|
|
await repositoryRow.click();
|
|
await expectAddProjectPage(page, "github-location");
|
|
|
|
await addProjectFlowInput(page).fill(parentDirectory);
|
|
await expect(addProjectFlow(page)).toContainText(checkoutPath, { timeout: 30_000 });
|
|
|
|
await addProjectFlowBack(page).click();
|
|
await expectAddProjectPage(page, "github-search");
|
|
await expect(repositoryRow).toBeVisible();
|
|
await repositoryRow.click();
|
|
await expectAddProjectPage(page, "github-location");
|
|
await expect(addProjectFlowInput(page)).toHaveValue(parentDirectory);
|
|
|
|
await mkdir(checkoutPath);
|
|
await page.keyboard.press("Enter");
|
|
await expect(page.getByTestId("add-project-flow-error")).toHaveText(
|
|
`Checkout path already exists: ${checkoutPath}`,
|
|
);
|
|
|
|
await rm(checkoutPath, { recursive: true });
|
|
await page.keyboard.press("Enter");
|
|
projectId = await expectOpenedProject(page, repository.name);
|
|
await expectNewWorkspaceForAddedProject(page, {
|
|
serverId: getServerId(),
|
|
projectId,
|
|
projectName: repository.name,
|
|
projectPath: checkoutPath,
|
|
});
|
|
const client = await connectSeedClient();
|
|
try {
|
|
expect((await client.fetchWorkspaces({ filter: { projectId } })).entries).toEqual([]);
|
|
} finally {
|
|
await client.close();
|
|
}
|
|
await expect.poll(async () => (await stat(checkoutPath)).isDirectory()).toBe(true);
|
|
} finally {
|
|
if (projectId) {
|
|
const client = await connectSeedClient();
|
|
try {
|
|
await client.removeProject(projectId).catch(() => undefined);
|
|
} finally {
|
|
await client.close();
|
|
}
|
|
}
|
|
await repository?.cleanup();
|
|
await rm(parentDirectory, { recursive: true, force: true });
|
|
}
|
|
});
|
|
});
|