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
2 changes: 1 addition & 1 deletion .github/ci-budgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"API spec": 3,
"native types": 3,
"app (real browser)": 8,
"app (real browser, WebKit)": 12,
"app (real browser, WebKit) (shard N of N)": 15,
"app (real browser, desktop setup window)": 12,
"tests (shard N of N)": 7,
"tests": 2,
Expand Down
53 changes: 49 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,19 @@ jobs:
# app. So on that runner the list runs two files at a time, each test gets 15 seconds by default
# instead of 5, and the job has an hour. A test's own timeout and every bound a test asserts stay
# as they are. On the larger runners nothing changes: eight workers, 5 seconds, 30 minutes.
#
# In shards, one runner each, as the suite is: one job took 16 to 17 minutes before the browser tests
# no job had ever named were added, and every file is still named here once. `bun test --shard`
# deals the sorted list out in turn. A run is as long as its slowest shard, and a shard as long as
# its slowest file: artifacts-screens, about 11 minutes.
app-browser-webkit:
name: app (real browser, WebKit)
name: app (real browser, WebKit) (shard ${{ matrix.shard }} of ${{ strategy.job-total }})
needs: changes
strategy:
# Every shard runs to the end, so one red run names every failing test, as the suite's do.
fail-fast: false
matrix:
shard: [1, 2, 3]
# On a pull request, only when the app, what it imports or its tests change (scripts/ci-changes.ts,
# app_browser_webkit). A merge group and main run it every time.
if: needs.changes.outputs.app_browser_webkit == 'true'
Expand All @@ -617,6 +627,7 @@ jobs:
PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e
TEST_WORKERS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '2' || '8' }}
TEST_TIMEOUT_MS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '15000' || '5000' }}
TEST_SHARD: ${{ matrix.shard }}/${{ strategy.job-total }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -629,22 +640,41 @@ jobs:
- run: |
# One file per line, sorted: pull requests that each add a file then merge cleanly.
files=(
app/tests/access-requests-layout.test.tsx
app/tests/add-custom-mcp-card-layout.test.tsx
app/tests/admin-notion-one-press-layout.test.tsx
app/tests/admin-path-layout.test.tsx
app/tests/admin-request-notify-layout.test.tsx
app/tests/another-account-layout.test.tsx
app/tests/app-frame-skeleton-still.test.tsx
app/tests/approval-answered-layout.test.tsx
app/tests/approval-left-carry-on-browser.test.tsx
app/tests/artifact-bridge-browser.test.ts
app/tests/artifact-collab-browser.test.tsx
app/tests/artifact-error-notice-layout.test.tsx
app/tests/artifact-events-socket.test.ts
app/tests/artifact-kinds-browser.test.tsx
app/tests/artifact-sharing-screens-layout.test.tsx
app/tests/artifact-sign-in-refusal-browser.test.tsx
app/tests/artifact-tool-cards-browser.test.tsx
app/tests/artifacts-kit.test.ts
app/tests/artifacts-screens.test.tsx
app/tests/board-row-layout.test.tsx
app/tests/bot-file-links-browser.test.tsx
app/tests/bot-long-instructions-layout.test.tsx
app/tests/bot-screen-sharp.test.tsx
app/tests/bots-panel-start-conversation.test.tsx
app/tests/browse-apps-pages.test.tsx
app/tests/browse-steps-layout.test.tsx
app/tests/chunk-recovery.test.tsx
app/tests/command-card-layout.test.tsx
app/tests/composer-dictation-language.test.tsx
app/tests/composer-keeps-draft-browser.test.tsx
app/tests/composer-touch-return.test.tsx
app/tests/computer-panel-phone-layout.test.tsx
app/tests/computer-starting-browser.test.tsx
app/tests/connected-bot-mistakes-layout.test.tsx
app/tests/conversation-access-ended.test.tsx
app/tests/conversation-kept-browser.test.tsx
app/tests/conversation-reopen-end.test.tsx
app/tests/conversation-reply-toolbar-layout.test.tsx
Expand All @@ -662,7 +692,9 @@ jobs:
app/tests/move-to-cloud-settings.test.tsx
app/tests/moved-apps-reconnect.test.tsx
app/tests/moved-elsewhere.test.tsx
app/tests/name-the-admins-layout.test.tsx
app/tests/new-conversation-picked-model.test.tsx
app/tests/offline-conversation-layout.test.tsx
app/tests/one-press-connect-layout.test.tsx
app/tests/organization-held-actions.test.tsx
app/tests/organization-held-recovery.test.tsx
Expand All @@ -674,16 +706,23 @@ jobs:
app/tests/organization-unavailable-chat.test.tsx
app/tests/organization-unavailable-pages.test.tsx
app/tests/people-lists.test.tsx
app/tests/plan-notices-layout.test.tsx
app/tests/question-answer-prompt-browser.test.tsx
app/tests/queue-send-now-layout.test.tsx
app/tests/rejoin-fresh-token-browser.test.tsx
app/tests/renderer-crash.test.ts
app/tests/renewal-keeps-typing-browser.test.tsx
app/tests/roster-working.test.tsx
app/tests/routine-run-now-layout.test.tsx
app/tests/run-ended-unheard-layout.test.tsx
app/tests/section-strip-routines.test.tsx
app/tests/select-scrolls-layout.test.tsx
app/tests/service-terms.test.tsx
app/tests/settings-tool-cards-admin-layout.test.tsx
app/tests/settings-tool-cards-core.test.tsx
app/tests/settings-tool-cards-personal.test.tsx
app/tests/sidebar-current-row.test.tsx
app/tests/sidebar-window-buttons.test.tsx
app/tests/sidebar-zoom-drag.test.tsx
app/tests/sign-in-reconnect-layout.test.tsx
app/tests/sign-in-returns-there.test.tsx
Expand All @@ -692,21 +731,27 @@ jobs:
app/tests/step-rows-layout.test.tsx
app/tests/stopped-command-layout.test.tsx
app/tests/stopped-turn-dismiss-browser.test.tsx
app/tests/strip-version-layout.test.tsx
app/tests/table-export-browser.test.tsx
app/tests/team-connections-directory-layout.test.tsx
app/tests/too-many-follow-ups.test.tsx
app/tests/trusted-types-build.test.ts
app/tests/trusted-types.test.ts
app/tests/web-push-browser.test.tsx
app/tests/what-if-handle-browser.test.tsx
app/tests/work-folded-layout.test.tsx
app/tests/workspace-snapshots-layout.test.tsx
)
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
"$PLAYWRIGHT_IMAGE" \
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" "${files[@]}"
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" --shard="$TEST_SHARD" "${files[@]}"
# Connect your AI's sign-in code, copied with one press and read back from WebKit's clipboard.
# Only that test: the rest of the file runs in Chromium in the job above.
- run: |
# Only that test: the rest of the file runs in Chromium in the job above. Once, on the first shard.
- if: matrix.shard == 1
run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
Expand Down
5 changes: 3 additions & 2 deletions app/tests/admin-path-layout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ async function open(
reducedMotion: "reduce",
});
page.on("pageerror", (error) => console.error(error));
const inter = join(packageDir("@fontsource-variable/inter"), "files");
// The app's own face (app/src/styles.css): the page is measured in the type it ships with.
const figtree = join(packageDir("@fontsource-variable/figtree"), "files");
await page.route(`${ORIGIN}/**`, (route) => {
const at = new URL(route.request().url()).pathname;
if (at === "/admin-path.js")
return route.fulfill({ contentType: "text/javascript", body: script });
const font = join(inter, at.split("/").pop() ?? "");
const font = join(figtree, at.split("/").pop() ?? "");
if (at.startsWith("/files/") && existsSync(font))
return route.fulfill({ path: font });
// The fixture answers the API itself; anything that reaches the network has nowhere to go.
Expand Down
18 changes: 10 additions & 8 deletions app/tests/artifacts-screens.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -972,14 +972,16 @@ describe.skipIf(!asked)("the Artifacts page and full screen", () => {
() => new URL(location.href).searchParams.get("artifact") === null,
);
expect(await scroller()).toBe(scrolled);
expect(
await page.evaluate(
() =>
document.activeElement
?.closest("[data-slot=artifact-tile]")
?.textContent?.includes("Launch countdown") ?? false,
),
).toBe(true);
// Focus moves once the list is drawn again, a moment after the address changes: read the
// moment the address changed, it was still on Back.
await page.waitForFunction(
() =>
document.activeElement
?.closest("[data-slot=artifact-tile]")
?.textContent?.includes("Launch countdown") ?? false,
undefined,
{ timeout: 5_000 },
);
expect(await unanswered(page)).toEqual([]);
} finally {
await page.close();
Expand Down
19 changes: 15 additions & 4 deletions app/tests/browse-steps-layout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ async function open(
.getByRole("region", { name: "Conversation" })
.waitFor({ timeout: 15_000 });
await page.getByText("You're signed in.").waitFor({ timeout: 15_000 });
await style(page);
return page;
}

/**
* The app's stylesheet for every class now on the page, and its fonts loaded. Again once a line is
* opened: a folded line draws its rows only then (`useDrawnOnceOpened`, tool-line.tsx, #2782).
*/
async function style(page: Page) {
const classes = await page.evaluate(() =>
[...document.querySelectorAll("[class]")].flatMap((element) => [
...element.classList,
Expand All @@ -153,7 +162,6 @@ async function open(
content: await stylesheet([...new Set(classes)]),
});
await page.evaluate(() => document.fonts.ready);
return page;
}

const WINDOWS: Window[] = [
Expand All @@ -170,13 +178,16 @@ describe.skipIf(!asked)("a Bot's browse steps, opened", () => {
test(`name each field and button, never what was typed, in ${engine}, ${theme}, ${window.width}px`, async () => {
const page = await open(engine, theme, window);
try {
// The turn is over (the Bot said "You're signed in."), so its work is one line,
// "Worked through 6 steps", as a finished turn's completed tool work is in any
// conversation (`foldTurnWork`, chat-transcript.tsx), and a Bot's browser steps are rows
// of that line, not a line of their own. Opened, it lists them.
await page
.locator("summary", {
hasText: "Browsed the-internet.herokuapp.com",
})
.locator("summary", { hasText: "Worked through 6 steps" })
.click();
const rows = page.locator("details[open] ol > li");
await rows.first().waitFor({ timeout: 5_000 });
await style(page);
if (shots) {
mkdirSync(shots, { recursive: true });
await page.screenshot({
Expand Down
Loading
Loading