Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 26, 2024
1 parent 383141a commit 477d6be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions webapp/e2e/steps/play-battery.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ defineFeature(feature, (test) => {
: await puppeteer.launch({ headless: 'new', slowMo: 100 });
page = await browser.newPage();
setDefaultOptions({ timeout: 10000 });

await page.goto("http://localhost:3000", {
localStorage.setItem("username","testuser");
localStorage.setItem("token","abcdefg");
await page.goto("http://localhost:3000/home/bateria", {
waitUntil: "networkidle0",
});
await page.setRequestInterception(true);
Expand Down Expand Up @@ -59,9 +60,7 @@ defineFeature(feature, (test) => {
let firstquestion;
test("The user can answer a question on Battery mode", ({ given, when, then }) => {
given("A logged-in user", async () => {
localStorage.setItem("username","testuser");
localStorage.setItem("token","abcdefg");


await page.waitForTimeout(1000);
await page.waitForXPath('//button[contains(text(), "Batería de sabios")]');
const button = await page.$x('//button[contains(text(), "Batería de sabios")]');
Expand Down
5 changes: 2 additions & 3 deletions webapp/e2e/steps/play-calculator.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ defineFeature(feature, (test) => {
: await puppeteer.launch({ headless: "new", slowMo: 100 });
page = await browser.newPage();
setDefaultOptions({ timeout: 10000 });

localStorage.setItem("username","testuser");
localStorage.setItem("token","abcdefg");
await page.goto("http://localhost:3000/home/calculadora", {
waitUntil: "networkidle0",
});
Expand Down Expand Up @@ -72,8 +73,6 @@ defineFeature(feature, (test) => {
then,
}) => {
given("A logged-in user", async () => {
localStorage.setItem("username","testuser");
localStorage.setItem("token","abcdefg");

await page.waitForTimeout(1000);
await page.waitForXPath(
Expand Down

0 comments on commit 477d6be

Please sign in to comment.