Skip to content

Commit

Permalink
🐛(tests) reset drag_and_drop test before interaction
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SergioSim committed Nov 8, 2022
1 parent 6a55ef9 commit 9a6430f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 9a6430f

Please sign in to comment.