From bb9fb1c63080909d9a7d1755f9560c2f872a8496 Mon Sep 17 00:00:00 2001 From: kesharibhai84 Date: Thu, 22 Aug 2024 13:13:45 +0530 Subject: [PATCH] bug:e2e for chrome mobile --- src/components/Omr/OmrItem.vue | 2 +- src/components/Questions/Body.vue | 2 +- .../specs/renders-player-to-check-optional.js | 24 ++++++++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/Omr/OmrItem.vue b/src/components/Omr/OmrItem.vue index 6fbd34f..c281dc2 100644 --- a/src/components/Omr/OmrItem.vue +++ b/src/components/Omr/OmrItem.vue @@ -485,7 +485,7 @@ export default defineComponent({ // Styling the notification Object.assign(notification.style, { position: "fixed", - bottom: "20px", + bottom: "80px", right: "20px", backgroundColor: "#f44336", color: "white", diff --git a/src/components/Questions/Body.vue b/src/components/Questions/Body.vue index cdd97f2..50e93e9 100644 --- a/src/components/Questions/Body.vue +++ b/src/components/Questions/Body.vue @@ -529,7 +529,7 @@ export default defineComponent({ // Styling the notification Object.assign(notification.style, { position: "fixed", - bottom: "20px", + bottom: "80px", right: "20px", backgroundColor: "#f44336", color: "white", diff --git a/tests/e2e/specs/renders-player-to-check-optional.js b/tests/e2e/specs/renders-player-to-check-optional.js index e458e15..db983ac 100644 --- a/tests/e2e/specs/renders-player-to-check-optional.js +++ b/tests/e2e/specs/renders-player-to-check-optional.js @@ -139,19 +139,27 @@ describe("Player for Assessment quizzes", () => { ); }); - it("once scorecard displayed, number of skipped questions should not consider optional questions", () => { + it("check if scorecard eventually becomes visible", () => { + // Remove or hide any toast notifications + cy.get(".Vue-Toastification__toast-body").should("not.exist"); + + // Interact with the endTestButton cy.get('[data-test="modal"]') - .get('[data-test="endTestButton"]') - .trigger("click"); + .find('[data-test="endTestButton"]') + .click(); - // additional click to protect endTest button + // Additional check to ensure the button click was successful cy.get('[data-test="modal"]') - .get('[data-test="endTestButton"]') - .trigger("click"); + .find('[data-test="endTestButton"]') + .click(); + + // Wait for the scorecard to become visible + cy.get('[data-test="scorecard"]').should("be.visible"); + // Verify the text of the metricValue-2 cy.get('[data-test="scorecard"]') - .get('[data-test="metricValue-2"]') - .should("have.text", 12); // 12 in first qset, none in 2nd qset + .find('[data-test="metricValue-2"]') + .should("have.text", "12"); // Ensure the text is a string }); }); });