diff --git a/webapp/e2e/steps/basicButtons-form.steps.js b/webapp/e2e/steps/basicButtons-form.steps.js index 3b60b5b..328d43e 100644 --- a/webapp/e2e/steps/basicButtons-form.steps.js +++ b/webapp/e2e/steps/basicButtons-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/customCategoryMode-form.steps.js b/webapp/e2e/steps/customCategoryMode-form.steps.js index 821d8da..e20c8dc 100644 --- a/webapp/e2e/steps/customCategoryMode-form.steps.js +++ b/webapp/e2e/steps/customCategoryMode-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/dailyQuestionMode-form.steps.js b/webapp/e2e/steps/dailyQuestionMode-form.steps.js index cfe1e9e..915c191 100644 --- a/webapp/e2e/steps/dailyQuestionMode-form.steps.js +++ b/webapp/e2e/steps/dailyQuestionMode-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/gameBasicMode-form.steps.js b/webapp/e2e/steps/gameBasicMode-form.steps.js index db7a3b5..eefa4a5 100644 --- a/webapp/e2e/steps/gameBasicMode-form.steps.js +++ b/webapp/e2e/steps/gameBasicMode-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/infinityMode-form.steps.js b/webapp/e2e/steps/infinityMode-form.steps.js index 43ad453..98d94ac 100644 --- a/webapp/e2e/steps/infinityMode-form.steps.js +++ b/webapp/e2e/steps/infinityMode-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index 3b78a85..4622b25 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -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 }) diff --git a/webapp/e2e/steps/multiplayerMode-form.steps.js b/webapp/e2e/steps/multiplayerMode-form.steps.js index b6e2600..7243f14 100644 --- a/webapp/e2e/steps/multiplayerMode-form.steps.js +++ b/webapp/e2e/steps/multiplayerMode-form.steps.js @@ -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 diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index fc2a49e..2fe5f44 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -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 }) diff --git a/webapp/src/components/game/gameModes/DailyGameMode.js b/webapp/src/components/game/gameModes/DailyGameMode.js index f1e59ec..209af9a 100644 --- a/webapp/src/components/game/gameModes/DailyGameMode.js +++ b/webapp/src/components/game/gameModes/DailyGameMode.js @@ -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{ @@ -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(){ @@ -91,6 +94,8 @@ class DailyGameMode extends BasicGame{ super.finishGame(); //this.questionIndex=10; this.volverAJugarCoockie(); + + } //next question con indice 10 termina el juego @@ -105,6 +110,20 @@ class DailyGameMode extends BasicGame{ } async volverAJugarCoockie(){ + Swal.fire({ + title: i18n.t('basicGameEnd'), + html: ` +
: ${i18n.t('correctAnswers')} ${this.correctas}
+ `, + 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(); @@ -153,5 +172,4 @@ class DailyGameMode extends BasicGame{ return fechaSinHora; } } - -module.exports = DailyGameMode ; \ No newline at end of file +export default DailyGameMode ; \ No newline at end of file