diff --git a/webapp/e2e/steps/theCallange.steps.js b/webapp/e2e/steps/theCallange.steps.js index 8b3d7d59..609fd412 100644 --- a/webapp/e2e/steps/theCallange.steps.js +++ b/webapp/e2e/steps/theCallange.steps.js @@ -86,15 +86,7 @@ defineFeature(feature, test => { }); then('The button turns green', async () => { - /*const answerButton = await page.$x('(//*[@data-testid="answer"])[1]'); - const textoBoton1 = await page.evaluate(button => button.innerText, answerButton[0]); - const textoBoton2 = await page.evaluate(button => button.innerText, answerButton[1]); - if(textoBoton1 === "Madrid") { - await expect(textoBoton1).toMatch(/Madrid/i); - } else { - await expect(textoBoton2).toMatch(/Madrid/i); - }*/ - await expect(page).toMatchElement("button", { style: { color: 'green' } }); + await expect(page).toMatchElement("button", { style: { color: 'rgb(51, 153, 102);' } }); }); }) @@ -119,16 +111,8 @@ defineFeature(feature, test => { }); then('The button turns red', async () => { - /*const answerButton = await page.$x('(//*[@data-testid="answer"])[2]'); - const textoBoton1 = await page.evaluate(button => button.innerText, answerButton[0]); - const textoBoton2 = await page.evaluate(button => button.innerText, answerButton[1]); - if(textoBoton1 !== "Madrid") { - await expect(textoBoton1).not.toMatch(/Madrid/i); - } else { - await expect(textoBoton2).toMatch(/Madrid/i); - }*/ - await expect(page).toMatchElement("button", { style: { color: 'red' } }); - await expect(page).toMatchElement("button", { style: { color: 'green' } }); + await expect(page).toMatchElement("button", { style: { color: 'rgb(153, 0, 0);' } }); + await expect(page).toMatchElement("button", { style: { color: 'rgb(51, 153, 102);' } }); }); }) diff --git a/webapp/src/pages/Statistics.js b/webapp/src/pages/Statistics.js index 83b6b14c..632e5202 100644 --- a/webapp/src/pages/Statistics.js +++ b/webapp/src/pages/Statistics.js @@ -41,8 +41,8 @@ const Statistics = () => { useEffect(() => { const fetchQuestionsRecord = async () => { try { - const response = await axios.get(`${apiEndpoint}/questionsRecord/${username}/${selectedMode}`, { - username: username, + const response = await axios.get(`${apiEndpoint}/questionsRecord/${user}/${selectedMode}`, { + username: user, gameMode: selectedMode }); setQuestionsRecord(response.data); @@ -52,7 +52,7 @@ const Statistics = () => { }; fetchQuestionsRecord(); - }, [username, selectedMode]); + }, [user, selectedMode]); const totalPages = Math.ceil(questionsRecord.length / itemsPerPage); @@ -236,14 +236,14 @@ const Statistics = () => { - {question.correctAnswer === question.response ? : } + {question.correctAnswer === question.response ? : } {question.question} {question.options.map((option, optionIndex) => ( { diff --git a/webapp/src/pages/games/TheChallengeGame.js b/webapp/src/pages/games/TheChallengeGame.js index d9c9c440..5397347f 100644 --- a/webapp/src/pages/games/TheChallengeGame.js +++ b/webapp/src/pages/games/TheChallengeGame.js @@ -381,7 +381,7 @@ const TheChallengeGame = () => {