Skip to content

Commit

Permalink
Merge branch 'e2e-fixes' of https://github.com/Arquisoft/wiq_es1a int…
Browse files Browse the repository at this point in the history
…o e2e-fixes
  • Loading branch information
CANCI0 committed Apr 26, 2024
2 parents c6d3cfa + ae7625c commit b239ebf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions webapp/e2e/steps/play-battery.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'){
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,8 +15,8 @@ defineFeature(feature, (test) => {
: await puppeteer.launch({ headless: "new", slowMo: 100 });
page = await browser.newPage();
setDefaultOptions({ timeout: 10000 });
await page.goto("http://localhost:3000/", {

await page.goto("http://localhost:3000", {
waitUntil: "networkidle0",
});

Expand Down Expand Up @@ -117,7 +117,6 @@ defineFeature(feature, (test) => {

then("The game ends", async () => {
await page.waitForSelector('[data-testid="play-again-button"]');

const gameOverMessage = await page.evaluate(() => {
return document.querySelector('[data-testid="play-again-button"]')
.textContent;
Expand Down

0 comments on commit b239ebf

Please sign in to comment.