Let players compare card stats in the collection, rebalance card profiles with a full refunded reset of upgrades, and fix best boosts that sometimes fired in the previous zone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4a44306e30
commit
3590df5e1e
31 changed files with 1515 additions and 211 deletions
|
|
@ -75,6 +75,14 @@ test("a phone opening the game lands in the mobile mode, without the site shell,
|
|||
const fullLinks = await page.locator("main a[href^='#/cards']").evaluateAll((links) => links.map((link) => link.textContent.trim()));
|
||||
expect(fullLinks, section).toEqual(["Version complète"]);
|
||||
}
|
||||
// L'affichage Stats de la collection tient aussi dans l'écran : son tableau devient une fiche par carte.
|
||||
await page.goto("/#/mobile/cards/collection");
|
||||
await page.getByRole("tab", { name: "Stats", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Orientation", exact: true }).click();
|
||||
await expect(page.getByRole("region", { name: "Stats des cartes" })).toBeVisible();
|
||||
expect(await page.evaluate(() => globalThis.document.documentElement.scrollWidth)).toBeLessThanOrEqual(WIDTH);
|
||||
await expectNothingClipped(page);
|
||||
await expectButtonsOnOneLine(page);
|
||||
// Les quêtes de la Guilde allument l'onglet Guilde.
|
||||
await page.goto("/#/mobile/cards/daily");
|
||||
await expect(tabs.getByRole("link", { name: /^Guilde/ })).toHaveAttribute("aria-current", "page");
|
||||
|
|
|
|||
|
|
@ -1699,6 +1699,51 @@ test("administration stays within a phone screen", async ({ page }) => {
|
|||
expect(clipped).toEqual([]);
|
||||
});
|
||||
|
||||
test("a player compares card profiles in the collection stats and ranks a two-stat build by its weakest stat", async ({ browser }) => {
|
||||
// Compte partenaire de la base de test : Loup des Aurores (45/15/10/30) et Dragon du Néant Étoilé (45/30/15/10), deux légendaires.
|
||||
const { token } = JSON.parse(await readFile(join(tmpdir(), "sokkog-cards-e2e-partner.json"), "utf8"));
|
||||
const context = await browser.newContext({ baseURL: "http://127.0.0.1:4180" });
|
||||
await context.addCookies([{ name: "__Host-sokkog_cards_session", value: token, domain: "127.0.0.1", path: "/", secure: true, httpOnly: true, sameSite: "Lax" }]);
|
||||
const page = await context.newPage();
|
||||
await page.goto("/#/cards/collection");
|
||||
await page.getByRole("tab", { name: "Stats", exact: true }).click();
|
||||
const stats = page.getByRole("region", { name: "Stats des cartes" });
|
||||
const names = () => stats.locator("tbody .nebula-collection-stats-name strong").allTextContents();
|
||||
// Première place de chaque carte : le Dragon peut aussi être là en édition mythique, au même profil.
|
||||
const order = async () => [...new Set((await names()).filter((name) => ["Loup des Aurores", "Dragon du Néant Étoilé"].includes(name)))];
|
||||
// Ni commune ni destination : seulement les cartes qui partent en équipe, en Profil par défaut.
|
||||
await expect(stats.getByRole("tab", { name: "Profil", exact: true })).toHaveAttribute("aria-selected", "true");
|
||||
expect(await names()).not.toContain("Le Cœur du Nuage Cosmique");
|
||||
const wolf = stats.locator("tbody tr").filter({ hasText: "Loup des Aurores" });
|
||||
await expect(wolf.locator(".nebula-shape-badge .sr-only")).toHaveText("Spécialiste : Bravoure");
|
||||
await expect(wolf.locator('td[data-stat="orientation"] strong')).toHaveText("30\u202f%");
|
||||
// Le Dragon a plus d'Endurance, mais pour Endurance + Orientation sa faible Orientation (10) le fait passer derrière le Loup.
|
||||
await stats.getByRole("button", { name: "Endurance", exact: true }).click();
|
||||
expect(await order()).toEqual(["Dragon du Néant Étoilé", "Loup des Aurores"]);
|
||||
await stats.getByRole("button", { name: "Orientation", exact: true }).click();
|
||||
await expect(stats.getByRole("button", { name: "Orientation", exact: true })).toHaveAttribute("aria-pressed", "true");
|
||||
await expect(stats.locator('thead th[data-stat="orientation"]')).toHaveAttribute("data-target", "true");
|
||||
expect(await order()).toEqual(["Loup des Aurores", "Dragon du Néant Étoilé"]);
|
||||
expect(await page.locator("html").evaluate((element) => element.scrollWidth > element.clientWidth)).toBe(false);
|
||||
// Le filtre Profil remplace Possession ; aucun Duo ici.
|
||||
const filters = page.locator(".nebula-album-filters");
|
||||
await expect(filters.getByRole("button", { name: "Possession", exact: true })).toHaveCount(0);
|
||||
await filters.getByRole("button", { name: "Profil", exact: true }).click();
|
||||
await filters.getByRole("checkbox", { name: "Duo" }).check();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(stats.getByText("Aucune carte ne correspond à ces filtres.")).toBeVisible();
|
||||
await filters.getByRole("button", { name: "Retirer le filtre Profil : Duo" }).click();
|
||||
// Une ligne ouvre la fiche de la carte sur son amélioration.
|
||||
await stats.getByRole("button", { name: "Ouvrir la fiche de Loup des Aurores", exact: true }).click();
|
||||
const dialog = page.getByRole("dialog", { name: "Loup des Aurores", exact: true });
|
||||
await expect(dialog.getByRole("tab", { name: "Amélioration", exact: true })).toHaveAttribute("aria-selected", "true");
|
||||
await dialog.getByRole("button", { name: "Fermer", exact: true }).click();
|
||||
// Retour à l'album : Possession revient.
|
||||
await page.getByRole("tab", { name: "Album", exact: true }).click();
|
||||
await expect(filters.getByRole("button", { name: "Possession", exact: true })).toBeVisible();
|
||||
await context.close();
|
||||
});
|
||||
|
||||
test("players give cards and answer trade proposals from two accounts", async ({ browser, page }) => {
|
||||
test.setTimeout(90_000);
|
||||
const nav = (scope) => scope.getByRole("navigation", { name: "Sections de Sokko TCG" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue