Skip to content

Commit

Permalink
test arreglado
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Apr 29, 2024
1 parent 23feae7 commit a96489a
Show file tree
Hide file tree
Showing 24 changed files with 463 additions and 15 deletions.
2 changes: 1 addition & 1 deletion webapp/e2e/steps/basicButtons-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/customCategoryMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
6 changes: 3 additions & 3 deletions webapp/e2e/steps/dailyQuestionMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down Expand Up @@ -87,7 +87,7 @@ 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 () => {
Expand All @@ -98,7 +98,7 @@ defineFeature(feature, test => {
await expect(page).toMatchElement(".yaJugoDiaria");
});
})
*/


afterAll(async ()=>{
browser.close()
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/gameBasicMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/infinityMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 , defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/multiplayerMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ defineFeature(feature, test => {
beforeAll(async () => {
browserHost = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0, defaultViewport: { width: 1200, height: 800 }});
pageHost = await browserHost.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })

browserUser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 , defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: { width: 1200, height: 800 }});
pageUser = await browserUser.newPage();

await pageHost
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 , defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 0 , defaultViewport: { width: 1200, height: 800 }});
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 30000 })
Expand Down
58 changes: 58 additions & 0 deletions webapp/gatewayservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions webapp/gatewayservice/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"webapp": "file:.."
}
}
58 changes: 58 additions & 0 deletions webapp/historyservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions webapp/historyservice/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"webapp": "file:.."
}
}
3 changes: 2 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"build": "react-scripts build",
"prod": "serve -s build",
"test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'",
"test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"",
"clearJestCache": "jest --clearCache",
"test:e2e": "npm run clearJestCache && start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand Down
58 changes: 58 additions & 0 deletions webapp/questionservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions webapp/questionservice/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"webapp": "file:.."
}
}
58 changes: 58 additions & 0 deletions webapp/roomservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions webapp/roomservice/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"webapp": "file:.."
}
}
12 changes: 9 additions & 3 deletions webapp/src/components/history/History.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ export function History({darkMode}){
.then(estadisticas => {
//console.log("Estadísticas: ");
//console.log(estadisticas);
act(() => {
setStatistics(estadisticas);
if(estadisticas.error || estadisticas.length === 0 || Object.values(estadisticas)){
setNeverPlayer(true);
setIsLoadingStats(false);
});
}
else{
act(() => {
setStatistics(estadisticas);
setIsLoadingStats(false);
});
}
})
.catch(error => {
//console.error('Error cargando las estadísticas del usuario:', error);
Expand Down
Loading

0 comments on commit a96489a

Please sign in to comment.