ci speed: desktop boot check runs its cases in parallel (one browser, killed at the end; a page per case; condition waits instead of fixed sleeps: element, text or a quiet window of host calls and DOM); shots capture / render close the browser with a 3 s cap, then kill it; console engine waits injectable for tests (WAITS / engineWaits: poll rounds, a missing step ends once its loaded page stays quiet, team switch settle, field-miss grace), fillPage looks up each data type's dialog once per round and skips dialog sections when no dialog is open; browser tests run 4 at a time per file (testScope().concurrent with a scope per test, --max-concurrency in ci), 20 ms rounds; capture-web counts boots per test and runs its browser tests concurrently; console-session / -persist Chrome tests concurrent; recorded test timings smoothed (mergeTimings) so one loaded run does not skew the shard split
This commit is contained in:
parent
f2d7062bcb
commit
9ba8471002
16 changed files with 390 additions and 178 deletions
|
|
@ -25,7 +25,7 @@ import { dirname, join } from 'node:path';
|
|||
import type { ShipConfig } from '../lib/config';
|
||||
import type { FormId } from '../lib/console-answers';
|
||||
import { hasToken, type Name, NAV_BASES, type NavBases, type NavStep, navPlan, playAppIdOf, playDeveloperId, switchAllowed } from '../lib/console-forms';
|
||||
import { ACTION_MS, accName, findAny, type Locator, navClick, navigate, type NavResult, type Page, poll, realRole, safeClick, signInPage, SignInSeen, type Stop, vis } from './fill';
|
||||
import { ACTION_MS, accName, findAny, type Locator, navClick, navigate, WAITS, type NavResult, type Page, poll, realRole, safeClick, signInPage, SignInSeen, type Stop, vis } from './fill';
|
||||
|
||||
// ---- the cache ----
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ export async function readChooser(page: Page): Promise<PlayAccount[]> {
|
|||
*/
|
||||
export async function playAccounts(page: Page, playBase: string, ms: number, stop?: Stop): Promise<PlayAccount[]> {
|
||||
await page.goto(`${playBase.replace(/\/$/, '')}/u/0/developers`, { waitUntil: 'domcontentloaded' }).catch(() => { /* read what is there */ });
|
||||
const found = await poll(ms, async () => { const r = await readChooser(page); return r.length ? r : null; }, stop);
|
||||
const found = await poll(ms, async () => { const r = await readChooser(page); return r.length ? r : null; }, stop, page);
|
||||
if (found) return found;
|
||||
const here = playDeveloperId(page.url());
|
||||
return here ? [{ id: here, name: '' }] : [];
|
||||
|
|
@ -185,7 +185,7 @@ async function accountId(page: Page, a: PlayAccount, listed: string[], ms: numbe
|
|||
const role = await realRole(row).catch(() => '');
|
||||
if (!switchAllowed(a.name, ['link', 'menuitem', 'menuitemradio', 'option', 'radio', 'row', 'button'].includes(role) ? role : 'row', listed)) return null;
|
||||
await row.click({ timeout: ACTION_MS });
|
||||
return poll(ms, async () => playDeveloperId(page.url()), stop);
|
||||
return poll(ms, async () => playDeveloperId(page.url()), stop, page);
|
||||
}
|
||||
|
||||
// ---- App Store Connect: teams ----
|
||||
|
|
@ -197,7 +197,7 @@ const CANCEL: Name[] = ['Cancel', 'İptal', 'Vazgeç'];
|
|||
interface TeamItem { name: string; loc: Locator; role: string; current: boolean }
|
||||
|
||||
async function teamMenu(page: Page, ms: number, stop?: Stop): Promise<TeamItem[] | null> {
|
||||
const t = await poll(ms, async () => { const f = await findAny(page, ['button'], ACCOUNT_MENU); return f.state === 'ok' ? f.loc : null; }, stop);
|
||||
const t = await poll(ms, async () => { const f = await findAny(page, ['button'], ACCOUNT_MENU); return f.state === 'ok' ? f.loc : null; }, stop, page);
|
||||
if (!t || !(await navClick(t)).clicked) return null;
|
||||
return poll(Math.min(ms, 3000), async () => {
|
||||
const menus = vis(page.getByRole('menu'));
|
||||
|
|
@ -213,7 +213,7 @@ async function teamMenu(page: Page, ms: number, stop?: Stop): Promise<TeamItem[]
|
|||
}
|
||||
}
|
||||
return out.length ? out : null;
|
||||
}, stop);
|
||||
}, stop, page);
|
||||
}
|
||||
|
||||
const closeMenu = async (page: Page) => { await page.keyboard.press('Escape').catch(() => { /* gone */ }); };
|
||||
|
|
@ -235,7 +235,7 @@ export async function switchTeam(page: Page, name: string, listed: string[], ms:
|
|||
if (!switchAllowed(real, role, listed)) { await closeMenu(page); return false; }
|
||||
await it.loc.click({ timeout: ACTION_MS });
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: ms }).catch(() => { /* same page, or slow: read what is there */ });
|
||||
await Bun.sleep(300);
|
||||
await Bun.sleep(WAITS.settleMs); // the switched team's page settles
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue