Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : SP Mail8 * File : tests/e2e/admin/z-ops-phone.spec.ts9 * Module : tests10 * Repository : https://git.spboucher.ai/sp-mail11 * Project Website : https://mail.spboucher.ai12 * Created : 2026-11-2013 * Last Modified : 2026-11-2014 *15 * Author : Simon-Pierre Boucher16 * Position : Professor of Finance17 * Institution : Université du Québec en Outaouais (UQO)18 * Organization : SP Boucher19 * Website : https://spboucher.ai20 * Git : https://git.spboucher.ai21 *22 * Preferred Contact: support@spboucher.ai23 * Development : dev@spboucher.ai24 * Support : support@spboucher.ai25 * Security/Admin : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License : None specified (no license file in this repository)34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243// Téléphone (390 × 844) : écrans d'exploitation — cartes de santé empilées, tableaux en fiches, courbes retracées à la largeur,44// aucun défilement horizontal, axe dans les trois thèmes.45import { expect, noOverflow, openAdmin, test } from "./fixtures"46import { axeThemes, shot } from "./ops-helpers"4748test("téléphone : vue d'ensemble, alertes, appareils, sécurité, tendances", async ({ page }) => {49 test.setTimeout(180_000)50 await openAdmin(page, "overview")51 await expect(page.getByTestId("ops-checks")).toBeVisible({ timeout: 30_000 })52 await expect(page.getByTestId("check-backups")).toBeVisible()53 // une colonne : chaque carte prend toute la largeur54 const widths = await page.getByTestId("ops-checks").locator("article").evaluateAll((els) => els.map((e) => Math.round(e.getBoundingClientRect().width)))55 expect(new Set(widths).size).toBe(1)56 expect(widths[0]).toBeGreaterThan(300)57 await noOverflow(page)58 await axeThemes(page, "phone-ops-dashboard")59 await shot(page, "phone-dashboard")6061 await openAdmin(page, "alerts")62 await expect(page.getByTestId("alert-types")).toBeVisible()63 await page.getByRole("group", { name: "Alertes affichées" }).getByRole("button", { name: "Toutes" }).click()64 await expect(page.getByTestId("alerts-list").or(page.getByTestId("alerts-empty"))).toBeVisible()65 await noOverflow(page)66 await axeThemes(page, "phone-ops-alerts")67 await shot(page, "phone-alerts")6869 await openAdmin(page, "devices")70 const sessions = page.getByTestId("devices-sessions")71 await expect(sessions).toBeVisible()72 // tableau en fiches : l'en-tête est masqué, chaque cellule porte son intitulé73 await expect(sessions.locator("thead")).not.toBeInViewport()74 expect(await sessions.locator("tbody tr").first().locator("td[data-label]").count()).toBeGreaterThanOrEqual(4)75 await noOverflow(page)76 await axeThemes(page, "phone-ops-devices")77 await shot(page, "phone-devices")7879 await openAdmin(page, "security")80 await expect(page.getByTestId("security-table")).toBeVisible()81 await noOverflow(page)82 await axeThemes(page, "phone-ops-security")83 await shot(page, "phone-security")8485 await openAdmin(page, "storage")86 const chart = page.getByTestId("trend-storage-chart")87 await expect(chart).toBeVisible()88 expect(await chart.locator('svg[role="img"]').evaluate((el) => el.getBoundingClientRect().width)).toBeLessThanOrEqual(390)89 await noOverflow(page)90 await shot(page, "phone-storage-trend")9192 await openAdmin(page, "metrics")93 await expect(page.getByTestId("trend-deliveries")).toBeVisible()94 await expect(page.getByTestId("problem-deliveries")).toBeVisible()95 await noOverflow(page)96 await axeThemes(page, "phone-ops-delivery")97 await shot(page, "phone-delivery-trend")9899 await openAdmin(page, "mailboxes")100 await expect(page.getByTestId("mb-status").first()).toBeVisible()101 await noOverflow(page)102 await shot(page, "phone-mailboxes")103})104