Skip to content

Commit

Permalink
test arreglados e histoiral tb
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed May 1, 2024
1 parent 4e6db4e commit 91eecb0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 14 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: 0, defaultViewport: { width: 1920, height: 1080 }});
: 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: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20, 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/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: 0, defaultViewport: { width: 1200, height: 800 }});
: await puppeteer.launch({ headless: false, slowMo: 20, 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/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: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20, 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: 0, defaultViewport: { width: 1920, height: 1080}});
: 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: 0 , defaultViewport: { width: 1920, height: 1080 }});
: 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: 0, defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20, 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: 0 , defaultViewport: { width: 1920, height: 1080 }});
: await puppeteer.launch({ headless: false, slowMo: 20 , 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: 0 , defaultViewport: {width: 1920, height: 1080 }});
: 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
28 changes: 23 additions & 5 deletions webapp/src/components/game/gameModes/DailyGameMode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { default: BasicGame } = require("../BasicGame");
import BasicGame from "../BasicGame";

//const { default: GameMode } = require("./GameMode");
import Swal from 'sweetalert2';
import i18n from 'i18next'; // Importa i18n

class DailyGameMode extends BasicGame{

Expand Down Expand Up @@ -30,8 +33,8 @@ class DailyGameMode extends BasicGame{
console.log("enviar historial gameMode daily ");
//sacar del localStorage el usuario
historyData.user = localStorage.getItem('username');
if(this.enviarHistorialPorQueHasAcetado){
}


}

async incrementAcertadas(){
Expand Down Expand Up @@ -91,6 +94,8 @@ class DailyGameMode extends BasicGame{
super.finishGame();
//this.questionIndex=10;
this.volverAJugarCoockie();


}

//next question con indice 10 termina el juego
Expand All @@ -105,6 +110,20 @@ class DailyGameMode extends BasicGame{
}

async volverAJugarCoockie(){
Swal.fire({
title: i18n.t('basicGameEnd'),
html: `
<p>: ${i18n.t('correctAnswers')} ${this.correctas}</p>
`,
confirmButtonText: i18n.t('close'),
customClass: {
popup: 'finDelJuego'
}
}).then(()=>{

this.navigate('/home');

});

// Obtener la fecha actual y establecer la hora a las 12 de la noche
let expiryDate = new Date();
Expand Down Expand Up @@ -153,5 +172,4 @@ class DailyGameMode extends BasicGame{
return fechaSinHora;
}
}

module.exports = DailyGameMode ;
export default DailyGameMode ;

0 comments on commit 91eecb0

Please sign in to comment.