From e5489d262fbd249607815624cf0147c1de1eb4a2 Mon Sep 17 00:00:00 2001 From: yagonavajas Date: Sun, 7 Apr 2024 22:04:56 +0200 Subject: [PATCH] =?UTF-8?q?a=C3=B1adidos=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/e2e/features/history.feature | 11 +++++++++++ webapp/e2e/features/login-form.feature | 6 ++++++ webapp/e2e/steps/history.steps.js | 2 +- webapp/e2e/steps/login-form.steps.js | 6 +++--- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/webapp/e2e/features/history.feature b/webapp/e2e/features/history.feature index e69de29..59e58c8 100644 --- a/webapp/e2e/features/history.feature +++ b/webapp/e2e/features/history.feature @@ -0,0 +1,11 @@ +Feature: Seeing the loged user history + +Scenario: The user is not loged in the site + Given A not loged user + When Press history + Then Redirected to login + +Scenario: The user is loged in the site so he can see history + Given A registered user, i fill the login + When I press history + Then I see my history \ No newline at end of file diff --git a/webapp/e2e/features/login-form.feature b/webapp/e2e/features/login-form.feature index e69de29..0384d7c 100644 --- a/webapp/e2e/features/login-form.feature +++ b/webapp/e2e/features/login-form.feature @@ -0,0 +1,6 @@ +Feature: Login a existing user + +Scenario: The user is registered in the site + Given A registered user, fill the data + When Presses submit + Then The user is redirected \ No newline at end of file diff --git a/webapp/e2e/steps/history.steps.js b/webapp/e2e/steps/history.steps.js index d89233b..5071986 100644 --- a/webapp/e2e/steps/history.steps.js +++ b/webapp/e2e/steps/history.steps.js @@ -33,7 +33,7 @@ defineFeature(feature, test => { }, 60000); - test('The user is not loged in the site so he cant see history', ({given,when,then}) => { + test('The user is not loged in the site', ({given,when,then}) => { given('A not loged user', async () => { diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index a91b866..d1f2b1f 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -32,17 +32,17 @@ defineFeature(feature, test => { test('The user is registered in the site', ({given,when,then}) => { - given('A registered user, i fill the data', async () => { + given('A registered user, fill the data', async () => { await expect(page).toFill('input[name="username"]', username); await expect(page).toFill('input[name="password"]', password); }); - when('I press submit', async () => { + when('Presses submit', async () => { await expect(page).toClick('button', { text: 'Entrar' }); }); - then('The user is redirected ', async () => { + then('The user is redirected', async () => { await expect(page).toMatchElement("div", { text: "Inicio de sesiĆ³n exitoso" }); }); })