Skip to content

Commit

Permalink
Changed the beforeall and also some things in login
Browse files Browse the repository at this point in the history
  • Loading branch information
lauratbg committed Apr 21, 2024
1 parent 9cee846 commit 8b9c72d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
4 changes: 0 additions & 4 deletions webapp/e2e/features/home.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions webapp/e2e/steps/instructions.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
13 changes: 7 additions & 6 deletions webapp/e2e/steps/login.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand All @@ -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);
Expand All @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/navBar.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 8b9c72d

Please sign in to comment.