Skip to content

Commit

Permalink
bug:e2e for chrome mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
kesharibhai84 committed Aug 22, 2024
1 parent d2dc211 commit bb9fb1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Omr/OmrItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Questions/Body.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 16 additions & 8 deletions tests/e2e/specs/renders-player-to-check-optional.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
});
});
Expand Down

0 comments on commit bb9fb1c

Please sign in to comment.