From 9a6430f66b5268b7da9b82643596ff770121b1ad Mon Sep 17 00:00:00 2001 From: SergioSim Date: Thu, 3 Nov 2022 09:23:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(tests)=20reset=20drag=5Fand=5Fdrop?= =?UTF-8?q?=20test=20before=20interaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drag_and_drop test relies on the problem beeing at it's initial state. However, edX preserves the state of the problem once it's submitted. Therefore we reset the drag_and_drop problem before answering it. --- .../lms_problem_interaction/drag_and_drop_spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e/cypress/integration/lms_problem_interaction/drag_and_drop_spec.js b/e2e/cypress/integration/lms_problem_interaction/drag_and_drop_spec.js index e7fd67b..4f06df6 100644 --- a/e2e/cypress/integration/lms_problem_interaction/drag_and_drop_spec.js +++ b/e2e/cypress/integration/lms_problem_interaction/drag_and_drop_spec.js @@ -23,6 +23,15 @@ describe("LMS Drag And Drop Problem Interaction Test", () => { before(() => { cy.lmsLoginStudent(); cy.lmsEnroll(true); + // Reset Problem + const { courseId } = Cypress.env("EDX_COURSES").demoCourse1; + const handlerURL = "handler/xmodule_handler/problem_reset"; + const url = `/courses/${courseId}/xblock/${problem.locator}/${handlerURL}`; + const method = "POST"; + const body = { id: problem.locator }; + cy.request({ url, method, body }).then((response) => { + expect(response.status).to.equal(200); + }); // Navigate to the courseware. cy.visit(sectionUrl); // Input answers (first image).