Skip to content

Commit

Permalink
Merge pull request #141 from Arquisoft/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dmachados authored May 4, 2022
2 parents 18d7a19 + 2307e2d commit 16c48d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions webapp/e2e/steps/login.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ defineFeature(feature, test => {

test("Usuario inicia sesión", ({given,when,then}) => {
let username:string
let password:string
console.log(process.env.PASSWORD_TEST!)
let ps:string

given("Página sin usuario logueado", () => {
username = "test"
password = "123456"
ps = "123456";
});

when("Proceso de login", async () => {
Expand All @@ -46,7 +45,7 @@ defineFeature(feature, test => {
await page.waitForNavigation()
await expect(page).toMatch("Login");
await expect(page).toFill("input[name='name']", username);
await expect(page).toFill("input[name='password']", password);
await expect(page).toFill("input[name='password']", ps);
await expect(page).toClick("button[id='inicio-sesion']");
await page.waitForNavigation()
//Redirige a /catalogo
Expand Down
6 changes: 3 additions & 3 deletions webapp/e2e/steps/logout.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ defineFeature(feature, test => {

test("Usuario se desloguea de la aplicación", ({given,when,then}) => {
let username:string
let password:string
let ps:string

given("Página con usuario logueado", () => {
username = "test"
password = "123456";
ps = "123456";
});

when("Proceso de logout", async () => {
Expand All @@ -46,7 +46,7 @@ defineFeature(feature, test => {
await page.waitForNavigation()
await expect(page).toMatch("Login");
await expect(page).toFill("input[name='name']", username);
await expect(page).toFill("input[name='password']", password);
await expect(page).toFill("input[name='password']", ps);
await expect(page).toClick("button[id='inicio-sesion']");
await page.waitForNavigation()
//Login realizado el usuario se desloguea
Expand Down
10 changes: 5 additions & 5 deletions webapp/e2e/steps/register.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ defineFeature(feature, test => {

test("intento registro", ({given,when,then}) => {
let username:string
let password:string
let ps:string
let email:string

given("página sin iniciar sesión", () => {
username = crypto.randomUUID().toString();
email = crypto.randomUUID().toString() + "@email.com";
password = "123456"
ps = "123456";
});

when("Creo un usuario", async () => {
Expand All @@ -52,14 +52,14 @@ defineFeature(feature, test => {
await page.waitForNavigation()
await expect(page).toFill("input[name='username']", username);
await expect(page).toFill("input[name='email']", email);
await expect(page).toFill("input[name='password']", password);
await expect(page).toFill("input[name='confirmPwd']", password);
await expect(page).toFill("input[name='password']", ps);
await expect(page).toFill("input[name='confirmPwd']", ps);
await expect(page).toClick("button[id='btnSubmit']");
await page.waitForNavigation()
// Inicia sesión con el nuevo usuario
await expect(page).toMatch("Login");
await expect(page).toFill("input[name='name']", username);
await expect(page).toFill("input[name='password']", password);
await expect(page).toFill("input[name='password']", ps);
});

then("Me puedo loggear", async () => {
Expand Down

0 comments on commit 16c48d1

Please sign in to comment.