Immo-Ka — agrégateur des propriétés à vendre au Québec (73 connecteurs, ~40 000 annonces, React+FastAPI)
Python 47.5%
HTML 27.9%
TypeScript 15.5%
CSS 7.2%
JavaScript 2%
1// Parcours d'interactions Playwright sur la fiche (mobile) : galerie plein2// écran, panneau « Voir les N lieux », « Demander à Ka », accordéons — vérifie3// l'absence d'erreur JS et que chaque panneau s'ouvre puis se ferme.4// Usage : node frontend/scripts/interactions.mjs <uid> [baseUrl]5import { chromium, devices } from "playwright";6const UID = process.argv[2]; const BASE = process.argv[3] || "http://127.0.0.1:8096";7if (!UID) { console.error("usage: node interactions.mjs <uid> [baseUrl]"); process.exit(2); }8const browser = await chromium.launch();9const ctx = await browser.newContext({ ...devices["iPhone 14"] }); const page = await ctx.newPage();10const errs = [];11page.on("pageerror", (e) => errs.push("PAGEERROR " + e.message));12page.on("console", (m) => { if (m.type() === "error") errs.push(m.text().slice(0, 160)); });13await page.goto(`${BASE}/propriete/${encodeURIComponent(UID)}`, { waitUntil: "networkidle" });14await page.waitForSelector(".ik-hero");15const step = async (name, fn) => { try { await fn(); console.log("OK ", name); } catch (e) { console.log("FAIL", name, String(e).split("\n")[0]); } };16await step("galerie → plein écran → fermer", async () => {17 await page.click(".ik-gallery-full"); await page.waitForSelector(".ik-lightbox", { timeout: 3000 });18 await page.click(".ik-lightbox-close"); await page.waitForSelector(".ik-lightbox", { state: "detached", timeout: 3000 });19});20await step("accordéon score", async () => { await page.click("#score .ik-acc-btn"); await page.waitForSelector("#score .ik-acc-body.open", { timeout: 2000 }); });21await step("accordéon caractéristiques publiées", async () => {22 const b = page.locator("#propriete .ik-acc-btn").first(); await b.scrollIntoViewIfNeeded(); await b.click();23 await page.waitForSelector("#propriete .ik-acc-body.open", { timeout: 2000 });24});25await step("financement : test de résistance", async () => {26 await page.locator("#financement").scrollIntoViewIfNeeded(); await page.waitForTimeout(1500);27 const b = page.locator("#financement .ik-acc-btn").first(); await b.click(); await page.waitForSelector("#financement .ik-acc-body.open", { timeout: 2000 });28});29await step("carte : filtre Épiceries", async () => {30 await page.locator("#carte").scrollIntoViewIfNeeded(); await page.waitForTimeout(2500);31 const chip = page.locator("#carte .ik-chip:not([disabled])").first(); await chip.click(); await page.waitForTimeout(800);32});33await step("lieux : bottom sheet", async () => {34 await page.locator("#proximite").scrollIntoViewIfNeeded(); await page.waitForTimeout(800);35 await page.click("#proximite .ik-more"); await page.waitForSelector(".ik-sheet", { timeout: 3000 });36 await page.click(".ik-sheet-x"); await page.waitForSelector(".ik-sheet", { state: "detached", timeout: 3000 });37});38await step("Demander à Ka : sheet", async () => {39 await page.evaluate(() => window.scrollTo(0, 1500)); await page.waitForTimeout(500);40 await page.click(".ik-ka-btn"); await page.waitForSelector(".ik-sheet", { timeout: 3000 });41 await page.click(".ik-sheet-x"); await page.waitForSelector(".ik-sheet", { state: "detached", timeout: 3000 });42});43await step("404", async () => {44 await page.goto(`${BASE}/propriete/inexistant:0`, { waitUntil: "networkidle" }); await page.waitForSelector(".ik-page-error", { timeout: 8000 });45});46console.log("erreurs console:", errs.length, errs.slice(0, 5));47await browser.close();48process.exit(errs.filter((e) => !/Failed to fetch|api-ka|kaa/.test(e)).length ? 1 : 0);49