Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-qg committed May 1, 2024
1 parent 3a59383 commit 435f63e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webapp/e2e/steps/playGame.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ defineFeature(feature, test => {
for(let i = 0; i < 2; i++){//Dos preguntas
await expect(page).toMatchElement("div", { class: "questionStructure" });//Comprobamos que existe el div de la pregunta

await page.waitForSelector(`#option-1`);
const button = await page.$(`#option-1`);//Comprobamos que existe la segunda opción
expect(button).not.toBeNull();
await expect(button).not.toBeNull();

const noButton = await page.$(`#option-2`);//Comprobamos que no existe una tercera opción
expect(noButton).toBeNull();
button.click();//Respondemos la segunda opción

await new Promise((resolve) => setTimeout(resolve, 200)); //Simulación del tiempo de reflexión del usuario
await expect(page).toClick('#option-0');//Respondemos la primera opción

await new Promise((resolve) => setTimeout(resolve, 2100)); //Esperar a que se muestre la pregunta
}
Expand Down

0 comments on commit 435f63e

Please sign in to comment.