Skip to content

Commit

Permalink
son los test de la v1.0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Apr 30, 2024
1 parent 39d2518 commit 065fee9
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 248 deletions.
10 changes: 0 additions & 10 deletions webapp/e2e/features/customCategoryMode-form.feature

This file was deleted.

4 changes: 2 additions & 2 deletions webapp/e2e/features/dailyQuestionMode-form.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Scenario: User play the daily question
When I play the daily question
Then I should see a message with my game results

Scenario: User wants to play the daily question but he/she/they already played it
Scenario: User wants to play the daily question but he/she/they already played it
When I try to play the daily question
Then I should see a message
Then I should see a message with a message
10 changes: 0 additions & 10 deletions webapp/e2e/features/infinityMode-form.feature

This file was deleted.

10 changes: 3 additions & 7 deletions webapp/e2e/steps/basicButtons-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down Expand Up @@ -82,7 +82,7 @@ defineFeature(feature, test => {
});

then('I should see a list of past games played', async () => {
await expect(page).toMatchElement("#noplay-history");
await expect(page).toMatchElement("#main-history");
});
})

Expand Down Expand Up @@ -186,9 +186,5 @@ defineFeature(feature, test => {
await expect(page).toMatchElement("#loginButton");
});
})

afterAll(async ()=>{
browser.close()
})

});
98 changes: 0 additions & 98 deletions webapp/e2e/steps/customCategoryMode-form.steps.js

This file was deleted.

18 changes: 8 additions & 10 deletions webapp/e2e/steps/dailyQuestionMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down Expand Up @@ -75,6 +75,7 @@ defineFeature(feature, test => {
test('User play the daily question', ({when,then}) => {

when('I play the daily question', async () => {
//vamos a las opciones del usuario
await expect(page).toClick("#button-diario-game");

//empieza el juego y respoonde la pregunta
Expand All @@ -87,21 +88,18 @@ defineFeature(feature, test => {
});
})


test('User wants to play the daily question but he/she/they already played it', ({when,then}) => {

when('I try to play the daily question', async () => {
//vamos a las opciones del usuario
await expect(page).toClick("#button-diario-game");
});

then('I should see a message', async () => {
await expect(page).toMatchElement(".yaJugoDiaria");
//pendiente de implementar
});
})


afterAll(async ()=>{
browser.close()
then('I should see a message with a message', async () => {
//pendiente de implementar
});
})

});
9 changes: 3 additions & 6 deletions webapp/e2e/steps/gameBasicMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down Expand Up @@ -88,10 +88,7 @@ defineFeature(feature, test => {
await expect(page).toMatchElement(".finDelJuego");
});
})


afterAll(async ()=>{
browser.close()
})


});
96 changes: 0 additions & 96 deletions webapp/e2e/steps/infinityMode-form.steps.js

This file was deleted.

4 changes: 2 additions & 2 deletions webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 50 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

await page
.goto("http://localhost:3000/login", {
Expand Down
8 changes: 5 additions & 3 deletions webapp/e2e/steps/multiplayerMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ defineFeature(feature, test => {
beforeAll(async () => {
browserHost = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
pageHost = await browserHost.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

browserUser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
pageUser = await browserUser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })

await pageHost
.goto("http://localhost:3000/addUser", {
Expand Down
5 changes: 3 additions & 2 deletions webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: {width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
setDefaultOptions({ timeout: 10000 })

await page
.goto("http://localhost:3000/login", {
Expand Down Expand Up @@ -207,6 +207,7 @@ defineFeature(feature, test => {
});
})


afterAll(async ()=>{
browser.close()
})
Expand Down
Loading

0 comments on commit 065fee9

Please sign in to comment.