Reveal the Stardust pack in the shop, keep the campaign expiry row inside its card and stabilise the Aniimo e2e tests
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 22m9s
Validate and deploy Sokko G / deploy (push) Successful in 12s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-19 13:35:22 +01:00
parent 99724cb6ba
commit 2c10df0370
7 changed files with 65 additions and 27 deletions

View file

@ -3,6 +3,13 @@ import { test, expect } from "@playwright/test";
const route = "/#/games/aniimo/aniimos";
const cards = (page) => page.locator(".aniimo-result");
// Sous la charge d'une suite complète, le premier affichage (module différé et catalogue servis par Vite) dépasse
// souvent les 5 s des assertions : chaque visite attend la première carte avec une marge, puis les tests gardent leurs attentes courantes.
async function openAniimos(page) {
await page.goto(route);
await expect(cards(page).first()).toBeVisible({ timeout: 30000 });
}
test.describe.configure({ timeout: 60000 });
const filterTrigger = (page, name) => page.getByRole("button", { name: new RegExp(`^${name}`) });
const filterMenu = (page, name) => page.getByRole("dialog", { name: new RegExp(`^${name}`) });
async function openFilter(page, name) {
@ -14,7 +21,7 @@ async function openFilter(page, name) {
test("role and element menus use two columns and highlight their condition", async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 900 });
await page.goto(route);
await openAniimos(page);
const roles = await openFilter(page, "Rôles");
await expect(roles).toHaveAttribute("data-columns", "2");
expect(await roles.locator(".nds-filter-menu-options").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.split(" ").length)).toBe(2);
@ -32,11 +39,10 @@ test("role and element menus use two columns and highlight their condition", asy
for (const width of [1280, 390]) {
test(`Prismana filter combines with search and survives grouping and navigation at ${width}px`, async ({ page }) => {
test.setTimeout(45000);
await page.setViewportSize({ width, height: 900 });
await page.goto(route);
await openAniimos(page);
const prismana = page.getByRole("button", { name: "Prismana uniquement", exact: true });
await expect(prismana).toBeVisible({ timeout: 30000 });
await expect(prismana).toBeVisible();
await expect(prismana).toHaveAttribute("aria-pressed", "false");
await prismana.focus();
await prismana.press("Space");
@ -70,7 +76,6 @@ for (const width of [1280, 390]) {
}
test("Aniimo matches MHW card motion, surfaces and filter controls", async ({ page }) => {
test.setTimeout(45000);
async function styles(locator, properties) {
return locator.evaluate((element, keys) => {
const css = globalThis.getComputedStyle(element);
@ -95,7 +100,7 @@ test("Aniimo matches MHW card motion, surfaces and filter controls", async ({ pa
const face = await styles(page.locator(".mhwilds-card-front").first(), faceProperties);
const indicator = await styles(page.locator(".mhwilds-flip-indicator").first(), indicatorProperties);
const filter = await styles(page.locator(".filter-logic"), filterProperties);
await page.goto(route);
await openAniimos(page);
await openFilter(page, "Éléments");
const card = cards(page).first();
await expect(card).toBeVisible();
@ -151,7 +156,7 @@ test("Aniimo exposes its regions list", async ({ page }) => {
});
test("tabs, flip, matching variants and reset remain independent", async ({ page }) => {
await page.goto(route);
await openAniimos(page);
await page.getByRole("searchbox").fill("emberpup");
const card = cards(page).first();
await expect(card.getByRole("tab")).toHaveCount(3);
@ -182,7 +187,7 @@ test("tabs, flip, matching variants and reset remain independent", async ({ page
});
test("ability levels use independent native ranges and retain name constraints", async ({ page }) => {
await page.goto(route);
await openAniimos(page);
const abilities = await openFilter(page, "Compétences de logis");
const carry = page.locator("#aniimo-minimum-carry");
const crafting = page.locator("#aniimo-minimum-crafting");
@ -244,7 +249,7 @@ test("ability levels use independent native ranges and retain name constraints",
});
test("seven tabs support keyboard navigation and fall back after filtering", async ({ page }) => {
await page.goto(route);
await openAniimos(page);
await page.getByRole("searchbox").fill("iris");
const card = cards(page).filter({ has: page.getByRole("heading", { name: "Iris", exact: true }) });
await expect(card.getByRole("tab")).toHaveCount(7);
@ -283,7 +288,7 @@ for (const width of [1280, 390]) {
test(`uniform cards, visible variant tabs and scrollable backs at ${width}px`, async ({ page }) => {
await page.setViewportSize({ width, height: 844 });
await page.emulateMedia({ reducedMotion: "reduce" });
await page.goto(route);
await openAniimos(page);
await expect(cards(page)).toHaveCount(120);
const sizes = await page.locator(".aniimo-card").evaluateAll((elements) => elements.map((element) => {
const { width, height } = element.getBoundingClientRect();
@ -350,7 +355,7 @@ for (const width of [1280, 390]) {
test("portrait geometry, stable faces and mobile layout", async ({ page }) => {
await page.emulateMedia({ reducedMotion: "reduce" });
await page.setViewportSize({ width: 390, height: 844 });
await page.goto(route);
await openAniimos(page);
await page.getByRole("searchbox").fill("emberpup");
const card = cards(page).first();
await card.scrollIntoViewIfNeeded();
@ -384,7 +389,7 @@ test("portrait geometry, stable faces and mobile layout", async ({ page }) => {
test("desktop grid uses the width freed by horizontal filters and shows complete stats", async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(route);
await openAniimos(page);
await expect(cards(page)).toHaveCount(120);
const columns = await page.locator(".aniimo-grid").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.split(" ").length);
expect(columns).toBe(6);
@ -397,7 +402,7 @@ test("desktop grid uses the width freed by horizontal filters and shows complete
});
test("advanced filter menus retain selections, counts and keyboard closing", async ({ page }) => {
await page.goto(route);
await openAniimos(page);
const roles = await openFilter(page, "Rôles");
await expect(roles.getByRole("checkbox", { name: "SOIN", exact: true })).toHaveCount(1);
await expect(roles.getByRole("checkbox", { name: "SOUTIEN", exact: true })).toHaveCount(1);
@ -443,7 +448,7 @@ test("pending and failed data requests show loading and error states", async ({
for (const width of [768, 1440]) {
test(`regional filters preserve identities, keyboard access and combinations at ${width}px`, async ({ page }) => {
await page.setViewportSize({ width, height: 900 });
await page.goto(route);
await openAniimos(page);
await expect(cards(page)).toHaveCount(120);
const catalogueRegions = await cards(page).evaluateAll((items) => items.map((item) => item.dataset.region));
expect(catalogueRegions.slice(0, -9)).not.toContain("special");
@ -500,7 +505,7 @@ test("incomplete Aniimo cards show unknown roles and missing portraits without f
catalogue.find((aniimo) => aniimo.name === "hoptail").variations[0].image = null;
await route.fulfill({ response, json: catalogue });
});
await page.goto(route);
await openAniimos(page);
await page.getByRole("searchbox").fill("jabster");
await expect(cards(page)).toHaveCount(1);
await cards(page).getByRole("button", { name: /Afficher les capacités/ }).click();

View file

@ -1416,6 +1416,10 @@ test("administrator navigates sections, manages mythic content and previews visu
await expect(dragonCampaign).toContainText("0 / 1 utilisés");
await expect(dragonCampaign).toContainText("Personne n’a encore utilisé ce code.");
await noOverflow();
// À 768 px, la prolongation (date, heure, case, bouton) passe à la ligne au lieu de sortir de la carte.
await page.setViewportSize({ width: 768, height: 1000 });
await expect(dragonCampaign.getByRole("button", { name: "Changer l’expiration" })).toBeVisible();
expect(await dragonCampaign.evaluate((element) => element.scrollWidth - element.clientWidth)).toBeLessThanOrEqual(0);
// Le filtre sépare les campagnes en cours des campagnes terminées (révoquées, expirées ou épuisées).
const campaignFilter = page.getByRole("group", { name: "Afficher les campagnes" });
@ -1558,13 +1562,14 @@ test("players give cards and answer trade proposals from two accounts", async ({
await expect(partner.getByRole("dialog").locator('[data-selected]')).toHaveCount(1);
await partner.getByRole("dialog").getByRole("button", { name: "Fermer", exact: true }).click();
// Le paquet de la boutique s'achète en poussière, s'ouvre aussitôt et n'est jamais proposé dans Paquets.
// Le paquet de la boutique s'achète en poussière, s'ouvre aussitôt dans la boutique et n'est jamais proposé dans Paquets.
await partner.goto("/#/cards/packs");
await expect(partner.locator(".nebula-pack")).toHaveCount(2);
await partner.goto("/#/cards/shop");
const packItem = partner.locator('.nebula-shop-item[data-item="pack"]');
await packItem.getByRole("button", { name: "Acheter et ouvrir" }).click();
await expect(partner).toHaveURL(/#\/cards\/packs$/);
await expect(partner.getByRole("heading", { name: "Révélez vos trois cartes" })).toBeVisible();
await expect(partner).toHaveURL(/#\/cards\/shop$/);
await expect(partner.getByRole("heading", { name: "Révélez vos trois cartes" })).toBeVisible();
await expect(partner.locator(".nebula-card-back img").first()).toHaveAttribute("src", "/static/img/cards/stardust/back.webp");
await expect(partner.locator(".nebula-opening-odds")).toContainText("50 % des légendaires et mythiques tirées viennent de Poussières d'étoiles");
@ -1573,7 +1578,9 @@ test("players give cards and answer trade proposals from two accounts", async ({
// Ce paquet se paie en poussière : il ne propose pas de continuer sur une ouverture.
await expect(partner.getByRole("button", { name: "Ouvrir un autre paquet de la même collection", exact: true })).toHaveCount(0);
await partner.getByRole("button", { name: "Retour", exact: true }).click({ timeout: 30_000 });
await partner.goto("/#/cards/shop");
// « Retour » ramène aux articles de la boutique, sans passer par Paquets.
await expect(partner).toHaveURL(/#\/cards\/shop$/);
await expect(packItem).toBeVisible();
await expect(partner.locator(".nebula-shop-wallet")).toContainText("440");
// Plusieurs ouvertures d'un coup : le maximum suit la poussière (440 au prix affiché), la saisie y est ramenée.
const openingItem = partner.locator('.nebula-shop-item[data-item="opening"]');