diff --git a/webapp/e2e/features/home.feature b/webapp/e2e/features/home.feature index dfc7601..4bf8742 100644 --- a/webapp/e2e/features/home.feature +++ b/webapp/e2e/features/home.feature @@ -1,9 +1,5 @@ Feature: Home page functionality - Scenario: The text container is initially visible - Given I am on the home page - Then The text container should be visible - Scenario: Opening the text container Given I am on the home page When I click on the toggle button to open diff --git a/webapp/e2e/steps/instructions.steps.js b/webapp/e2e/steps/instructions.steps.js index 0770eaf..9383504 100644 --- a/webapp/e2e/steps/instructions.steps.js +++ b/webapp/e2e/steps/instructions.steps.js @@ -9,15 +9,15 @@ let browser; defineFeature(feature, test => { - beforeAll(async () => { - browser = await puppeteer.launch({ - slowMo: 20, - defaultViewport: { width: 1920, height: 1080 }, - args: ['--window-size=1920,1080'] - }); - page = await browser.newPage(); - setDefaultOptions({ timeout: 10000 }); - }); + beforeAll(async () => { + browser = await puppeteer.launch({ + headless: "new", + slowMo: 20, + defaultViewport: { width: 1920, height: 1080 }, + args: ['--window-size=1920,1080'] + }); + + }); test('Instructions view is well rendered', ({ given, then }) => { given('I am on the instructions page', async () => { diff --git a/webapp/e2e/steps/login.steps.js b/webapp/e2e/steps/login.steps.js index 3623f16..2249b0b 100644 --- a/webapp/e2e/steps/login.steps.js +++ b/webapp/e2e/steps/login.steps.js @@ -11,12 +11,13 @@ defineFeature(feature, test => { beforeAll(async () => { browser = await puppeteer.launch({ - headless: "new", + headless: false, slowMo: 20, defaultViewport: { width: 1920, height: 1080 }, args: ['--window-size=1920,1080'] }); - + page = await browser.newPage(); // InicializaciĆ³n de la pĆ”gina + setDefaultOptions({ timeout: 10000 }); }); test('Successful login', ({ given, when, then }) => { @@ -32,7 +33,7 @@ defineFeature(feature, test => { }); then('I should be redirected to the menu', async () => { - await page.waitForNavigation(); + await page.waitForNavigation({ waitUntil: 'networkidle0' }); expect(page.url()).toContain('/menu'); }); }, 60000); @@ -50,9 +51,9 @@ defineFeature(feature, test => { }); then('I should NOT be redirected to the menu', async () => { - await page.waitForNavigation(); - expect(page.url()).toContain('/login'); - }); + await page.waitForNavigation({ waitUntil: 'networkidle0' }); + expect(page.url()).toContain('/login'); + }); }, 60000); afterAll(async () => { diff --git a/webapp/e2e/steps/navBar.steps.js b/webapp/e2e/steps/navBar.steps.js index 9664ff4..32d80a4 100644 --- a/webapp/e2e/steps/navBar.steps.js +++ b/webapp/e2e/steps/navBar.steps.js @@ -11,12 +11,12 @@ defineFeature(feature, test => { beforeAll(async () => { browser = await puppeteer.launch({ + headless: "new", slowMo: 20, defaultViewport: { width: 1920, height: 1080 }, args: ['--window-size=1920,1080'] }); - page = await browser.newPage(); - setDefaultOptions({ timeout: 10000 }); + }); test('Displaying navbar elements correctly', ({ given, then }) => {