{"version":3,"names":["test","expect","runSteps","configure","ai","gateway","models","stepExecution","userFlowLow","userFlowHigh","assertionPrimary","assertionSecondary","assertionArbiter","TARGET","process","env","TARGET_URL","TEST_EMAIL","page","setTimeout","submitResponses","on","res","url","includes","push","status","ts","Date","toISOString","message","userFlow","steps","description","data","value","waitUntil","assertions","assertion","console","log","JSON","stringify","length","toBeGreaterThan","some","r","toBeTruthy"],"sources":["contact-hubspot.spec.ts"],"sourcesContent":["import { test, expect } from \"@playwright/test\";\nimport { runSteps, configure } from \"passmark\";\n\n// ── Config Passmark : Vercel AI Gateway (clé partagée AI_GATEWAY_API_KEY du VPS).\n//    Exécution → Gemini Flash (rapide/éco) ; jugement → Claude Sonnet 4.6.\nconfigure({\n  ai: {\n    gateway: \"vercel\",\n    models: {\n      stepExecution: \"google/gemini-3.5-flash\",\n      userFlowLow: \"google/gemini-3-flash-preview\",\n      userFlowHigh: \"google/gemini-3.5-flash\",\n      assertionPrimary: \"anthropic/claude-sonnet-4.6\",\n      assertionSecondary: \"google/gemini-3-flash\",\n      assertionArbiter: \"anthropic/claude-sonnet-4.6\",\n    },\n  },\n});\n\nconst TARGET =\n  process.env.TARGET_URL ||\n  \"https://covalba-next-wp-tom-integration-hubspot-client.paf-studio.dev/contact\";\nconst TEST_EMAIL = \"paf-studio-code@agentmail.to\";\n\ntest(\"Formulaire Contact → soumission HubSpot (live)\", async ({ page }) => {\n  test.setTimeout(240_000); // l'exécution IA est lente\n\n  // Preuve dure : on capture la réponse de l'API HubSpot Forms (doit être 200).\n  const submitResponses: { url: string; status: number }[] = [];\n  page.on(\"response\", (res) => {\n    if (res.url().includes(\"/submissions/v3/integration/submit/\")) {\n      submitResponses.push({ url: res.url(), status: res.status() });\n    }\n  });\n\n  const ts = new Date().toISOString();\n  const message =\n    `### TEST AUTOMATISE (Passmark — UI live), merci d'ignorer ce lead. ` +\n    `Soumis via le formulaire /contact. Horodatage ${ts}. ###`;\n\n  await runSteps({\n    page,\n    userFlow: \"Remplir entierement et soumettre le formulaire de contact Covalba\",\n    steps: [\n      { description: `Navigate to ${TARGET}` },\n      { description: \"Scroll to the contact form card titled 'Décrivez votre demande'\" },\n      { description: \"Type the email address into the 'E-mail professionnel' input\", data: { value: TEST_EMAIL } },\n      { description: \"Type the first name into the 'Prénom' input\", data: { value: \"Claude\" } },\n      { description: \"Type the last name into the 'Nom' input\", data: { value: \"TEST-Passmark\" } },\n      { description: \"Type the company name into the \\\"Nom de l'entreprise\\\" input\", data: { value: \"Paf-Studio Code (TEST)\" } },\n      { description: \"Type the phone number into the phone field (France +33 is preselected)\", data: { value: \"0612345678\" } },\n      { description: \"Type the city into the 'Ville' input\", data: { value: \"Orléans\" } },\n      { description: \"Type the message into the 'Message' textarea\", data: { value: message } },\n      { description: \"Check the RGPD consent checkbox about Covalba processing your data\" },\n      {\n        description: \"Click the 'Envoyer ma demande' submit button\",\n        waitUntil: \"A success confirmation with the heading 'Message envoyé !' is visible\",\n      },\n    ],\n    assertions: [\n      {\n        assertion:\n          \"The contact form shows a success confirmation: a green check icon with the heading 'Message envoyé !' and a thank-you message. The form fields are no longer visible.\",\n      },\n    ],\n    test,\n    expect,\n  });\n\n  // ── Vérification réseau (preuve indépendante des e-mails).\n  console.log(\"[hubspot] submit responses:\", JSON.stringify(submitResponses));\n  expect(submitResponses.length, \"au moins une requête HubSpot submit attendue\").toBeGreaterThan(0);\n  expect(\n    submitResponses.some((r) => r.status === 200),\n    `réponse HubSpot submit 200 attendue, reçu: ${JSON.stringify(submitResponses)}`,\n  ).toBeTruthy();\n});\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC/C,SAASC,QAAQ,EAAEC,SAAS,QAAQ,UAAU;;AAE9C;AACA;AACAA,SAAS,CAAC;EACRC,EAAE,EAAE;IACFC,OAAO,EAAE,QAAQ;IACjBC,MAAM,EAAE;MACNC,aAAa,EAAE,yBAAyB;MACxCC,WAAW,EAAE,+BAA+B;MAC5CC,YAAY,EAAE,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