Skip to content

Commit

Permalink
waitSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiago21112001 committed Apr 7, 2024
1 parent fe2bb19 commit 86dcee9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions webapp/e2e/steps/history.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ defineFeature(feature, test => {
});

when('I press history', async () => {
// Espera a que el enlace <a> con el texto "Historial" esté presente y sea clickeable
await page.waitForSelector('a', { text: 'Historial' });

await expect(page).toClick('a', { text: 'Historial' });
});

Expand Down
5 changes: 5 additions & 0 deletions webapp/e2e/steps/jugar-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ defineFeature(feature, (test) => {
});

when('the user clicks the "Play" button on the homepage', async () => {


// Espera a que el botón con el texto "JUGAR" esté presente y sea clickeable
await page.waitForSelector('button', { text: 'JUGAR' })

//NO LO ENCUENTRA
await expect(page).toClick('button', { text: 'JUGAR' })
await page.waitForTimeout(1500);
Expand Down
4 changes: 3 additions & 1 deletion webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ defineFeature(feature, test => {


then('The user is redirected', async () => {
//No lo encuentra
// Espera a que el elemento <p> con el texto deseado esté presente en la página
await page.waitForSelector('p', { text: '¿A que estás esperando?' });

await expect(page).toMatchElement("p", { text: "¿A que estás esperando?" });
});
})
Expand Down

0 comments on commit 86dcee9

Please sign in to comment.