From 10a995d48e9860a28c8300a6d85d442df6a14b31 Mon Sep 17 00:00:00 2001 From: iyanfdezz Date: Fri, 26 Apr 2024 17:23:26 +0200 Subject: [PATCH] Porfi --- webapp/e2e/steps/play-battery.steps.js | 7 +++++++ webapp/e2e/steps/play-calculator.steps.js | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/webapp/e2e/steps/play-battery.steps.js b/webapp/e2e/steps/play-battery.steps.js index 25d8412e..bd466c11 100644 --- a/webapp/e2e/steps/play-battery.steps.js +++ b/webapp/e2e/steps/play-battery.steps.js @@ -15,13 +15,20 @@ defineFeature(feature, (test) => { : await puppeteer.launch({ headless: 'new', slowMo: 100 }); page = await browser.newPage(); setDefaultOptions({ timeout: 10000 }); + + await page.goto("http://localhost:3000", { + waitUntil: "networkidle0", + }); + await page.evaluate(() => { localStorage.setItem("username","testuser"); localStorage.setItem("token","abcdefg"); }); + await page.goto("http://localhost:3000/home/bateria", { waitUntil: "networkidle0", }); + await page.setRequestInterception(true); page.on('request', (req) => { if (req.method() === 'OPTIONS'){ diff --git a/webapp/e2e/steps/play-calculator.steps.js b/webapp/e2e/steps/play-calculator.steps.js index d5a59141..ee795db4 100644 --- a/webapp/e2e/steps/play-calculator.steps.js +++ b/webapp/e2e/steps/play-calculator.steps.js @@ -15,6 +15,11 @@ defineFeature(feature, (test) => { : await puppeteer.launch({ headless: "new", slowMo: 100 }); page = await browser.newPage(); setDefaultOptions({ timeout: 10000 }); + + await page.goto("http://localhost:3000", { + waitUntil: "networkidle0", + }); + await page.evaluate(() => { localStorage.setItem("username","testuser"); localStorage.setItem("token","abcdefg");