-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accessiblite - Dé-commenter les tests d'intégration - Corriger soucis d'accessibilité détectés - Ajouter fixtures pour les déchets
- Loading branch information
1 parent
a257df5
commit 2e53838
Showing
13 changed files
with
107 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,54 @@ | ||
import { AxeBuilder } from "@axe-core/playwright" | ||
import { expect, test } from "@playwright/test" | ||
import { AxeBuilder } from "@axe-core/playwright"; | ||
import { expect, test } from "@playwright/test"; | ||
|
||
// test("formulaire iFrame is WCAG compliant", async ({ page }) => { | ||
// await page.goto(`http://localhost:8000/test_iframe`, { waitUntil: "networkidle" }) | ||
// Shared variables | ||
const BASE_URL = "http://localhost:8000"; | ||
const WCAG_TAGS = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]; | ||
const IFRAME_SELECTOR = "iframe"; | ||
|
||
// const accessibilityScanResults = await new AxeBuilder({ page }) | ||
// .include("iframe") // restriction du scan à l'iframe uniquement | ||
// .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) // TODO : trouver quelle règle se rapproche le plus du RGAA | ||
// .analyze() | ||
test.describe("WCAG Compliance Tests", () => { | ||
test("Formulaire iFrame | Desktop", async ({ page }) => { | ||
await page.goto(`${BASE_URL}/test_iframe`, { waitUntil: "networkidle" }); | ||
|
||
// expect(accessibilityScanResults.violations).toEqual([]) | ||
// }) | ||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.include(IFRAME_SELECTOR) // Restrict scan to the iframe | ||
.withTags(WCAG_TAGS) | ||
.analyze(); | ||
|
||
// test("carte iFrame is WCAG compliant", async ({ page }) => { | ||
// await page.goto(`http://localhost:8000/test_iframe?carte`, { waitUntil: "networkidle" }) | ||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); | ||
|
||
// const accessibilityScanResults = await new AxeBuilder({ page }) | ||
// .include("iframe") // restriction du scan à l'iframe uniquement | ||
// .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) // TODO : trouver quelle règle se rapproche le plus du RGAA | ||
// .analyze() | ||
test("Carte iFrame | Desktop", async ({ page }) => { | ||
await page.goto(`${BASE_URL}/test_iframe?carte`, { waitUntil: "networkidle" }); | ||
|
||
// expect(accessibilityScanResults.violations).toEqual([]) | ||
// }) | ||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.include(IFRAME_SELECTOR) // Restrict scan to the iframe | ||
.withTags(WCAG_TAGS) | ||
.analyze(); | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); | ||
|
||
test("Assistant Homepage | Desktop", async ({ page }) => { | ||
// TODO: Update the route for production | ||
await page.goto(`${BASE_URL}/dechet`, { waitUntil: "networkidle" }); | ||
|
||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.exclude("[data-disable-axe]") | ||
.withTags(WCAG_TAGS) | ||
.analyze(); | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); | ||
|
||
test("Assistant Detail Page | Desktop", async ({ page }) => { | ||
await page.goto(`${BASE_URL}/smartphone`, { waitUntil: "networkidle" }); | ||
|
||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.exclude("[data-disable-axe]") | ||
.withTags(WCAG_TAGS) | ||
.analyze(); | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[ | ||
{ | ||
"model": "qfdmd.produit", | ||
"pk": 334, | ||
"fields": { | ||
"modifie_le": "2025-01-14T17:45:28.800Z", | ||
"qu_est_ce_que_j_en_fais_mauvais_etat": "", | ||
"qu_est_ce_que_j_en_fais_bon_etat": "", | ||
"comment_les_eviter": "Assurez-vous à l'achat qu'il bénéficie d'une bonne garantie réparation et faites le durer autant que possible.\nEn cas de panne, faites-le réparer. Pour faciliter la réparation, à l'achat, privilégiez un appareil démontable. Pour les smartphone, un indicateur simple vous permet de savoir si celui que vous voulez acheter est facilement réparable, grâce à une note sur 10 indiquant son \"indice de réparabilité\".\n<br /><br />\nRetrouvez des conseils d'entretien de votre téléphone pour prolonger sa durée de vie sur la <a href=\"https://epargnonsnosressources.gouv.fr/entretien/smartphone/\" target=\"_blank\">Bible de l'entretien des objets</a>.", | ||
"que_va_t_il_devenir": "Remis à une structure de réemploi ou revendu, votre appareil poursuit une seconde vie. Déposé en déchèterie ou remis à un revendeur, il suit la filière des Déchets d'Équipements Électriques et Électroniques (DEEE). Il est alors acheminé jusqu'à un centre de traitement où il est démantelé et ses différents composants recyclables récupérés (métaux et plastiques). Les substances non-recyclables sont incinérées (avec le plus souvent récupération de chaleur pour produire de l'énergie) ou enfouies dans des installations de stockage de déchets.", | ||
"nom": "Téléphone mobile", | ||
"synonymes_existants": "Smartphone", | ||
"code": "DEEE", | ||
"bdd": "ocad3e", | ||
"qu_est_ce_que_j_en_fais": "S'il est encore en bon état, donnez-le à une association caritative ou un proche, ou bien revendez-le.<br /><br />S’il est en panne, privilégiez la réparation. Certains réparateurs peuvent même vous faire bénéficier d'une réduction via le <a href=\"https://www.economie.gouv.fr/particuliers/bonus-reparation-comment-ca-marche\" target=\"_blank\">Bonus Réparation</a>.\n<br /><br />Qu'il soit hors service ou encore fonctionnel vous pouvez :<br /><br />-\tle déposer en boutique de téléphonie ou le renvoyer via le service de reprise à distance de votre opérateur.<br /><br />-\tl'envoyer par correspondance grâce aux services de certains éco-organismes (voir \"<b>En savoir plus</b>\" ci-dessous).<br /><br />\nSinon, apportez-le en déchèterie.", | ||
"nom_eco_organisme": "Ecologic / Ecosystem", | ||
"filieres_rep": "Equipements électriques et électroniques", | ||
"slug": "Téléphone mobile" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[ | ||
{ | ||
"model": "qfdmd.synonyme", | ||
"pk": 1915, | ||
"fields": { | ||
"modifie_le": "2025-01-14T17:45:28.807Z", | ||
"qu_est_ce_que_j_en_fais_mauvais_etat": "", | ||
"qu_est_ce_que_j_en_fais_bon_etat": "", | ||
"comment_les_eviter": "", | ||
"que_va_t_il_devenir": "", | ||
"slug": "smartphone", | ||
"nom": "Smartphone", | ||
"produit": 334, | ||
"picto": "", | ||
"pin_on_homepage": false, | ||
"meta_description": "" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters