test(游戏共创): 两个浏览器 e2e 的登录等待抗冷启动(Vite 首次编译)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m3s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m53s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m31s
Project CI / Frontend tests (pull_request) Successful in 2m58s
Project CI / Backend tests (pull_request) Successful in 7m44s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m6s
Project CI / Repository checks (pull_request) Successful in 6m45s
Project CI / Native shell tests (pull_request) Successful in 9m32s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m3s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m53s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m31s
Project CI / Frontend tests (pull_request) Successful in 2m58s
Project CI / Backend tests (pull_request) Successful in 7m44s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m6s
Project CI / Repository checks (pull_request) Successful in 6m45s
Project CI / Native shell tests (pull_request) Successful in 9m32s
- rebase 到 origin/master 后的第一次实跑里,lineage 与(同源的)fork 脚本在浏览器段都卡在
`page.waitForSelector('.platform-account-entry', { timeout: 120_000 })` 并超时:
Vite dev server 重启后首次导航要现编译整张模块图,rebase 引入大量新代码时首屏会超过 120s。
证据:两次运行都在该行超时退出;随后用 Playwright 直接探针(同一 URL)页面正常渲染、
`.platform-account-entry` count=1、无 pageerror(仅两条未登录态 401 的资源错误),
紧接着再跑同一脚本即 99/99 全绿。
- 修法:登录等待改成 240s + state:attached,并在超时后重载一次再等(避免把「开发服务器还没编译完」
误判成页面坏了)。两处改动逐字相同,lineage 与 fork 脚本各一处。
- 实测(HEAD 3ae0d129e,固定端口栈 3110/8188):lineage 99/99、fork 48/48、project-bundle 72/72;
三条只读门禁 policy-parity / dto-parity / spacetime-schema 均 exit 0。
This commit is contained in:
@@ -275,7 +275,22 @@ async function loadPlaywright() {
|
||||
|
||||
async function loginThroughWebUi(page, phone) {
|
||||
await page.goto(`${WEB}/games`, { waitUntil: 'commit', timeout: 120_000 });
|
||||
await page.waitForSelector('.platform-account-entry', { timeout: 120_000 });
|
||||
await page
|
||||
.waitForSelector('.platform-account-entry', {
|
||||
timeout: 240_000,
|
||||
state: 'attached',
|
||||
})
|
||||
.catch(async () => {
|
||||
// 首次导航可能触发 Vite 冷编译(重启/rebase 后的首屏实测可超过 2 分钟):
|
||||
// 重载一次再等,避免把「开发服务器还没编译完」误判成页面坏了。
|
||||
await page
|
||||
.reload({ waitUntil: 'commit', timeout: 120_000 })
|
||||
.catch(() => {});
|
||||
await page.waitForSelector('.platform-account-entry', {
|
||||
timeout: 240_000,
|
||||
state: 'attached',
|
||||
});
|
||||
});
|
||||
await page.locator('.platform-account-entry').first().click();
|
||||
await page.getByRole('tab', { name: '密码登录' }).first().click();
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
Reference in New Issue
Block a user