gui tests: nav-sub-unroll and plugin-check-github-limit find Installed by name, after P0's Built-in tab
3ccbe6bc1(P0) added Plugins › Built-in, so Plugins now has three sidebar rows. That broke two tests, red ona75de4c21in both engines: - nav-sub-unroll expected two rows (22/22 red). - plugin-check-github-limit took the second tab as Installed in German, and so clicked Discover. Both now find Installed by its name ("Installiert" in German). The nav-sub check that the selection doesn't reach into the row above holds for whatever row that is. Run: nav-sub-unroll 22/22, plugin-check-github-limit 18/18 (Chromium and WebKit).
This commit is contained in:
@@ -76,11 +76,14 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const r = (e) => { const b = e.getBoundingClientRect(); return { top: b.top, bottom: b.bottom, text: e.textContent }; };
|
||||
return [[...document.querySelectorAll(".nav-sub:not(.leaving) .nav-s")].map(r), r(document.querySelector(".nav-sub:not(.leaving) .nav-hl"))];
|
||||
});
|
||||
assert.equal(rows.length, 2);
|
||||
assert.ok(rows[1].top >= rows[0].bottom, `the rows don't overlap: ${JSON.stringify(rows)}`);
|
||||
assert.ok(Math.abs(hl.top - rows[1].top) < 1 && Math.abs(hl.bottom - rows[1].bottom) < 1,
|
||||
`the selection is on Installed (${rows[1].top}–${rows[1].bottom}), not ${hl.top}–${hl.bottom}`);
|
||||
assert.ok(hl.top >= rows[0].bottom, "and nothing of it over Discover");
|
||||
// Built-in (P0 of the plugin runtime), Discover, Installed
|
||||
assert.equal(rows.length, 3);
|
||||
for (let i = 1; i < rows.length; i++) assert.ok(rows[i].top >= rows[i - 1].bottom, `the rows don't overlap: ${JSON.stringify(rows)}`);
|
||||
const at = rows.findIndex((r) => r.text.startsWith(installedWord[lang]));
|
||||
assert.ok(at > 0, `Installed is a row after another: ${JSON.stringify(rows)}`);
|
||||
assert.ok(Math.abs(hl.top - rows[at].top) < 1 && Math.abs(hl.bottom - rows[at].bottom) < 1,
|
||||
`the selection is on Installed (${rows[at].top}–${rows[at].bottom}), not ${hl.top}–${hl.bottom}`);
|
||||
assert.ok(hl.top >= rows[at - 1].bottom, "and nothing of it over the row above");
|
||||
assert.deepEqual(errors, []);
|
||||
await context.close();
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ const L = {
|
||||
token: /你的 GitHub 令牌的请求额度暂时用完了$/, every: "所有插件都是最新的" },
|
||||
ja: { installed: "インストール済み", check: null, head: "確認できたプラグインに更新はありません · 1 個を確認できませんでした:", none: /^github:me\/opencode-x-auth の最新コミットを確認できませんでした:GitHub はトークンなしでは/,
|
||||
token: /GitHub トークンのレート制限は現在使い切られています$/, every: "すべてのプラグインが最新です" },
|
||||
de: { installed: null, check: null, head: "Keine Updates für die geprüften Erweiterungen · 1 konnten nicht geprüft werden: ", none: /^github:me\/opencode-x-auth konnte nicht nach dem neuesten Commit gefragt werden: GitHub erlaubt ohne Token 60 Anfragen/,
|
||||
de: { installed: "Installiert", check: null, head: "Keine Updates für die geprüften Erweiterungen · 1 konnten nicht geprüft werden: ", none: /^github:me\/opencode-x-auth konnte nicht nach dem neuesten Commit gefragt werden: GitHub erlaubt ohne Token 60 Anfragen/,
|
||||
token: /Das Rate-Limit von GitHub für Ihren GitHub-Token ist vorerst aufgebraucht$/, every: "Alle Erweiterungen sind aktuell" },
|
||||
};
|
||||
|
||||
@@ -75,9 +75,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.route("**/*", server(lang, limited));
|
||||
await page.goto("http://magpie.test/?view=plugins");
|
||||
const view = page.locator("#view-plugins");
|
||||
// the Installed tab, by its place where its name isn't given here
|
||||
// the Installed tab, by its name: Built-in (P0) came before it
|
||||
const tabs = page.locator(":is(.lib-tabs .opt, .nav-s):visible");
|
||||
await (w.installed ? tabs.filter({ hasText: w.installed }) : tabs.nth(1)).first().click();
|
||||
await tabs.filter({ hasText: w.installed }).first().click();
|
||||
const row = view.locator(".pm-row").filter({ has: page.locator(".name span", { hasText: /^opencode-x-auth$/ }) });
|
||||
await row.waitFor();
|
||||
await view.locator(".pm-foot .pm-check").evaluate((b) => b.click());
|
||||
|
||||
Reference in New Issue
Block a user