diff --git a/.eslintignore b/.eslintignore index bc18641..0fcf0a0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,6 @@ node_modules e2e/cypress/screenshots e2e/cypress/videos + +# Don't lint edX sources +edx/ diff --git a/.gitignore b/.gitignore index 6651719..2e19d2f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,9 @@ e2e/edx_courses_config.json # JS dependencies node_modules +# EdX src and modules +edx/src +edx/modules/ + # logs yarn-error.log diff --git a/Makefile b/Makefile index b7552b0..49d64ed 100644 --- a/Makefile +++ b/Makefile @@ -53,10 +53,18 @@ e2e/data/video.mp4: ## generate a 5 second long video and put it in e2e/data di -vcodec libx264 -preset superfast -tune zerolatency -pix_fmt yuv420p -t 5 \ -movflags +faststart "/e2e/data/video.mp4" +edx/src: ## directory to mount named bind volume for the edX-platform sources + mkdir -p edx/src + +edx/modules: ## directory to mound named bind volume for the edX python modules + mkdir -p edx/modules + # Make commands bootstrap: ## bootstrap the project bootstrap: \ + edx/src \ + edx/modules \ migrate \ run \ realm diff --git a/docker-compose.edx.yml b/docker-compose.edx.yml index 7a7d24f..4a5cffd 100644 --- a/docker-compose.edx.yml +++ b/docker-compose.edx.yml @@ -37,11 +37,14 @@ services: DJANGO_SETTINGS_MODULE: lms.envs.fun.docker_run ports: - "8072:8000" + - "3001:3000" user: ${DOCKER_UID}:${DOCKER_GID} volumes: - ./data/edx/media:/edx/var/edxapp/media - ./data/edx/store:/edx/app/edxapp/data - ./edx/config:/config + - edx_src:/edx/app/edxapp/edx-platform + - edx_modules:/usr/local/src - ./docker/files/usr/local/bin/auth_init:/usr/local/bin/auth_init command: > python manage.py lms runserver 0.0.0.0:8000 @@ -81,3 +84,18 @@ services: networks: potsie: external: true + +volumes: + edx_src: + driver: local + driver_opts: + type: volume + o: bind + device: ./edx/src + + edx_modules: + driver: local + driver_opts: + type: volume + o: bind + device: ./edx/modules 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). diff --git a/e2e/cypress/integration/lms_problem_interaction/js_input_response_spec.js b/e2e/cypress/integration/lms_problem_interaction/js_input_response_spec.js index 6d274d6..b67a766 100644 --- a/e2e/cypress/integration/lms_problem_interaction/js_input_response_spec.js +++ b/e2e/cypress/integration/lms_problem_interaction/js_input_response_spec.js @@ -12,8 +12,11 @@ describe("LMS JS Input Response Problem Interaction Test", () => { cy.lmsEnroll(true); // Navigate to the courseware. cy.visit(sectionUrl); + // Wait for iframe to become interactive. + cy.wait(1500); // Input wrong answers. cy.get(`#iframe_${problemId}_2_1`).click(118, 200); + cy.wait(200); // Submit answer. cy.get(".check.Valider").click(); cy.get(".check.Valider").should("not.have.class", "is-disabled");