Skip to content

Commit

Permalink
añadidos features
Browse files Browse the repository at this point in the history
  • Loading branch information
yagonavajas committed Apr 7, 2024
1 parent 793e0af commit e5489d2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
11 changes: 11 additions & 0 deletions webapp/e2e/features/history.feature
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions webapp/e2e/features/login-form.feature
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion webapp/e2e/steps/history.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {

Expand Down
6 changes: 3 additions & 3 deletions webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
});
})
Expand Down

0 comments on commit e5489d2

Please sign in to comment.