SPB Git

Repository Public

ecosystem.spec.ts 6.1 KB 129 lines typescript

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : agentilab-web8 * File             : tests/e2e/ecosystem.spec.ts9 * Module           : Tests10 * Repository       : https://git.spboucher.ai/agentilab-web11 * Project Website  : Not specified12 * Created          : 2026-12-0513 * Last Modified    : 2026-12-0514 *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: contact@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          : Proprietary34 *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 */4243import { expect, test } from '@playwright/test';4445const visibleCards = '.products > li:not([hidden])';4647test.describe('filtres du portefeuille', () => {48  test('filtrent, se combinent, s’inscrivent dans l’URL et se réinitialisent', async ({ page }) => {49    await page.goto('/ecosysteme');50    await expect(page.locator(visibleCards)).toHaveCount(20);51    const filters = page.getByRole('form', { name: 'Filtrer les produits' });5253    await filters.getByRole('button', { name: 'ORIX', exact: true }).click();54    await expect(page.locator(visibleCards)).toHaveCount(14);55    await expect(page).toHaveURL(/brand=orix/);56    await expect(filters.getByRole('status')).toHaveText('14 produits affichés');5758    await filters.getByRole('button', { name: 'macOS' }).click();59    await filters.getByRole('button', { name: 'Bêta' }).click();60    await expect(page).toHaveURL(/brand=orix&platform=macos&status=beta/);61    await expect(page.locator(visibleCards)).toHaveCount(2);6263    await filters.getByRole('button', { name: 'Réinitialiser les filtres' }).click();64    await expect(page.locator(visibleCards)).toHaveCount(20);65    await expect(page).toHaveURL('/ecosysteme');66  });6768  test('une URL partagée restaure la sélection', async ({ page }) => {69    await page.goto('/en/ecosystem?brand=groupe-ka');70    await expect(page.locator(visibleCards)).toHaveCount(6);71    await expect(page.getByRole('button', { name: 'Groupe Ka', exact: true })).toHaveAttribute('aria-pressed', 'true');72    await expect(page.getByRole('status')).toHaveText('6 products shown');73  });7475  test('état vide explicite, réinitialisable', async ({ page }) => {76    await page.goto('/ecosysteme?brand=orix&platform=web');77    await expect(page.locator(visibleCards)).toHaveCount(0);78    await expect(page.getByRole('heading', { name: 'Aucun produit ne correspond à ces filtres' })).toBeVisible();79    await page.locator('.empty').getByRole('button', { name: 'Réinitialiser les filtres' }).click();80    await expect(page.locator(visibleCards)).toHaveCount(20);81  });8283  test('une valeur inconnue dans l’URL est ignorée', async ({ page }) => {84    await page.goto('/ecosysteme?brand=inconnue&status=<script>');85    await expect(page.locator(visibleCards)).toHaveCount(20);86  });8788  test('utilisables au clavier', async ({ page, browserName }) => {89    test.skip(browserName === 'webkit', 'Safari ne tabule pas vers les boutons sans réglage système');90    await page.goto('/ecosysteme');91    await page.getByRole('button', { name: 'Groupe Ka', exact: true }).focus();92    await page.keyboard.press('Space');93    await expect(page.locator(visibleCards)).toHaveCount(6);94    await page.keyboard.press('Tab');95    await page.keyboard.press('Enter');96    await expect(page.locator(visibleCards)).toHaveCount(14);97  });98});99100test('pages de marque : six plateformes Ka, quatorze applications ORIX, statuts exacts', async ({ page }) => {101  await page.goto('/ecosysteme/groupe-ka');102  await expect(page.locator('.products > li')).toHaveCount(6);103  await expect(page.locator('#lou-ka').getByRole('link', { name: /Site officiel/ })).toHaveAttribute('href', 'https://www.lou-ka.com/');104  await page.goto('/ecosysteme/orix');105  await expect(page.locator('.products > li')).toHaveCount(14);106  // Un lien App Store n’apparaît que pour les deux applications vérifiées.107  await expect(page.getByRole('link', { name: /App Store/ })).toHaveCount(2);108  await expect(page.locator('#orix-navigator .badge--beta')).toHaveText('Bêta');109  await expect(page.locator('#orix-clean .badge--available')).toHaveText('Disponible');110});111112test('page Contact : aucun formulaire, aucune adresse non vérifiée', async ({ page }) => {113  await page.goto('/contact');114  await expect(page.locator('main form, main input, main textarea')).toHaveCount(0);115  await expect(page.locator('a[href^="mailto:"]')).toHaveCount(0);116  expect(await page.locator('body').innerText()).not.toMatch(/@agentilab\.ai/);117});118119test('page Entreprise : faits du registre, rien de privé', async ({ page }) => {120  await page.goto('/entreprise');121  const facts = page.locator('.legal-facts');122  await expect(facts).toContainText('Société de développement de logiciels, AgentiLab Technologies inc.');123  await expect(facts).toContainText('1181397903');124  await expect(facts).toContainText('15 octobre 2025');125  await expect(facts).toContainText('16 octobre 2025');126  await expect(page.locator('.timeline > li')).toHaveCount(2);127  expect(await page.locator('body').innerText()).not.toMatch(/actionnaire|droit de vote|\b[A-Z]\d[A-Z] ?\d[A-Z]\d\b/i);128});129
Files main
Menu

Theme