diff --git a/client/cypress/e2e/Activities/sharingActivities.cy.ts b/client/cypress/e2e/Activities/sharingActivities.cy.ts
new file mode 100644
index 0000000000..8ede5621cb
--- /dev/null
+++ b/client/cypress/e2e/Activities/sharingActivities.cy.ts
@@ -0,0 +1,58 @@
+describe("Share Activities Tests", function () {
+ before(() => {});
+
+ beforeEach(() => {});
+
+ it("create, share, and copy public activity", () => {
+ let code = Date.now().toString();
+ const scrappyEmail = `scrappy${code}@doo`;
+ const scoobyEmail = `scooby${code}@doo`;
+
+ cy.loginAsTestUser({
+ email: scoobyEmail,
+ firstNames: "Scooby",
+ lastNames: "Doo",
+ });
+
+ cy.visit("/");
+
+ cy.get('[data-test="Activities"]').click();
+ cy.get('[data-test="New Button"]').click();
+ cy.get('[data-test="Add Activity Button"]').click();
+
+ cy.get('[data-test="Editable Title"]').type(
+ `My new activity${code}{enter}`,
+ );
+
+ cy.iframe().find(".cm-editor").type(`{ctrl+A}Hello there!{enter}{ctrl+S}`);
+
+ cy.iframe().find(".doenet-viewer").should("contain.text", `Hello there!`);
+
+ cy.get('[data-test="Sharing Button"]').click();
+ cy.get('[data-test="Public Checkbox"]').click();
+ cy.get('[data-test="Status message"]').should(
+ "have.text",
+ "Successfully shared publicly",
+ );
+
+ cy.get('[data-test="Close Share Drawer Button"]').click();
+
+ cy.loginAsTestUser({
+ email: scrappyEmail,
+ });
+ cy.visit("/");
+
+ cy.get('[data-test="Community"]').click();
+ cy.get('[data-test="Search"]').type(`activity${code}{enter}`);
+
+ cy.get(
+ '[data-test="Results All Matches"] [data-test="Activity Link"]',
+ ).click();
+
+ cy.get('[data-test="Copy to Activities Button"]').click();
+ cy.get('[data-test="Go to Activities"]').click();
+
+ cy.get(`[data-test="Activity Link"]`).eq(0).click();
+ cy.iframe().find(".doenet-viewer").should("contain.text", `Hello there!`);
+ });
+});
diff --git a/client/cypress/e2e/AlertQueue/assignmentAlertQueue.cy.js b/client/cypress/e2e/AlertQueue/assignmentAlertQueue.cy.js
deleted file mode 100644
index 8ea7e6e0d6..0000000000
--- a/client/cypress/e2e/AlertQueue/assignmentAlertQueue.cy.js
+++ /dev/null
@@ -1,288 +0,0 @@
-import { cesc } from "../../../src/_utils/url";
-
-describe("Assignment Alert Queue Tests", function () {
- before(() => {});
-
- beforeEach(() => {});
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("No Alert", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "aaq_courseid1";
- const doenetML = `
-
-1+1 = 2
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Assign a single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type(doenetML);
- cy.get('[data-test="Viewer Update Button"]').click();
- cy.get(".doenet-viewer").contains("Problem 1");
-
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Assign Tab"]').click();
- cy.get('[data-test="Assign Button"]').eq(1).click();
- cy.log("alert queue should show message and then be dismissed");
- cy.get('[data-test="Alert Title"]').should(
- "have.text",
- "Activity is assigned.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- cy.get('[data-test="Close Settings Button"]').click();
-
- cy.log("sign in as student");
- cy.signin({ userId: studentUserId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").last().dblclick();
- cy.get(".mq-root-block").type("2{enter}");
-
- // cy.get('[data-test="Alert Title"]').contains("No credit awarded since the due date has passed.");
- // cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- });
-
- it("Solution Shown Alert", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "aaq_courseid2";
- const doenetML = `
-
-1+1 = 2
-2
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Assign a single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type(doenetML);
- cy.get('[data-test="Viewer Update Button"]').click();
- cy.get(".doenet-viewer").contains("Problem 1");
-
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Assign Tab"]').click();
- cy.get('[data-test="Assign Button"]').eq(1).click();
- cy.log("alert queue should show message and then be dismissed");
- cy.get('[data-test="Alert Title"]').should(
- "have.text",
- "Activity is assigned.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
-
- cy.log("Set due date to a date in the past");
- cy.get('[data-test="due date"]').type("2023-09-01T04:56").blur();
- cy.get('[data-test="Alert Title"]').contains("Due date set.");
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- cy.get('[data-test="Close Settings Button"]').click();
-
- cy.log("sign in as student");
- cy.signin({ userId: studentUserId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").last().dblclick();
- cy.get(cesc("#\\/_solution1_button")).click();
-
- cy.get(".mq-root-block").type("2{enter}");
- cy.get('[data-test="Alert Title"]').contains(
- "No credit awarded since the solution has been viewed.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- });
-
- it("Due Date Alert", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "aaq_courseid2";
- const doenetML = `
-
-1+1 = 2
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Assign a single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type(doenetML);
- cy.get('[data-test="Viewer Update Button"]').click();
- cy.get(".doenet-viewer").contains("Problem 1");
-
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Assign Tab"]').click();
- cy.get('[data-test="Assign Button"]').eq(1).click();
- cy.log("alert queue should show message and then be dismissed");
- cy.get('[data-test="Alert Title"]').should(
- "have.text",
- "Activity is assigned.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
-
- cy.log("Set due date to a date in the past");
- cy.get('[data-test="due date"]').type("2023-09-01T04:56").blur();
- cy.get('[data-test="Alert Title"]').contains("Due date set.");
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- cy.get('[data-test="Close Settings Button"]').click();
-
- cy.log("sign in as student");
- cy.signin({ userId: studentUserId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").last().dblclick();
- cy.get(".mq-root-block").type("2{enter}");
-
- cy.get('[data-test="Alert Title"]').contains(
- "No credit awarded since the due date has passed.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- });
-
- //TODO: finish this implementation
- it.skip("No Attempts Left Alert", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "aaq_courseid2";
- const doenetML = `
-
-1+1 = 2
-2
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Assign a single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type(doenetML);
- cy.get('[data-test="Viewer Update Button"]').click();
- cy.get(".doenet-viewer").contains("Problem 1");
-
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Assign Tab"]').click();
- cy.get('[data-test="Assign Button"]').eq(1).click();
- cy.log("alert queue should show message and then be dismissed");
- cy.get('[data-test="Alert Title"]').should(
- "have.text",
- "Activity is assigned.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
-
- cy.log("Set max attempts to 1");
- cy.get('[data-test="Grade Tab"]').click();
- cy.get('[data-test="Number of Attempts Allowed Checkbox"]').click();
- cy.get('[data-test="Alert Title"]').contains("1 attempt allowed.");
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- cy.get('[data-test="Close Settings Button"]').click();
-
- cy.log("sign in as student");
- cy.signin({ userId: studentUserId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").last().dblclick();
-
- cy.get(".mq-root-block").type("2{enter}");
- cy.get('[data-test="New Attempt"').click();
- cy.get(".mq-root-block").type("2{enter}");
- cy.get('[data-test="Alert Title"]').contains(
- "No credit awarded since the number of attempts allowed has been exceeded.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- });
-
- //TODO: finish this implementation
- it.skip("Timed Out Alert", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "aaq_courseid2";
- const doenetML = `
-
-1+1 = 2
-2
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Assign a single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type(doenetML);
- cy.get('[data-test="Viewer Update Button"]').click();
- cy.get(".doenet-viewer").contains("Problem 1");
-
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Assign Tab"]').click();
- cy.get('[data-test="Assign Button"]').eq(1).click();
-
- cy.log("alert queue should show message and then be dismissed");
- cy.get('[data-test="Alert Title"]').should(
- "have.text",
- "Activity is assigned.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
-
- cy.log("Set due date to a date in the past");
- cy.get('[data-test="Presentation Tab"]').click();
- cy.get('[data-test="Time Limit"]').click("2023-09-01T04:56").blur();
- cy.get('[data-test="Time Limit"]').click("2023-09-01T04:56").blur();
- cy.get('[data-test="Alert Title"]').contains("Due date set.");
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- cy.get('[data-test="Close Settings Button"]').click();
-
- cy.log("sign in as student");
- cy.signin({ userId: studentUserId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").last().dblclick();
- cy.get(cesc("#\\/_solution1_button")).click();
-
- cy.get(".mq-root-block").type("2{enter}");
- cy.get('[data-test="Alert Title"]').contains(
- "No credit awarded since the time allowed has expired.",
- );
- cy.get('[data-test="Alert Close Button"]').click();
- cy.get('[data-test="Alert Title"]').should("not.exist");
- });
-});
diff --git a/client/cypress/e2e/AsStudent/assignedActivity.cy.js b/client/cypress/e2e/AsStudent/assignedActivity.cy.js
deleted file mode 100644
index 711837c76c..0000000000
--- a/client/cypress/e2e/AsStudent/assignedActivity.cy.js
+++ /dev/null
@@ -1,165 +0,0 @@
-describe("Assigned Activity Tests", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const pageDoenetId = "_page1id";
-
- before(() => {
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.clearAllOfAUsersActivities({ userId: studentUserId });
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- });
- cy.visit(`/course?tool=editor&doenetId=${doenetId}&pageId=${pageDoenetId}`);
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // Returning false here prevents Cypress from failing the test
- return false;
- });
-
- /* Methods to get/set the date and time */
-
- // Formatting the date to be 'mm/dd/yyyy' WITH leading zeros
- // Ex: '09/12/2022' for September 12, 2022
- function formatDateWithYear(date, prefixZero) {
- const yyyy = date.getFullYear();
- let mm = date.getMonth() + 1; // Months start at 0!
- let dd = date.getDate();
- if (prefixZero) {
- if (mm < 10) mm = "0" + mm;
- if (dd < 10) dd = "0" + dd;
- }
-
- return mm + "/" + dd + "/" + yyyy;
- }
-
- // Formatting the date to be 'mm/dd' WITHOUT leading zeros
- // Ex: '9/12' for September 12, 2022
- function formatDateWithoutYear(date) {
- let mm = date.getMonth() + 1; // Months start at 0!
- let dd = date.getDate();
-
- return mm + "/" + dd;
- }
-
- function getDayOfWeek(date) {
- const weekday = [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- ];
- return weekday[date.getDay()];
- }
-
- function getAmPm(hour) {
- return hour >= 12 ? "PM" : "AM";
- }
-
- function formatHours(date) {
- let hr = date.getHours();
- hr = hr % 12;
- return hr ? hr : 12; // Hour '0' should be '12
- }
-
- function formatMinutes(date) {
- let min = date.getMinutes();
- return min < 10 ? "0" + min : min;
- }
-
- // Formatting the time to be 'hh:mm A/P'
- // Ex: '4:02 P' for '04:02:00 PM'
- function formatTime(date) {
- let hr = formatHours(date);
- let min = formatMinutes(date);
- const ampm = date.getHours() >= 12 ? "PM" : "AM"; // Datetime component automatically adds the 'M'
-
- return hr + ":" + min + " " + ampm;
- }
-
- it("Activity contains due date in Content page", () => {
- const assignedDate = new Date();
- let dueDate = new Date(assignedDate.getTime() + 7 * 24 * 60 * 60 * 1000); // One week from now
- dueDate.setSeconds(0); //To prevent rounding up false tests
-
- // Update the activity as the owner
- cy.get('[data-test="AssignmentSettingsMenu Menu"]').click();
- cy.get('[data-test="Due Date Checkbox"]').click();
- cy.get('[data-test="Due Date"]').should(
- "have.value",
- formatDateWithYear(dueDate, true) + " " + formatTime(dueDate),
- );
- cy.get('[data-test="Assigned Date Checkbox"]').click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible"); //Wait for activity to be saved
-
- // Sign in as a student
- cy.signin({ userId: studentUserId });
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- // Check if the Content page contains the correct activity with the due date
- cy.get(".navigationRow").should("have.length", 1); // Need this to wait for the row to appear
- cy.get('[data-test="rowLabel"]').contains("Cypress Activity");
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn2")
- .contains(
- formatDateWithYear(dueDate, false) +
- ", " +
- formatHours(dueDate) +
- ":" +
- formatMinutes(dueDate) +
- ":00",
- );
- });
-
- it("Activity contains assigned date and due date in Content By Week page", () => {
- const assignedDate = new Date();
- let dueDate = new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000); // One week from now
-
- // Update the activity as the owner
- cy.get('[data-test="AssignmentSettingsMenu Menu"]').click();
- cy.get('[data-test="Assigned Date Checkbox"]').click();
- cy.get('[data-test="Assigned Date"]').should(
- "have.value",
- formatDateWithYear(assignedDate, true) + " " + formatTime(assignedDate),
- );
- cy.get('[data-test="Due Date Checkbox"]').click();
- cy.get('[data-test="Due Date"]').should(
- "have.value",
- formatDateWithYear(dueDate, true) + " " + formatTime(dueDate),
- );
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible"); //Wait for activity to be saved
-
- // Sign in as a student
- // Check if the Content By Week page contains the correct activity with the assigned date and due date
- cy.signin({ userId: studentUserId });
- cy.visit(`/course?tool=dashboard&courseId=${courseId}`);
- cy.get('[data-test="next week button"]').click();
- cy.get("table").should("have.length", 1); // Need this to wait for the row to appear
- cy.get('[data-test="cbw assignment label 0"]').contains("Cypress Activity");
- cy.get('[data-test="cbw assigned date 0"]').contains(
- formatDateWithoutYear(assignedDate) + " " + formatTime(assignedDate),
- ); // Add the 'M' back to AM/PM
- cy.get('[data-test="cbw due date 0"]').contains(
- formatDateWithoutYear(dueDate) + " " + formatTime(dueDate),
- );
- });
-});
diff --git a/client/cypress/e2e/AsStudent/previousAndNext.cy.js b/client/cypress/e2e/AsStudent/previousAndNext.cy.js
deleted file mode 100644
index 050bcacc26..0000000000
--- a/client/cypress/e2e/AsStudent/previousAndNext.cy.js
+++ /dev/null
@@ -1,236 +0,0 @@
-describe("Previous and Next Activty Button Tests", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- //TODO: create these randomly or from server
- const courseId = "_cypressCourse";
- const section1DoenetId = "_section1";
- const activityOptions = [
- {
- parent: courseId,
- isAssigned: true,
- isMultiPage: false,
- settingOverrides: {},
- },
- {
- parent: courseId,
- isAssigned: true,
- isMultiPage: false,
- settingOverrides: {},
- },
- {
- parent: courseId,
- isAssigned: true,
- isMultiPage: false,
- settingOverrides: { proctorMakesAvailable: 1 },
- },
- {
- parent: courseId,
- isAssigned: false,
- isMultiPage: false,
- settingOverrides: {},
- },
- {
- parent: section1DoenetId,
- isAssigned: true,
- isMultiPage: false,
- settingOverrides: {},
- },
- {
- parent: section1DoenetId,
- isAssigned: false,
- isMultiPage: false,
- settingOverrides: {},
- },
- {
- parent: courseId,
- isAssigned: true,
- isMultiPage: true,
- settingOverrides: {},
- },
- {
- parent: courseId,
- isAssigned: true,
- isMultiPage: true,
- settingOverrides: {},
- },
- ];
- const activitySettings = {
- assignedDate: "2024-01-01 00:00:00",
- dueDate: "2025-12-31 00:00:00",
- timeLimit: 70,
- numberOfAttemptsAllowed: 10,
- attemptAggregation: "l",
- totalPointsOrPercent: 10,
- gradeCategory: "problem sets",
- itemWeights: [5],
- individualize: 0,
- showSolution: 0,
- showSolutionInGradebook: 0,
- showFeedback: 0,
- showHints: 0,
- showCorrectness: 0,
- showCreditAchievedMenu: 0,
- paginate: 0,
- showFinishButton: 1,
- proctorMakesAvailable: 0,
- autoSubmit: 0,
- pinnedAfterDate: "2024-01-01 00:00:00",
- pinnedUntilDate: "2025-12-31 00:00:00",
- };
- const genIdsInContnetOrder = [];
-
- before(() => {
- cy.signin({ userId });
- //TODO: remove once Ids are random
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- // create activites, first two will be assigned,
- // third left alone, a seciton child, firth a multi page
- // cy.createSection({
- // courseId,
- // doenetId: section1DoenetId,
- // parentDoenetId: courseId,
- // });
- for (let i in activityOptions) {
- let { isMultiPage, isAssigned, parent, settingOverrides } =
- activityOptions[i];
- const doenetId = `_doenetId${i}`;
- genIdsInContnetOrder[i] = { doenetId };
- if (isMultiPage) {
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: parent,
- pageDoenetId1: `_pageDoenetId${i}.1`,
- doenetML1: `${i}.1: ${i}.1`,
- pageDoenetId2: `_pageDoenetId${i}.2`,
- doenetML2: `${i}.2: ${i}.2`,
- });
- genIdsInContnetOrder[i]["firstPageId"] = `_pageDoenetId${i}.1`;
- } else {
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: parent,
- pageDoenetId: `_pageDoenetId${i}.1`,
- doenetML: `${i}: ${i}`,
- });
- genIdsInContnetOrder[i]["firstPageId"] = `_pageDoenetId${i}.1`;
- }
- cy.updateActivitySettings({
- courseId,
- doenetId,
- //TODO: current date instead of hardcoded
- activitySettings: JSON.stringify({
- ...activitySettings,
- ...settingOverrides,
- }),
- });
- if (isAssigned) {
- cy.visit(
- `/course?tool=editor&doenetId=${doenetId}&pageId=${`_pageDoenetId${i}.1`}`,
- );
- cy.get('[data-test="AssignmentSettingsMenu Menu"]')
- .should("be.visible")
- .click();
- cy.get('[data-test="Assign Activity"]').should("be.enabled").click();
- cy.get('[data-test="Unassign Activity"]').should("be.enabled");
- }
- }
- });
- beforeEach(() => {
- cy.signin({ userId: studentUserId });
- });
-
- Cypress.on("uncaught:exception", () => {
- // Returning false here prevents Cypress from failing the test
- return false;
- });
-
- it("Next button goes to from first to second", () => {
- cy.visit(
- `/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
- );
- cy.get('[data-test="Previous Activity Button"]').should("be.disabled");
- cy.get('[data-test="Next Activity Button"]').should("be.enabled").click();
- cy.url()
- .should("include", `doenetId=${genIdsInContnetOrder[1].doenetId}`)
- .should("contain", `pageId=${genIdsInContnetOrder[1].firstPageId}`);
- });
-
- it("Previous button goes to from second to first", () => {
- cy.visit(
- `/course?tool=assignment&doenetId=${genIdsInContnetOrder[1].doenetId}&pageId=${genIdsInContnetOrder[1].firstPageId}`,
- );
- cy.get('[data-test="Next Activity Button"]').should("be.enabled");
- cy.get('[data-test="Previous Activity Button"]')
- .should("be.enabled")
- .click();
- cy.url()
- .should("include", `doenetId=${genIdsInContnetOrder[0].doenetId}`)
- .should("contain", `pageId=${genIdsInContnetOrder[0].firstPageId}`);
- });
-
- it("Both button are disabled in proctored content", () => {
- const procIdx = activityOptions.findIndex(
- (options) => options?.settingOverrides?.proctorMakesAvailable === 1,
- );
- expect(procIdx).to.not.equal(-1);
- cy.visit(
- `/course?tool=assignment&doenetId=${genIdsInContnetOrder[procIdx].doenetId}&pageId=${genIdsInContnetOrder[procIdx].firstPageId}`,
- );
- cy.get('[data-test="Next Activity Button"]').should("be.disabled");
- cy.get('[data-test="Previous Activity Button"]').should("be.disabled");
- });
-
- it("Next button from first to last, skipping unassigned", () => {
- cy.visit(
- `/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
- );
- cy.get('[data-test="Previous Activity Button"]').should("be.disabled");
- let i;
- for (i = 1; i < activityOptions.length; i++) {
- let options = activityOptions[i];
-
- if (
- !options.isAssigned ||
- options?.settingOverrides?.proctorMakesAvailable === 1
- ) {
- continue;
- }
- cy.get('[data-test="Next Activity Button"]').should("be.enabled").click();
- cy.url()
- .should("include", `doenetId=${genIdsInContnetOrder[i].doenetId}`)
- .should("contain", `pageId=${genIdsInContnetOrder[i].firstPageId}`);
- cy.get('[data-test="Previous Activity Button"]').should("be.enabled");
- }
- cy.get('[data-test="Next Activity Button"]').should("be.disabled");
- });
-
- it("Previous button goes to from last to first, skipping unassigned and proctored", () => {
- cy.visit(
- `/course?tool=assignment&doenetId=${
- genIdsInContnetOrder[activityOptions.length - 1].doenetId
- }&pageId=${genIdsInContnetOrder[activityOptions.length - 1].firstPageId}`,
- );
- cy.get('[data-test="Next Activity Button"]').should("be.disabled");
- let i;
- for (i = 2; i <= activityOptions.length; i++) {
- let options = activityOptions[activityOptions.length - i];
- if (
- !options.isAssigned ||
- options?.settingOverrides?.proctorMakesAvailable === 1
- )
- continue;
- cy.get('[data-test="Previous Activity Button"]')
- .should("be.enabled")
- .click();
- cy.url().should(
- "include",
- `doenetId=${genIdsInContnetOrder[activityOptions.length - i].doenetId}`,
- );
- }
- cy.get('[data-test="Previous Activity Button"]').should("be.disabled");
- });
-});
diff --git a/client/cypress/e2e/AsStudent/signIn.cy.js b/client/cypress/e2e/AsStudent/signIn.cy.js
deleted file mode 100644
index 65f3f19852..0000000000
--- a/client/cypress/e2e/AsStudent/signIn.cy.js
+++ /dev/null
@@ -1,56 +0,0 @@
-describe("Student Sign-In Test", function () {
- const userId = "cyuserId";
- // const studentUserId = "cyStudentUserId";
- const courseId = "courseid1";
- // const doenetId = "activity1id";
- // const pageDoenetId = "_page1id";
-
- before(() => {
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- // cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- // cy.clearAllOfAUsersActivities({ userId: studentUserId });
- // cy.createActivity({ courseId, doenetId, parentDoenetId:courseId, pageDoenetId });
- cy.visit(`/course?tool=people&courseId=${courseId}`);
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // Returning false here prevents Cypress from failing the test
- return false;
- });
-
- it("Student can sign in after being added to a course", () => {
- const emailAddress = "scoobydoo@doenet.org";
- cy.get('[data-test="First"]').type("Scooby");
- cy.get('[data-test="Last"]').type("Doo");
- cy.get('[data-test="Email"]').type(emailAddress);
- cy.get('[data-test="Add User"]').click();
- cy.visit(`/settings`);
- cy.get('[data-test="sign out button"]').click();
- cy.get('[data-test="homepage button"]').should("be.visible");
- cy.visit(`/SignIn`);
- cy.get('[data-test="email input"]').type(emailAddress);
- cy.get('[data-test="sendEmailButton"]').click();
- cy.task(
- "queryDb",
- `SELECT signInCode FROM user_device ORDER BY id DESC LIMIT 1`,
- ).then((result) => {
- const code = result[0].signInCode;
- cy.get('[data-test="signinCodeInput"]').type(code);
- cy.get('[data-test="signInButton"]').click();
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Course Label"]').should(
- "have.text",
- "Cypress Generated",
- );
- cy.get('[data-test="Card Image Link"]').click();
- cy.document().should("contain.text", "Welcome");
- });
- });
-});
diff --git a/client/cypress/e2e/AssignedActivity/activitySettings.cy.js b/client/cypress/e2e/AssignedActivity/activitySettings.cy.js
deleted file mode 100644
index 691ec9dd15..0000000000
--- a/client/cypress/e2e/AssignedActivity/activitySettings.cy.js
+++ /dev/null
@@ -1,371 +0,0 @@
-describe("Activity Settings Test", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const pageDoenetId = "_page1id";
-
- before(() => {
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- });
-
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.clearAllOfAUsersActivities({ userId: studentUserId });
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").click();
- });
-
- // how to test time?
- it("Set Assigned Date", () => {
- // assign date to 01/15/2024
- // cypress might cause error due to diff time zone,
- // so if time set is 01/15/2024, that means the test is successful
- cy.get('[data-test="Assigned Date Checkbox"]').click();
-
- cy.get('[data-test="Assigned Date"]').click();
- cy.get(".rdtSwitch").click();
- cy.get(".rdtSwitch").click();
- cy.get('[data-value="2024"]').click();
- cy.get('[data-value="0"]').click();
- cy.get('[data-value="15"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT assignedDate FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- let utcDateTime = new Date(result[0].assignedDate);
- let localDateTime = utcDateTime.toLocaleDateString();
- expect(localDateTime).contains("1/15/2024");
- });
- });
-
- it("Set Due Date", () => {
- // set due date to 03/18/2025
- // cypress might cause error due to diff time zone,
- // so if time set is 03/19/2025, that means the test is successful
- cy.get('[data-test="Due Date Checkbox"]').click();
-
- cy.get('[data-test="Due Date"]').click();
- cy.get(".rdtSwitch").click();
- cy.get(".rdtSwitch").click();
- cy.get('[data-value="2025"]').click();
- cy.get('[data-value="2"]').click();
- cy.get('[data-value="18"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT dueDate FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- let utcDateTime = new Date(result[0].dueDate);
- let localDateTime = utcDateTime.toLocaleDateString();
- expect(localDateTime).contains("3/18/2025");
- });
- });
-
- it("Set Time Limit", () => {
- // default time limit is 60
- cy.get('[data-test="Time Limit Checkbox"]').click();
-
- // check increment time limit to 61
- cy.get('[data-test="Increment Time Limit"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT timeLimit FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].timeLimit).to.equals(61);
- });
-
- //check decrement time limit to 60
- cy.get('[data-test="Decrement Time Limit"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT timeLimit FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].timeLimit).to.equals(60);
- });
- });
-
- it("Set Attempts", () => {
- // default attempt limit is 1
- cy.get('[data-test="Attempt Limit Checkbox"]').click();
-
- // check increment attempt limit to 2
- cy.get('[data-test="Increment Attempt Limit"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT numberOfAttemptsAllowed FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].numberOfAttemptsAllowed).to.equals(2);
- });
-
- //check decrement attempt limit to 1
- cy.get('[data-test="Decrement Attempt Limit"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT numberOfAttemptsAllowed FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].numberOfAttemptsAllowed).to.equals(1);
- });
- });
-
- // how to click dropdown?
- // it('Set Attempt Aggregation',()=>{
- // cy.get('[data-test="Attempt Aggregation"]').click()
- // // cy.get('[data-test="Attempt Limit"]')
- // })
-
- it("Set Total Points or Percent", () => {
- // default Total Points or Percent is 0
-
- // check increment Total Points or Percent to 1
- cy.get('[data-test="Increment Total Points Or Percent"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT totalPointsOrPercent FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].totalPointsOrPercent).to.equals(1);
- });
-
- //check decrement Total Points or Percent to 0
- cy.get('[data-test="Decrement Total Points Or Percent"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT totalPointsOrPercent FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].totalPointsOrPercent).to.equals(0);
- });
- });
-
- // how to click dropdown?
- // it('Set Grade Category',()=>{
- // cy.get('[data-test="Grade Category"]').click()
- // // cy.get('[data-test="Attempt Limit"]')
- // })
-
- // in tbl course content
- it("Set Item Weights", () => {
- let itemWeights = 5;
- cy.get('[data-test="Item Weights"]').clear();
- cy.get('[data-test="Item Weights"]').type(itemWeights, { force: true });
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT jsonDefinition FROM course_content WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].jsonDefinition.itemWeights).eqls([itemWeights]);
- });
- });
-
- it("Individualize", () => {
- cy.get('[data-test="Individualize"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT individualize FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].individualize).to.equal(1);
- });
- });
-
- it("Show Solution", () => {
- cy.get('[data-test="Show Solution"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showSolution FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showSolution).to.equal(0);
- });
- });
-
- it("Show Solution In Gradebook", () => {
- cy.get('[data-test="Show Solution In Gradebook"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showSolutionInGradebook FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showSolutionInGradebook).to.equal(0);
- });
- });
-
- it("Show Feedback", () => {
- cy.get('[data-test="Show Feedback"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showFeedback FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showFeedback).to.equal(0);
- });
- });
-
- it("Show Hints", () => {
- cy.get('[data-test="Show Hints"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showHints FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showHints).to.equal(0);
- });
- });
-
- it("Show Correctness", () => {
- cy.get('[data-test="Show Correctness"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showCorrectness FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showCorrectness).to.equal(0);
- });
- });
-
- it("Show Credit Achieved Menu", () => {
- cy.get('[data-test="Show Credit Achieved Menu"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showCreditAchievedMenu FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showCreditAchievedMenu).to.equal(0);
- });
- });
-
- it("Paginate", () => {
- cy.get('[data-test="Paginate"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT paginate FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].paginate).to.equal(0);
- });
- });
-
- it("Show Finish Button", () => {
- cy.get('[data-test="Show Finish Button"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT showFinishButton FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].showFinishButton).to.equal(1);
- });
- });
-
- it("Proctor Makes Available", () => {
- cy.get('[data-test="Proctor Makes Available"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT proctorMakesAvailable FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].proctorMakesAvailable).to.equal(1);
- });
- });
-
- it("Auto Submit", () => {
- cy.get('[data-test="Auto Submit"]').click();
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT autoSubmit FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- expect(result[0].autoSubmit).to.equal(1);
- });
- });
-
- // db located where?
- // it('Make Publicly Visible',()=>{
- // cy.get('[data-test="Make Publicly Visible"]').click()
- // })
-
- // db located where?
- // it('Show DoenetML Source',()=>{
- // cy.get('[data-test="Show DoenetML Source"]').click()
- // })
-
- // checkbox not named (data-test) yet
- it("Pin Assignment", () => {
- cy.get('[data-test="Pin Assignment Checkbox"]').click();
-
- // assign pin after date to 01/03/2024
- // cypress might cause error due to diff time zone,
- // so if time set in db is 01/04/2024, that means the test is actually successful
- cy.get('[data-test="Pinned After Date"]').click();
- cy.get(
- ".rdtOpen > .rdtPicker > .rdtDays > table > thead > :nth-child(1) > .rdtSwitch",
- ).click();
- cy.get(".rdtMonths > :nth-child(1) > thead > tr > .rdtSwitch").click();
- cy.get('[data-value="2024"]').click();
- cy.get('[data-value="0"]').click();
- cy.get(
- '.rdtOpen > .rdtPicker > .rdtDays > table > tbody > :nth-child(1) > [data-value="3"]',
- ).click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
-
- // set pin until date to 07/20/2025
- // cypress might cause error due to diff time zone,
- // so if time set in db is 07/21/2025, that means the test is actually successful
- cy.get('[data-test="Pinned Until Date"]').click();
- cy.get(
- ".rdtOpen > .rdtPicker > .rdtDays > table > thead > :nth-child(1) > .rdtSwitch",
- ).click();
- cy.get(".rdtMonths > :nth-child(1) > thead > tr > .rdtSwitch").click();
- cy.get('[data-value="2025"]').click();
- cy.get(':nth-child(2) > [data-value="6"]').click();
- cy.get(':nth-child(4) > [data-value="20"]').click();
- cy.get('[data-test="Menu Panel"]').click({ force: true });
- cy.wait(500); //TODO: need the UI to let us know this was successful
- cy.task(
- "queryDb",
- `SELECT pinnedAfterDate, pinnedUntilDate FROM assignment WHERE doenetId="${doenetId}"`,
- ).then((result) => {
- let pinnedAfterUtcDateTime = new Date(result[0].pinnedAfterDate);
- let pinnedAfterLocalDateTime =
- pinnedAfterUtcDateTime.toLocaleDateString();
- cy.log(pinnedAfterLocalDateTime);
- expect(pinnedAfterLocalDateTime).contains("1/3/2024");
- let pinnedUntilUtcDateTime = new Date(result[0].pinnedUntilDate);
- let pinnedUntilLocalDateTime =
- pinnedUntilUtcDateTime.toLocaleDateString();
- cy.log(pinnedUntilLocalDateTime);
- expect(pinnedUntilLocalDateTime).contains("7/20/2025");
- });
- });
-});
diff --git a/client/cypress/e2e/AssignedActivity/creditAchievedMenu.cy.js b/client/cypress/e2e/AssignedActivity/creditAchievedMenu.cy.js
deleted file mode 100644
index fe7975c40b..0000000000
--- a/client/cypress/e2e/AssignedActivity/creditAchievedMenu.cy.js
+++ /dev/null
@@ -1,630 +0,0 @@
-// import {signIn} from '../DoenetSignin/DoenetSignin.cy';
-import { cesc } from "../../../src/_utils/url";
-
-describe("Credit achieved menu tests", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const doenetId2 = "activity2id";
- const pageDoenetId = "_page1id";
- const pageDoenetId2 = "_page2id";
- const pageDoenetId3 = "_page3id";
- const pageDoenetId4 = "_page4id";
-
- const headerPixels = 40;
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.clearAllOfAUsersActivities({ userId: studentUserId });
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Show item credits immediately", () => {
- const doenetML = `
-
- Enter x: x
-`;
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
-
- cy.get(cesc("#\\/ans") + " textarea").type("x{enter}", { force: true });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- });
-
- it("Pages without graded content", () => {
- const doenetML1 = `
-
- Enter x: x
-`;
-
- const doenetML2 = `
-
- No questions here
-`;
-
- const doenetML3 = `
-
-Enter y: y
-`;
-
- const doenetML4 = `
No questions here, either
`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1: pageDoenetId,
- pageDoenetId2,
- pageDoenetId3,
- pageDoenetId4,
- doenetML1,
- doenetML2,
- doenetML3,
- doenetML4,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "25%");
-
- cy.get('[data-test="next"]').click();
-
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get('[data-test="next"]').click();
-
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get(cesc("#page3\\/ans") + " textarea").type("y{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "75%");
-
- cy.get('[data-test="next"]').click();
- cy.get(cesc("#page4\\/_p1")).should(
- "have.text",
- "No questions here, either",
- );
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- it("Pages without graded content, non-paginated", () => {
- const doenetML1 = `
-
- Enter x: x
-
-`;
-
- const doenetML2 = `
-
- No questions here
-
-`;
-
- const doenetML3 = `
-
- Enter y: y
-
-`;
-
- const doenetML4 = `
-No questions here, either
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1: pageDoenetId,
- pageDoenetId2,
- pageDoenetId3,
- pageDoenetId4,
- doenetML1,
- doenetML2,
- doenetML3,
- doenetML4,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "25%");
-
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get("#page3").scrollIntoView();
-
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get(cesc("#page3\\/ans") + " textarea").type("y{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "75%");
-
- cy.get("#page4").scrollIntoView();
-
- cy.get(cesc("#page4\\/_p1")).should(
- "have.text",
- "No questions here, either",
- );
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- it("Pages without graded content and zero item weight", () => {
- const doenetML1 = `
-
- Enter x: x
-`;
-
- const doenetML2 = `
-
- No questions here
-`;
-
- const doenetML3 = `
-
-Enter y: y
-`;
-
- const doenetML4 = `No questions here, either
`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1: pageDoenetId,
- pageDoenetId2,
- pageDoenetId3,
- pageDoenetId4,
- doenetML1,
- doenetML2,
- doenetML3,
- doenetML4,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Item Weights"]')
- .clear()
- .type("2 0 1 0", { force: true })
- .blur();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get('[data-test="next"]').click();
-
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Complete");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get('[data-test="next"]').click();
-
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Complete");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get(cesc("#page3\\/ans") + " textarea").type("y{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Complete");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Not started");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="next"]').click();
- cy.get(cesc("#page4\\/_p1")).should(
- "have.text",
- "No questions here, either",
- );
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "Complete");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "Complete");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- it("Item credit achieved are links", () => {
- const doenetML1 = `
-
- Enter x: x
-`;
-
- const doenetML2 = `
-
- Enter y: y
-`;
-
- const doenetML3 = `
-
- Enter z: z
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1: pageDoenetId,
- pageDoenetId2,
- pageDoenetId3,
- doenetML1,
- doenetML2,
- doenetML3,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
- cy.get(cesc("#page2\\/_problem1_title")).should("not.exist");
- cy.get(cesc("#page3\\/_problem1_title")).should("not.exist");
-
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "33.3%");
-
- cy.get('[data-test="Item 3 Credit"]').click();
-
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
- cy.get(cesc("#page1\\/_problem1_title")).should("not.exist");
- cy.get(cesc("#page2\\/_problem1_title")).should("not.exist");
-
- cy.url().should("match", /#page3$/);
-
- cy.get(cesc("#page3\\/ans") + " textarea").type("z{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get('[data-test="Item 2 Credit"]').click();
-
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
- cy.get(cesc("#page1\\/_problem1_title")).should("not.exist");
- cy.get(cesc("#page3\\/_problem1_title")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
-
- cy.get(cesc("#page2\\/ans") + " textarea").type("y{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="Item 1 Credit"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
- cy.get(cesc("#page2\\/_problem1_title")).should("not.exist");
- cy.get(cesc("#page3\\/_problem1_title")).should("not.exist");
-
- cy.url().should("match", /#page1$/);
- });
-
- it("Item credit achieved are links, non-paginated", () => {
- const doenetML1 = `
-
- Enter x: x
-
-`;
-
- const doenetML2 = `
-
- Enter y: y
-
- `;
-
- const doenetML3 = `
-
- Enter z: z
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1: pageDoenetId,
- pageDoenetId2,
- pageDoenetId3,
- doenetML1,
- doenetML2,
- doenetML3,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
-
- cy.get("#page3").scrollIntoView();
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
-
- cy.get("#page1").scrollIntoView();
-
- cy.url().should("match", /#page1$/);
-
- // cy.get('[data-test="CreditAchieved Menu"]').click();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "33.3%");
-
- cy.get('[data-test="Item 3 Credit"]').click();
-
- cy.get(cesc("#page3\\/_problem1_title")).should("have.text", "Problem 3");
-
- cy.url().should("match", /#page3$/);
-
- cy.get(cesc("#page3\\/ans") + " textarea").type("z{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get('[data-test="Item 2 Credit"]').click();
-
- cy.get(cesc("#page2\\/_problem1_title")).should("have.text", "Problem 2");
-
- cy.url().should("match", /#page2$/);
-
- cy.get(cesc("#page2\\/ans") + " textarea").type("y{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="Item 1 Credit"]').click();
-
- cy.get(cesc("#page1\\/_problem1_title")).should("have.text", "Problem 1");
-
- cy.url().should("match", /#page1$/);
- });
-});
diff --git a/client/cypress/e2e/AssignedActivity/multipageActivities.cy.js b/client/cypress/e2e/AssignedActivity/multipageActivities.cy.js
deleted file mode 100644
index 7a2bbd3c34..0000000000
--- a/client/cypress/e2e/AssignedActivity/multipageActivities.cy.js
+++ /dev/null
@@ -1,3094 +0,0 @@
-// import {signIn} from '../DoenetSignin/DoenetSignin.cy';
-import { cesc, cesc2 } from "../../../src/_utils/url";
-
-describe("Multipage activity tests", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const doenetId2 = "activity2id";
- const pageDoenetId1 = "_page1id";
- const pageDoenetId2 = "_page2id";
- const pageDoenetId3 = "_page3id";
- const pageDoenetId4 = "_page4id";
-
- const headerPixels = 40;
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.clearAllOfAUsersActivities({ userId: studentUserId });
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Changing paginated pages changes hash, does not add to url history", () => {
- const doenetML1 = `Page 1`;
-
- const doenetML2 = `Page 2`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get("#page1").should("contain.text", "Page 1");
-
- cy.url().should("match", /#page1$/);
-
- cy.get("[data-test=next]").click();
-
- cy.get("#page2").should("contain.text", "Page 2");
-
- cy.url().should("match", /#page2$/);
-
- cy.go("back");
-
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
- });
-
- it("Changing non-paginated pages changes hash, does not add to url history", () => {
- const doenetML1 = `top 1
bottom 1
`;
- const doenetML2 = `top 2
bottom 2
`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100); //TODO: is there a reason we need to wait before clicking paginate?
-
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get(cesc("#page1\\/top")).should("contain.text", "top 1");
- cy.get(cesc("#page2\\/top")).should("contain.text", "top 2");
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bottom")).scrollIntoView();
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page2\\/top")).scrollIntoView();
-
- cy.waitUntil(() => cy.url().should("match", /#page2$/));
-
- cy.get(cesc("#page2\\/bottom")).scrollIntoView();
- cy.url().should("match", /#page2$/);
-
- cy.get(cesc("#page1\\/bottom")).scrollIntoView();
- cy.waitUntil(() => cy.url().should("match", /#page1$/));
-
- cy.go("back");
-
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
- });
-
- it("New attempt starts at page 1, paginated", () => {
- const doenetML1 = `top 1
bottom 1
`;
- const doenetML2 = `top 2
bottom 2
`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/top")).should("contain.text", "top 1");
-
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="next"]').click();
-
- cy.get(cesc("#page2\\/top")).should("contain.text", "top 2");
-
- cy.url().should("match", /#page2$/);
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 1:",
- );
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#page1\\/top")).should("contain.text", "top 1");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 2:",
- );
-
- cy.url().should("match", /#page1$/);
-
- cy.log("did not add to url history");
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
- });
-
- it("New attempt starts at page 1, non-paginated", () => {
- const doenetML1 = `top 1
bottom 1
`;
- const doenetML2 = `top 2
bottom 2
`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/top")).should("contain.text", "top 1");
- cy.get(cesc("#page2\\/top")).should("contain.text", "top 2");
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page2\\/bottom")).scrollIntoView();
-
- cy.waitUntil(() => cy.url().should("match", /#page2$/));
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 1:",
- );
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#page1\\/top")).should("contain.text", "top 1");
- cy.get(cesc("#page2\\/top")).should("contain.text", "top 2");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 2:",
- );
-
- cy.url().should("match", /#page1$/);
-
- cy.log("did not add to url history");
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
- });
-
- it("Two page activity, paginated, with mutual links", () => {
- const doenetML1 = `
-
- [Link to paragraph above aside](pAbove)
- [Link to aside](aside)
- [Link to page 2]
- [Link to paragraph above page 2 aside](pAbove)
- [Link to page 2 aside](aside)
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- [Link to paragraph above aside](pAbove)
- [Link to aside](aside)
- [Link to page 1]
- [Link to paragraph above page 1 aside](pAbove)
- [Link to page 1 aside](aside)
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(200);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.get(cesc("#page1\\/toAbove")).click();
- cy.url().should("match", /#page1\\\/pAbove$/);
-
- cy.get(cesc("#page1\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.wait(1000); // for debounce
-
- cy.reload();
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page1\\\/pAbove$/);
-
- cy.get(cesc("#page1\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#page2\\/toAside1")).click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
-
- cy.url().should("match", /#page1\\\/aside$/);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.wait(1000); // for debounce
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2\\/aside`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
-
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.url().should("match", /#page2\\\/aside$/);
-
- cy.waitUntil(() =>
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- return rect.top > headerPixels - 1 && rect.top < headerPixels + 1;
- }),
- );
-
- cy.get(cesc("#page2\\/asideTitle")).click();
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.get("[data-test=previous]").click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.get(cesc("#page1\\/toAbove2")).click();
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
-
- cy.url().should("match", /#page2\\\/pAbove$/);
-
- cy.waitUntil(() =>
- cy.get(cesc("#page2\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- return rect.top > headerPixels - 1 && rect.top < headerPixels + 1;
- }),
- );
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "false");
-
- cy.wait(2000);
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
-
- cy.get(cesc("#page2\\/b")).should("have.text", "false");
-
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page2\\/toAside")).click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.url().should("match", /#page2\\\/aside$/);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Two page activity, non-paginated, with mutual links", () => {
- const doenetML1 = `
-
- [Link to paragraph above aside](pAbove)
- [Link to aside](aside)
- [Link to page 2]
- [Link to paragraph above page 2 aside](pAbove)
- [Link to page 2 aside](aside)
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- [Link to paragraph above aside](pAbove)
- [Link to aside](aside)
- [Link to page 1]
- [Link to paragraph above page 1 aside](pAbove)
- [Link to page 1 aside](aside)
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("scroll to page 2 to initialize it");
- cy.get(cesc("#page1\\/toPage2")).click();
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.get(cesc("#page2\\/toAbove1")).click();
- cy.url().should("match", /#page1\\\/pAbove$/);
-
- cy.get(cesc("#page1\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.wait(1000); // for debounce
-
- cy.reload();
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page1\\\/pAbove$/);
-
- cy.get(cesc("#page1\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(100);
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
-
- cy.url().should("match", /#page2$/);
-
- cy.get("#page2").then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#page2\\/toAside1")).click();
-
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.url().should("match", /#page1\\\/aside$/);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1000); // for debounce
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2\\/aside`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
-
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.url().should("match", /#page2\\\/aside$/);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page2\\/asideTitle")).click();
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.get("#page1").scrollIntoView();
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.get(cesc("#page1\\/toAbove2")).click();
-
- cy.url().should("match", /#page2\\\/pAbove$/);
-
- cy.get(cesc("#page2\\/pAbove")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "false");
-
- cy.wait(2000);
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
-
- cy.get(cesc("#page2\\/b")).should("have.text", "false");
-
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.waitUntil(() => cy.url().should("match", /#page2$/));
-
- // Note sure why the rect of page2 does not appear to be at the top
- // cy.get('#page2').then(el => {
- // let rect = el[0].getBoundingClientRect();
- // expect(rect.top).gt(headerPixels-1).lt(headerPixels+1)
- // })
-
- cy.get(cesc("#page2\\/toAside")).click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
-
- cy.url().should("match", /#page2\\\/aside$/);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Links to paginated two-page activity", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetMLother = `
-[Link to page 1]
-[Link to page 1 aside](aside)
-[Link to page 2]
-[Link to page 2 aside](aside)
-[Alternative link to page 2]
-[Link to page 2 aside]
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
- cy.createActivity({
- courseId,
- doenetId: doenetId2,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId3,
- doenetML: doenetMLother,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
- // TODO: should not have to wait here. It seems like this a bug
- // Without the wait get into an inconsistent situation where the activity does appear for the student,
- // but when click "View Activity" it says the assignment is not assigned
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("move to page 2 to initialize it");
- cy.get("[data-test=next]").click();
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.signin({ userId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
-
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
- // TODO: should not have to wait here. It seems like this a bug
- // Without the wait get into an inconsistent situation where the activity does appear for the student,
- // but when click "View Activity" it says the assignment is not assigned
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to page 1");
-
- cy.log("click link to page 1, remove target so uses same tab");
- cy.get(cesc("#\\/toPage1")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page1$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toPage2")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to aside from page 1, remove target so uses same tab");
- cy.get(cesc("#\\/toAside1")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page1\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to aside from page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toAside2")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page2\\/aside_title")).click();
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.wait(100);
- cy.log("click link b to page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toPage2b")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link b to aside from page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toAside2b")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Links to non-paginated two-page activity", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetMLother = `
-[Link to page 1]
-[Link to page 1 aside](aside)
-[Link to page 2]
-[Link to page 2 aside](aside)
-[Alternative link to page 2]
-[Link to page 2 aside]
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
- cy.createActivity({
- courseId,
- doenetId: doenetId2,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId3,
- doenetML: doenetMLother,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="Paginate"]').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("scroll to page 2 to initialize it");
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.signin({ userId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to page 1");
-
- cy.wait(100);
-
- cy.log("click link to page 1, remove target so uses same tab");
- cy.get(cesc("#\\/toPage1")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- // cy.url().should('match', /#page1$/) // don't know why this randomly fails
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toPage2")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.wait(100);
- cy.log("click link to aside from page 1, remove target so uses same tab");
- cy.get(cesc("#\\/toAside1")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page1\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.wait(100);
- cy.log("click link to aside from page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toAside2")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#page2\\/aside_title")).click();
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link b to page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toPage2b")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link b to aside from page 2, remove target so uses same tab");
- cy.get(cesc("#\\/toAside2b")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Go directly to URLs of paginated two-page activity", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("go to page 1 url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page1`);
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.url().should("match", /#page1$/);
- cy.url().should("contain", doenetId);
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 2 url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2`);
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 1 aside url");
- cy.wait(100);
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page1\\/aside`);
-
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page1\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 2 aside url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2\\/aside`);
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Go directly to URLs of non-paginated two-page activity", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("scroll to page 2 to initialize it");
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.wait(200);
-
- cy.log("go to page 1 url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page1`);
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- // cy.url().should('match', /#page1$/) // don't know why this randomly fails
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 2 url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2`);
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page1\\/insideAside")).should("not.exist");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 1 aside url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page1\\/aside`);
-
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/insideAside")).should("not.exist");
-
- cy.url().should("match", /#page1\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page1\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to page 2 aside url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#page2\\/aside`);
-
- cy.get(cesc("#page2\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/insideAside")).should(
- "have.text",
- "Content in aside",
- );
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#page2\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#page2\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#page2\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Switching pages scrolls to top", () => {
- const doenetML1 = `
-Page 1
-[To bottom link](pBottom)
-
-
-
-[Go to page 2]
-
-
-`;
-
- const doenetML2 = `
-Page 2
-[To bottom link](pBottom)
-
-
-
-[Go to page 1]
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.log("make sure both pages are rendered");
- cy.get(cesc("#page1\\/_title1")).should("have.text", "Page 1");
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/_title1")).should("have.text", "Page 2");
- cy.url().should("match", /#page2$/);
-
- cy.get(cesc("#page2\\/toBottom")).click();
- cy.url().should("match", /#page2\\\/pBottom$/);
-
- cy.get(cesc("#page2\\/pBottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.log("go to page 1 via bottom button");
- cy.get("[data-test=previous-bottom").click();
-
- cy.get(cesc("#page1\\/_title1")).should("have.text", "Page 1");
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page1\\/toBottom")).click();
- cy.url().should("match", /#page1\\\/pBottom$/);
-
- cy.get(cesc("#page1\\/pBottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.log("go to page 2 via bottom button");
- cy.get("[data-test=next-bottom").click();
-
- cy.get(cesc("#page2\\/_title1")).should("have.text", "Page 2");
- cy.url().should("match", /#page2$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page2\\/toBottom")).click();
- cy.url().should("match", /#page2\\\/pBottom$/);
-
- cy.get(cesc("#page2\\/pBottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.log("go to page 1 via bottom link");
- cy.get(cesc("#page2\\/toPage1")).click();
-
- cy.get(cesc("#page1\\/_title1")).should("have.text", "Page 1");
- cy.url().should("match", /#page1$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#page1\\/toBottom")).click();
- cy.url().should("match", /#page1\\\/pBottom$/);
-
- cy.get(cesc("#page1\\/pBottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.log("go to page 2 via bottom link");
- cy.get(cesc("#page1\\/toPage2")).click();
-
- cy.get(cesc("#page2\\/_title1")).should("have.text", "Page 2");
- cy.url().should("match", /#page2$/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
- });
-
- it("paginated two-page activity remembers page", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("go to page 2");
- cy.get("[data-test=next").click();
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("remembers were last on page 2");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
- cy.get(cesc("#page1\\/_section1_title")).should("not.exist");
-
- cy.url().should("match", /#page2$/);
- cy.url().should("contain", doenetId);
- });
-
- it("non-paginated two-page activity remembers page", () => {
- const doenetML1 = `
-
- Checkbox to make it save state:
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- const doenetML2 = `
-
- Checkbox to make it save state:
-
-
-
- Paragraph above aside
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="Paginate"').click();
- cy.wait(100); //TODO: need the UI to let us know this was successful
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc("#page1\\/bi")).click();
- cy.get(cesc("#page1\\/b")).should("have.text", "true");
-
- cy.log("scroll to page 2 to initialize it");
- cy.get("#page2").scrollIntoView();
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.get(cesc("#page2\\/bi")).click();
- cy.get(cesc("#page2\\/b")).should("have.text", "true");
-
- cy.wait(1500); // for debounce
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("remembers were last on page 2");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#page2\\/_section1_title")).should("have.text", "Section 2");
-
- cy.waitUntil(() => cy.url().should("match", /#page2$/));
-
- cy.url().should("contain", doenetId);
- });
-
- it("Update to new version", () => {
- const doenetML1 = `
-
- What is 1+1? 2
- Current response:
- Credit:
- `;
-
- const doenetML2 = `
-
- What is 2+2? 4
- Current response:
- Credit:
- `;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/ans") + " textarea").type("2{enter}", {
- force: true,
- });
- cy.get(cesc("#page1\\/credit")).should("have.text", "1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "2");
- cy.get(cesc("#page1\\/credit")).should("have.text", "1");
-
- cy.get(cesc("#page1\\/ans") + " textarea").type(
- "{end}{backspace}1{enter}",
- { force: true },
- );
-
- cy.log(
- "At least for now, hitting enter before core is intialized does not submit response",
- );
- cy.get(cesc("#page1\\/cr")).should("contain.text", "1");
- cy.get(cesc("#page1\\/ans") + " textarea").type("{enter}", { force: true });
-
- cy.get(cesc("#page1\\/credit")).should("have.text", "0");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+2? 3
{enter}{ctrl+s}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "1");
- cy.get(cesc("#page1\\/ans2")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f"); //Times out here
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get(cesc("#page1\\/ans2") + " textarea").type("3{enter}", {
- force: true,
- });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get("[data-test=next]").click();
- cy.get(cesc("#page2\\/cr")).should("contain.text", "\uff3f");
-
- cy.get("[data-test=previous]").click();
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
-
- cy.get("[data-test=next]").click();
- cy.get(cesc("#page2\\/cr")).should("contain.text", "\uff3f");
-
- cy.wait(1500); // just making sure nothing gets saved even if wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+3? 4
{enter}{ctrl+s}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("immediately get new version");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get(cesc("#page1\\/ans3") + " textarea").type("4{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "33.3%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "16.7%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/ans") + " textarea").type("4{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "33.3%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "66.7%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page2\\/cr")).should("contain.text", "4");
- cy.get(cesc("#page2\\/credit")).should("have.text", "1");
-
- cy.get(cesc("#page2\\/ans") + " textarea").type(
- "{end}{backspace}1{enter}",
- { force: true },
- );
-
- cy.log(
- "At least for now, hitting enter before core is intialized does not submit response",
- );
- cy.get(cesc("#page2\\/cr")).should("contain.text", "1");
- cy.get(cesc("#page2\\/ans") + " textarea").type("{enter}", { force: true });
-
- cy.get(cesc("#page2\\/credit")).should("have.text", "0");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "33.3%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "66.7%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get('[data-test="folderToggleOpenIcon"]').click();
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 2+3? 5
{enter}{ctrl+s}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page2\\/cr")).should("contain.text", "1");
- cy.get(cesc("#page2\\/ans2")).should("not.exist");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "33.3%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "66.7%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/ans2") + " textarea").type(
- "{end}{backspace}5{enter}",
- { force: true },
- );
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "50%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get("[data-test=next]").click();
- cy.get(cesc("#page2\\/cr")).should("contain.text", "\uff3f");
-
- cy.get("[data-test=previous]").click();
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
-
- cy.get("[data-test=next]").click();
- cy.get(cesc("#page2\\/cr")).should("contain.text", "\uff3f");
-
- cy.wait(1500); // just making sure nothing gets saved even if wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 2+4? 6
{enter}{ctrl+s}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/cr")).should("contain.text", "\uff3f");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/ans3") + " textarea").type(
- "{end}{backspace}6{enter}",
- { force: true },
- );
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "33.3%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "16.7%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "66.7%");
- });
-
- it("Clicking links does not give update version prompt", () => {
- const doenetML = `
-
- Info only
- This activity is just information only, with no interactive content.
- [Go to page 1.]
- [Go to page 2.]
- [Go to page 3.]
-
-
-
-
-`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- pageDoenetId3,
- doenetML1: doenetML,
- doenetML2: doenetML,
- doenetML3: doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/sect_title")).should(
- "have.text",
- "Section 1: Info only",
- );
-
- cy.get(cesc("#page1\\/goPage2")).click();
- cy.get(cesc("#page2\\/sect_title")).should(
- "have.text",
- "Section 2: Info only",
- );
-
- cy.get(cesc("#page2\\/goPage3")).click();
- cy.get(cesc("#page3\\/sect_title")).should(
- "have.text",
- "Section 3: Info only",
- );
-
- cy.get("[data-test=previous]").click();
- cy.get(cesc("#page2\\/sect_title")).should(
- "have.text",
- "Section 2: Info only",
- );
-
- cy.get(cesc("#page2\\/goPage1")).click();
- cy.get(cesc("#page1\\/sect_title")).should(
- "have.text",
- "Section 1: Info only",
- );
-
- cy.wait(2000); // wait for debounce
- cy.get('[data-test="Crumb 2"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}Extra content 1
{enter}",
- );
-
- cy.go("back");
-
- cy.get('[data-test="folderToggleOpenIcon"]').click();
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}Extra content 2
{enter}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(3).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}Extra content 3
{enter}",
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/extra1")).should("have.text", "Extra content 1");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.get(cesc("#page1\\/goPage3")).click();
- cy.get(cesc("#page3\\/extra3")).should("have.text", "Extra content 3");
-
- cy.get(cesc("#page3\\/goPage2")).click();
- cy.get(cesc("#page2\\/extra2")).should("have.text", "Extra content 2");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
- });
-
- it("Increase from one to two page activity, page one info only", () => {
- const doenetML = `
-
-`;
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId1,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/sect_title")).should("have.text", "Info only");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.wait(2000); // wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Add Page"]').click();
- cy.get(".navigationRow")
- .eq(0)
- .get('[data-test="folderToggleOpenIcon"]')
- .click();
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- 'Page 1{enter}x: x
{enter}',
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/sect_title")).should("have.text", "Info only");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
-
- // assignment and attempt percent are still at 100%, but don't insist on it
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/_title1")).should("have.text", "Page 1");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "50%");
-
- cy.get(cesc("#page2\\/ans") + " textarea").type("x{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
- });
-
- it("Change number of pages in activity", () => {
- const doenetML = `
-
- 1: 1
-
-`;
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId1,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
- cy.wait(1500);
-
- cy.get(cesc("#\\/prob_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.log("increase to two pages, no new version prompt");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Add Page"]').click();
- cy.get(".navigationRow")
- .eq(0)
- .get('[data-test="folderToggleOpenIcon"]')
- .click();
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- '{enter}2: 2
{enter}{enter}',
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500); // wait for update
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/prob_title")).should("have.text", "Problem 1");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/prob_title")).should("have.text", "Problem 2");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.wait(2000); // wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.log("decrease to one page, no new version prompt");
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Delete Page"]').click();
-
- cy.get('[data-test="Main Panel"]').click(); //Deselect selection
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500); // wait for update
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/prob_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "0%");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.get(cesc("#\\/ans") + " textarea").type("1{enter}", { force: true });
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.log("Add second page, get new version prompt");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Add Page"]').click();
-
- cy.get(".navigationRow").should("have.length", 3);
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Page"]').click();
-
- cy.get(".cm-content").type(
- '{enter}2: 2
{enter}{enter}',
- );
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500); // wait for update
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/prob_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get("[data-test=next]").should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
-
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#page1\\/prob_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/prob_title")).should("have.text", "Problem 2");
-
- cy.get(cesc("#page2\\/ans") + " textarea").type("2{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.log("Delete second page, get new version prompt");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(2).find(".navigationColumn1").click();
- cy.get('[data-test="Delete Page"]').click();
-
- cy.get('[data-test="Main Panel"]').click(); //Deselect selection
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500); // wait for update
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page2\\/prob_title")).should("have.text", "Problem 2");
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get("[data-test=NewVersionAvailable]").click();
-
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/prob_title")).should("have.text", "Problem 1");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans") + " textarea").type("1{enter}", { force: true });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- // TODO: figure out how to get the gradebook to reload and show the new attempt
- it.skip("Finish button submits and saves state ", () => {
- const doenetML1 = `1: 11`;
- const doenetML2 = `2: 22`;
- const doenetML3 = `3: 33`;
- const doenetML4 = `4: 44`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- pageDoenetId3,
- pageDoenetId4,
- doenetML1,
- doenetML2,
- doenetML3,
- doenetML4,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Show Finish Button"]').click();
-
- cy.get('[data-test="Show Solution"]').click();
-
- cy.get('[data-test="Show Correctness"]').click();
-
- cy.get('[data-test="Show Credit Achieved Menu"]').click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#page1\\/_answer1") + " textarea").type("1", { force: true }); //Times out here
-
- cy.get('[data-test="Item 1 Credit"]').should("not.exist");
- cy.get('[data-test="Item 2 Credit"]').should("not.exist");
- cy.get('[data-test="Item 3 Credit"]').should("not.exist");
- cy.get('[data-test="Item 4 Credit"]').should("not.exist");
- cy.get('[data-test="Assignment Percent"]').should("not.exist");
- cy.get(cesc("#page1\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/_answer1") + " textarea").type("2", { force: true });
- cy.get(cesc("#page2\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page3\\/_answer1") + " textarea").type("3", { force: true });
- cy.get(cesc("#page3\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page4\\/_answer1") + " textarea").type("4", { force: true });
- cy.get(cesc("#page4\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=FinishAssessmentPrompt]").click();
- cy.get("[data-test=CancelFinishAssessment]").click();
- cy.get("[data-test=FinishAssessmentPrompt]").click();
- cy.get("[data-test=ConfirmFinishAssessment]").click();
-
- cy.get("h1").should("contain.text", "finished");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.visit(
- `/course?tool=gradebookStudentAssignment&courseId=${courseId}&userId=${studentUserId}&doenetId=${doenetId}`,
- );
-
- cy.get(cesc(`#page4\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "4",
- );
- cy.get(cesc(`#page4\\/_answer1_correct`)).should("be.visible");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#page4\\/_solution1")).click();
- cy.get(cesc("#page4\\/_solution1")).should("contain.text", "4");
-
- cy.get("[data-test=previous]").click();
-
- cy.get(cesc(`#page3\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "3",
- );
- cy.get(cesc(`#page3\\/_answer1_correct`)).should("be.visible");
-
- cy.get(cesc("#page3\\/_solution1")).click();
- cy.get(cesc("#page3\\/_solution1")).should("contain.text", "3");
-
- cy.get('[data-test="Item 1 Credit"]').click();
-
- cy.get(cesc(`#page1\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "1",
- );
- cy.get(cesc(`#page1\\/_answer1_correct`)).should("be.visible");
-
- cy.get(cesc("#page1\\/_solution1")).click();
- cy.get(cesc("#page1\\/_solution1")).should("contain.text", "1");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc(`#page2\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "2",
- );
- cy.get(cesc(`#page2\\/_answer1_correct`)).should("be.visible");
-
- cy.get(cesc("#page2\\/_solution1")).click();
- cy.get(cesc("#page2\\/_solution1")).should("contain.text", "2");
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc(`#page4\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "4",
- );
- cy.get(cesc(`#page4\\/_answer1_saved`)).should("be.visible");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc(`#page1\\/_answer1`)).should("be.visible");
- cy.get(cesc(`#page1\\/_answer1_submit`)).should("be.visible");
- cy.get(cesc("#page1\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=next]").click();
-
- cy.get(cesc("#page2\\/_answer1") + " textarea").type("2", { force: true });
- cy.get(cesc("#page2\\/_solution1")).should("not.exist");
-
- cy.get("[data-test=FinishAssessmentPrompt]").click();
- cy.get("[data-test=ConfirmFinishAssessment]").click();
-
- cy.get("h1").should("contain.text", "finished");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- // TODO: how do we get the gradebook to reload and show the new attempt?
- cy.reload();
- cy.visit(
- `/course?tool=gradebookStudentAssignment&courseId=${courseId}&userId=${studentUserId}&doenetId=${doenetId}`,
- );
- cy.reload();
- cy.visit(
- `/course?tool=gradebookStudentAssignment&courseId=${courseId}&userId=${studentUserId}&doenetId=${doenetId}`,
- );
-
- cy.get(cesc(`#page2\\/_answer1`) + ` .mq-editable-field`).should(
- "have.text",
- "2",
- );
- cy.get(cesc(`#page2\\/_answer1_correct`)).should("be.visible");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 4 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#page2\\/_solution1")).click();
- cy.get(cesc("#page2\\/_solution1")).should("contain.text", "2");
-
- cy.get("[data-test=next]").click();
- });
-
- it("Change pages with navigateToTarget action and choiceinput", () => {
- const doenetML1 = `
-
-
-
-
-
-
- Page 1
-
-
- Page 1
- Page 2
- Page 3
-
-
-
-
-
- `;
-
- const doenetML2 = `Page 2`;
- const doenetML3 = `Page 3`;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- pageDoenetId3,
- doenetML1,
- doenetML2,
- doenetML3,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get("#page1").should("contain.text", "Page 1");
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc(`#page1\\/moveToPage`)).select("2");
-
- cy.get("#page2").should("contain.text", "Page 2");
-
- cy.url().should("match", /#page2$/);
-
- cy.get("[data-test=previous]").click();
-
- cy.get("#page1").should("contain.text", "Page 1");
-
- cy.url().should("match", /#page1$/);
-
- cy.get(cesc(`#page1\\/moveToPage`)).select("3");
-
- cy.get("#page3").should("contain.text", "Page 3");
-
- cy.url().should("match", /#page3$/);
-
- cy.get("[data-test=previous]").click();
-
- cy.get("#page2").should("contain.text", "Page 2");
-
- cy.url().should("match", /#page2$/);
-
- cy.get("[data-test=previous]").click();
-
- cy.get("#page1").should("contain.text", "Page 1");
-
- cy.url().should("match", /#page1$/);
- });
-
- it("Finish assessment button", () => {
- const doenetML1 = `
- What is 1+1? 2
- What is 1+2? 3
- `;
- const doenetML2 = `
- What is 2+2? 4
- What is 2+3? 5
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- doenetML1,
- doenetML2,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Show Finish Button"]').click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc2("#page1/ans2") + " textarea").type("2", {
- force: true,
- });
-
- cy.get('[data-test="FinishAssessmentPrompt"]').click();
-
- cy.get('[data-test="CancelFinishAssessment"]').click();
- cy.get('[data-test="FinishAssessmentPrompt"]').click();
-
- cy.get('[data-test="ConfirmFinishAssessment"]').click();
-
- // Note: we have two places where credit achieved shows up, so their values are concatenated
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%50%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "25%25%");
- cy.get('[data-test="Final Score"]').should("have.text", "2.52.5");
-
- cy.log("go back to assignment");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}`);
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
-
- cy.log("take second attempt");
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc2("#page1/ans3") + " textarea").type("3", {
- force: true,
- });
-
- cy.get("[data-test=next]").click();
- cy.get(cesc2("#page2/ans4") + " textarea").type("4{enter}", {
- force: true,
- });
-
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "50%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
-
- cy.get(cesc2("#page2/ans5") + " textarea").type("5", {
- force: true,
- });
-
- cy.get('[data-test="FinishAssessmentPrompt"]').click();
- cy.get('[data-test="ConfirmFinishAssessment"]').click();
-
- // Note: we have two places where credit achieved shows up, so their values are concatenated
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%50%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%100%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "75%75%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "75%75%");
- cy.get('[data-test="Final Score"]').should("have.text", "7.57.5");
-
- cy.log("go back to assignment");
-
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}`);
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
-
- cy.log("take third attempt");
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get("[data-test=next]").click();
- cy.get(cesc2("#page2/ans4") + " textarea").type("4{enter}", {
- force: true,
- });
-
- cy.get(cesc2("#page2/ans5") + " textarea").type("5", {
- force: true,
- });
-
- cy.get('[data-test="FinishAssessmentPrompt"]').click();
- cy.get('[data-test="ConfirmFinishAssessment"]').click();
-
- // Note: we have two places where credit achieved shows up, so their values are concatenated
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "100%100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%0%");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "75%75%");
- cy.get('[data-test="Final Score"]').should("have.text", "7.57.5");
- });
-});
diff --git a/client/cypress/e2e/AssignedActivity/singlepageActivities.cy.js b/client/cypress/e2e/AssignedActivity/singlepageActivities.cy.js
deleted file mode 100644
index 11e854c5f4..0000000000
--- a/client/cypress/e2e/AssignedActivity/singlepageActivities.cy.js
+++ /dev/null
@@ -1,2013 +0,0 @@
-import { cesc } from "../../../src/_utils/url";
-
-describe("Single page activity tests", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
-
- const headerPixels = 40;
-
- before(() => {});
-
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId }); //Needed to be removed for parallel
- cy.clearAllOfAUsersActivities({ userId: studentUserId }); //Needed to be removed for parallel
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Repeatedly select same internal link", () => {
- const doenetML = `
-
- [Link to aside](aside)
-
-
-
-
-
-
-
-`;
-
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid1";
- const doenetId = "spa_activity1id";
- const pageDoenetId = "spa_page1id";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /[^#]/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#\\/toAside")).click();
- cy.url().should("match", /#\\\/aside$/);
-
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.get(cesc("#\\/asideTitle")).click();
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#\\/toAside")).scrollIntoView();
-
- cy.get(cesc("#\\/toAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.url().should("match", /#\\\/aside$/);
-
- cy.get(cesc("#\\/toAside")).click();
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.url().should("match", /#\\\/aside$/);
-
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Internal link to content in aside opens it", () => {
- const doenetML = `
-
- [Link inside aside](insideAside)
-
-
-
-
-
-
-
-`;
-
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid2";
- const doenetId = "spa_activity2id";
- const pageDoenetId = "spa_page2id";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /[^#]/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#\\/toInsideAside")).click();
- cy.url().should("match", /#\\\/insideAside$/);
-
- cy.wait(200);
-
- cy.get(cesc("#\\/insideAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.wait(100);
- cy.get(cesc("#\\/asideTitle")).click();
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#\\/toInsideAside")).scrollIntoView();
-
- cy.get(cesc("#\\/toInsideAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.url().should("match", /#\\\/insideAside$/);
-
- cy.get(cesc("#\\/toInsideAside")).click();
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.url().should("match", /#\\\/insideAside$/);
-
- cy.wait(200);
-
- cy.get(cesc("#\\/insideAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it.skip("Navigating back remembers position where clicked internal link", () => {
- const doenetML = `
-
-
-
-[Link to aside](aside)
-
-
-
-
-
-
-
-bottom
-
-
-
-`;
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="View Assigned Activity"]').click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.url().should("match", /[^#]/);
-
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.get(cesc("#\\/toAside")).scrollIntoView();
-
- cy.get(cesc("#\\/toAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#\\/toAside")).click();
- cy.url().should("match", /#\\\/aside$/);
-
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.get(cesc("#\\/bottom")).scrollIntoView();
-
- cy.get(cesc("#\\/bottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- cy.log(rect.top);
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- cy.go("back");
- cy.url().should("match", /[^#]/);
-
- cy.get(cesc("#\\/toAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- cy.log(rect.top);
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Links to activity", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid3";
- const doenetId = "spa_activity3id";
- const pageDoenetId = "spa_page3id";
- const doenetId2 = "spa_activity3idb";
- const pageDoenetId2 = "spa_page3idb";
-
- const doenetML = `
-
- [Link to aside](aside)
-
-
-
-
-
-
-
- `;
-
- const doenetMLother = `
-[Link to top]
-[Link to aside](aside)
-[Link to aside]
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
- cy.createActivity({
- courseId,
- doenetId: doenetId2,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId2,
- doenetML: doenetMLother,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(200);
- // TODO: should not have to wait here. It seems like this a bug
- // Without the wait get into an inconsistent situation where the activity does appear for the student,
- // but when click "View Activity" it says the assignment is not assigned
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
-
- cy.log("click link to top, remove target so uses same tab");
- cy.get(cesc("#\\/toTop")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.url().should("contain", doenetId);
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to aside, remove target so uses same tab");
- cy.get(cesc("#\\/toAside")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to top, remove target so uses same tab");
- cy.get(cesc("#\\/toTop")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.get(cesc("#\\/asideTitle")).click();
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link b to aside, remove target so uses same tab");
- cy.get(cesc("#\\/toAsideb")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
- });
-
- it("Links to activity, inside aside", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid4";
- const doenetId = "spa_activity4id";
- const pageDoenetId = "spa_page4id";
- const doenetId2 = "spa_activity4idb";
- const pageDoenetId2 = "spa_page4idb";
- const doenetML = `
-
- [Link to aside](aside)
-
-
-
-
-
-
-
- `;
-
- const doenetMLother = `
-[Link to top]
-[Link to inside aside](insideAside)
-[Link to inside aside]
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
- cy.createActivity({
- courseId,
- doenetId: doenetId2,
- parentDoenetId: courseId,
- pageDoenetId: pageDoenetId2,
- doenetML: doenetMLother,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.wait(200);
- // TODO: should not have to wait here. It seems like this a bug
- // Without the wait get into an inconsistent situation where the activity does appear for the student,
- // but when click "View Activity" it says the assignment is not assigned
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(1).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
-
- cy.log("click link to top, remove target so uses same tab");
- cy.get(cesc("#\\/toTop")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.url().should("contain", doenetId);
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to inside aside, remove target so uses same tab");
- cy.get(cesc("#\\/toInsideAside")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#\\\/insideAside$/);
- cy.url().should("contain", doenetId);
-
- cy.waitUntil(() =>
- cy.get(cesc("#\\/insideAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- return rect.top > headerPixels - 1 && rect.top < headerPixels + 1;
- }),
- );
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link to top, remove target so uses same tab");
- cy.get(cesc("#\\/toTop")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
-
- cy.get(cesc("#\\/asideTitle")).click();
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Link to top");
- cy.url().should("contain", doenetId2);
-
- cy.log("click link b to inside aside, remove target so uses same tab");
- cy.get(cesc("#\\/toInsideAsideb")).invoke("removeAttr", "target").click();
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#\\\/insideAside$/);
- cy.url().should("contain", doenetId);
-
- cy.waitUntil(() =>
- cy.get(cesc("#\\/insideAside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- return rect.top > headerPixels - 1 && rect.top < headerPixels + 1;
- }),
- );
- });
-
- it("Go directly to URLs of activity", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid5";
- const doenetId = "spa_activity5id";
- const pageDoenetId = "spa_page5id";
- const doenetML = `
-
- [Link to aside](aside)
-
-
-
-
-
-
-
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.log("go to url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}`);
-
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
- cy.get(cesc("#\\/insideAside")).should("not.exist");
-
- cy.url().should("contain", doenetId);
-
- cy.go("back");
- cy.url().should("contain", `course?tool=navigation&courseId=${courseId}`);
-
- cy.log("go to aside url");
- cy.visit(`/course?tool=assignment&doenetId=${doenetId}#\\/aside`);
-
- cy.get(cesc("#\\/insideAside")).should("have.text", "Content in aside");
- cy.get(cesc("#\\/_section1_title")).should("have.text", "Section 1");
- cy.get(cesc("#\\/asideTitle")).should("have.text", "The aside");
-
- cy.url().should("match", /#\\\/aside$/);
- cy.url().should("contain", doenetId);
-
- cy.waitUntil(() =>
- cy.get(cesc("#\\/aside")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- return rect.top > headerPixels - 1 && rect.top < headerPixels + 1;
- }),
- );
- });
-
- it("Update to new version, infinite attempts allowed, separate student signin", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid15";
- const doenetId = "spa_activity15id";
- const pageDoenetId = "spa_page15id";
- const doenetML = `
-
- What is 1+1? 2
- Current response:
- Credit:
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
- cy.wait(2000);
-
- cy.get(cesc("#\\/ans") + " textarea").type("2{enter}", { force: true });
-
- cy.get(cesc("#\\/credit")).should("have.text", "1");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans") + " textarea")
- .type("{end}{backspace}1{enter}", {
- force: true,
- })
- .then((x) => console.log("we typed in the 1"));
-
- cy.log(
- "At least for now, hitting enter before core is intialized does not submit response",
- );
- cy.get(cesc("#\\/cr")).should("contain.text", "1");
- cy.get(cesc("#\\/ans") + " textarea").type("{enter}", { force: true });
-
- cy.get(cesc("#\\/credit")).should("have.text", "0");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- // Have to wait to make sure Core has saved the changes to continue
- // TODO: ideally wouldn't have to wait here
- cy.wait(1000);
-
- cy.signin({ userId });
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+2? 3
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1000);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
- cy.get(cesc("#\\/cr")).should("contain.text", "1");
- cy.get(cesc("#\\/ans2")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans2") + " textarea").type("3{enter}", { force: true });
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.wait(1500); // just making sure nothing gets saved even if wait for debounce
-
- cy.go("back");
-
- cy.signin({ userId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+3? 4
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("immediately get new version");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans3") + " textarea").type("4{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "33.3%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- it("Update to new version, infinite attempts allowed, change roles", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid6";
- const doenetId = "spa_activity6id";
- const pageDoenetId = "spa_page6id";
- const doenetML = `
-
- What is 1+1? 2
- Current response:
- Credit:
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans") + " textarea").type("2{enter}", { force: true });
- cy.get(cesc("#\\/credit")).should("have.text", "1");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans") + " textarea").type("{end}{backspace}1{enter}", {
- force: true,
- });
-
- cy.log(
- "At least for now, hitting enter before core is intialized does not submit response",
- );
- cy.get(cesc("#\\/cr")).should("contain.text", "1");
- cy.get(cesc("#\\/ans") + " textarea").type("{enter}", { force: true });
-
- cy.get(cesc("#\\/credit")).should("have.text", "0");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+2? 3
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "1");
- cy.get(cesc("#\\/ans2")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans2") + " textarea").type("3{enter}", { force: true });
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.wait(1500); // just making sure nothing gets saved even if wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+3? 4
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("immediately get new version");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans3") + " textarea").type("4{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "33.3%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- });
-
- //Note: only runs once - needs work
- it("Update to new version, one attempt allowed", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid8";
- const doenetId = "spa_activity8id";
- const pageDoenetId = "spa_page8id";
- const doenetML = `
-
- What is 1+1? 2
- Current response:
- Credit:
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Attempt Limit Checkbox"]').click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans") + " textarea").type("2{enter}", { force: true });
- cy.get(cesc("#\\/credit")).should("have.text", "1");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+2? 3
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "2");
- cy.get(cesc("#\\/ans2")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
-
- cy.get('[data-test="New Attempt"]').should("not.be.disabled");
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans2") + " textarea").type("3{enter}", { force: true });
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+3? 4
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("get updated new version but do not interact with it");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="New Attempt"]').should("be.disabled");
- cy.get(cesc("#\\/ans2")).should("be.visible");
- cy.get(cesc("#\\/ans3")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- " and the number of available attempts",
- );
-
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/ans3")).should("be.visible");
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+4? 5
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("immediately get new version");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans4") + " textarea").type("5{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+5? 6
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("Can use New Attempt Button to get new content");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans4")).should("be.visible");
- cy.get(cesc("#\\/ans5")).should("not.exist");
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans5") + " textarea").type("6{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "20%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- cy.get('[data-test="New Attempt"]').should("be.disabled");
- });
-
- it("Update to new version, two attempts allowed", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid10";
- const doenetId = "spa_activity10id";
- const pageDoenetId = "spa_page10id";
- const doenetML = `
-
- What is 1+1? 2
- Current response:
- Credit:
- `;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Attempt Limit Checkbox"]').click();
-
- cy.get('[data-test="Attempt Limit"]').type("{end}{backspace}2{enter}");
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans") + " textarea").type("2{enter}", { force: true });
- cy.get(cesc("#\\/credit")).should("have.text", "1");
- cy.get(cesc("#\\/cr")).should("contain.text", "2");
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 1:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get(cesc("#\\/credit")).should("have.text", "0");
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 2:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans") + " textarea").type("2{enter}", { force: true });
-
- cy.get(cesc("#\\/credit")).should("have.text", "1");
- cy.get(cesc("#\\/cr")).should("contain.text", "2");
- cy.get('[data-test="Attempt Percent"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+2? 3
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "2");
- cy.get(cesc("#\\/ans2")).should("not.exist");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 2:",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "contain.text",
- " and the number of available attempts",
- );
-
- cy.get("[data-test=CancelNewVersion]").click();
- cy.get('[data-test="Main Panel"]').should(
- "not.contain.text",
- "new version",
- );
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get('[data-test="Main Panel"]').should("contain.text", "new version");
- cy.get('[data-test="Main Panel"]').should(
- "contain.text",
- " and the number of available attempts",
- );
-
- cy.get('[data-test="New Attempt"]').should("not.be.disabled");
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/cr")).should("contain.text", "\uff3f");
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 3:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans2") + " textarea").type("3{enter}", { force: true });
- cy.get('[data-test="Attempt Percent"]').should("have.text", "50%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 4:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+3? 4
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("immediately get new version and two more attempts");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="New Attempt"]').should("not.be.disabled");
- cy.get(cesc("#\\/ans2")).should("be.visible");
- cy.get(cesc("#\\/ans3")).should("be.visible");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 4:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 5:",
- );
- cy.get('[data-test="New Attempt"]').should("be.disabled");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+4? 5
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("again, immediately get new version and two more attempts");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 5:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans4") + " textarea").type("5{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 6:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans4") + " textarea").type("5{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}What is 1+5? 6
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.log("Can use New Attempt Button to get new content");
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ans4")).should("be.visible");
- cy.get(cesc("#\\/ans5")).should("not.exist");
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 6:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "25%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 7:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans5") + " textarea").type("6{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "20%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get('[data-test="New Attempt"]').click();
-
- cy.get('[data-test="Attempt Container"]').should(
- "contain.text",
- "Attempt 8:",
- );
- cy.get('[data-test="Attempt Percent"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
-
- cy.get(cesc("#\\/ans5") + " textarea").type("6{enter}", { force: true });
-
- cy.get('[data-test="Attempt Percent"]').should("have.text", "20%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "100%");
- cy.get('[data-test="New Attempt"]').should("be.disabled");
- });
-
- it("Clicking links does not give update version prompt", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid11";
- const doenetId = "spa_activity11id";
- const pageDoenetId = "spa_page11id";
- const doenetML = `
-
- Info only
- This activity is just information only, with no interactive content.
- [Go to middle.](middle)
- [Go to bottom.](bottom)
-
-
-
-
- A paragraph in the middle.
- [Go to top.](top)
- [Go to bottom.](bottom)
-
-
-
-
- A paragraph near the bottom.
- [Go to top.](top)
- [Go to middle.](middle)
-
-
-
-
-
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/sect_title")).should("have.text", "Info only");
- cy.get('[data-test="Main Panel"]').then((el) => {
- expect(el.scrollTop()).eq(0);
- });
-
- cy.get(cesc("#\\/goMiddle1")).click();
- cy.url().should("match", /#\\\/middle$/);
-
- cy.get(cesc("#\\/middle")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.get(cesc("#\\/goBottom2")).click();
- cy.url().should("match", /#\\\/bottom$/);
-
- cy.get(cesc("#\\/bottom")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.wait(2000); // wait for debounce
-
- cy.go("back");
-
- cy.get(cesc("#\\/middle")).then((el) => {
- let rect = el[0].getBoundingClientRect();
- expect(rect.top)
- .gt(headerPixels - 1)
- .lt(headerPixels + 1);
- });
-
- cy.go("back");
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}Extra content
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/extra")).should("have.text", "Extra content");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
- });
-
- it("Presence of video does not give update version prompt", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid12";
- const doenetId = "spa_activity12id";
- const pageDoenetId = "spa_page12id";
- const doenetML = `
-A video
-
-State:
-Time:
-Duration:
-
-
-
-
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_title1")).should("have.text", "A video");
- cy.get(cesc("#\\/duration")).should("have.text", "300");
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}More content 1
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/duration")).should("have.text", "300");
- cy.get(cesc("#\\/more1")).should("have.text", "More content 1");
-
- cy.get("[data-test=NewVersionAvailable]").should("not.exist");
-
- cy.get(cesc("#\\/state")).contains("stopped");
- cy.get(cesc("#\\/playAction")).click();
- cy.get(cesc("#\\/time")).contains("1");
- cy.get(cesc("#\\/pauseAction")).click();
-
- cy.wait(1500); // wait for debounce
-
- cy.go("back");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{upArrow}{upArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Edit Activity"]').click();
-
- cy.get(".cm-content").type(
- "{moveToEnd}{enter}More content 2
{enter}{ctrl+s}",
- );
-
- cy.go("back");
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
- cy.get('[data-test="Assign Activity"]').click();
- cy.wait(1500);
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/duration")).should("have.text", "300");
- cy.get(cesc("#\\/more2")).should("not.exist");
-
- cy.get("[data-test=NewVersionAvailable]").click();
- cy.get("[data-test=ConfirmNewVersion]").click();
-
- cy.get(cesc("#\\/more2")).should("have.text", "More content 2");
- });
-
- it("Auto submit answers", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid13";
- const doenetId = "spa_activity13id";
- const pageDoenetId = "spa_page13id";
- const doenetML = `
-Enter x: x
-Enter hello: hello
-Select correct: correctincorrect
-Move point to first quadrant
-
-$P.x >0 and $P.y > 0
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Auto Submit"]').click();
-
- cy.get('[data-test="Attempt Aggregation"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{enter}");
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- cy.get('[data-test="RoleDropDown"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/_p1")).should("have.text", "Enter x: ");
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
-
- cy.get(cesc("#\\/x") + " textarea")
- .type("x", { force: true })
- .blur();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "25%");
-
- cy.get(cesc("#\\/x") + " textarea")
- .type("{end}{backspace}y", { force: true })
- .blur();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
-
- cy.get(cesc("#\\/hello") + " input")
- .type("hello")
- .blur();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "25%");
-
- cy.get(cesc("#\\/correct") + " select")
- .select(1)
- .blur();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
-
- cy.get(cesc("#\\/correct") + " select")
- .select(2)
- .blur();
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "25%");
-
- cy.window().then(async (win) => {
- await win.callAction1({
- actionName: "movePoint",
- componentName: "/P",
- args: { x: 2, y: 3 },
- });
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
-
- cy.window().then(async (win) => {
- await win.callAction1({
- actionName: "movePoint",
- componentName: "/P",
- args: { x: -2, y: 3 },
- });
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "25%");
-
- cy.window().then(async (win) => {
- await win.callAction1({
- actionName: "movePoint",
- componentName: "/P",
- args: { x: 9, y: 1 },
- });
- });
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "50%");
- });
-
- it("reload text answer without blurring or hitting enter", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid14";
- const doenetId = "spa_activity14id";
- const pageDoenetId = "spa_page14id";
- const doenetML = `
- Enter 1:
-
- $ti=hello
-
-
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- // cy.get('[data-test="RoleDropDown"] > div:nth-child(2)').click().type("{downArrow}{downArrow}{enter}")
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ti_input")).type("hello", { force: true });
-
- cy.wait(1500); // wait for debounce
-
- cy.reload();
-
- cy.get(cesc("#\\/ti_submit")).click();
- cy.get(cesc("#\\/ti_correct")).should("be.visible");
- });
-
- it("reload text answer without blurring or hitting enter, clear IndexedDB", () => {
- const studentUserId = "cyStudentUserId";
- const courseId = "spa_courseid16";
- const doenetId = "spa_activity16id";
- const pageDoenetId = "spa_page16id";
- const doenetML = `
- Enter 1:
-
- $ti=hello
-
-
- $ti.value, $ti.immediateValue
-`;
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
-
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- doenetML,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
- cy.wait(100);
-
- // cy.get('[data-test="RoleDropDown"] > div:nth-child(2)').click().type("{downArrow}{downArrow}{enter}")
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- cy.get(cesc("#\\/ti_input")).type("hello", { force: true });
-
- cy.wait(1500); // wait for debounce
-
- cy.clearIndexedDB();
- cy.reload();
-
- cy.get(cesc("#\\/ti_submit")).click();
- cy.get(cesc("#\\/ti_correct")).should("be.visible");
- });
-});
diff --git a/client/cypress/e2e/CourseChooser/duplication.cy.js b/client/cypress/e2e/CourseChooser/duplication.cy.js
deleted file mode 100644
index 1067074a26..0000000000
--- a/client/cypress/e2e/CourseChooser/duplication.cy.js
+++ /dev/null
@@ -1,231 +0,0 @@
-describe("Duplicate Course", function () {
- const userId = "cyuserId";
- const defaultCourseLabel = "Untitled Course";
-
- before(() => {
- cy.signin({ userId });
- cy.visit("/");
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Duplicate a course with assigned content", () => {
- const sourceCourseLabel = "Duplication Test Source";
- const duplicateCourseLabel = "Duplication Test Duplicate";
- const collectionLabel = "CourseDuplication Collection 1";
- const collectionPageLabel1 = "CourseDuplication Page 1";
- const collectionPageLabel2 = "CourseDuplication Page 2";
- const collectionPageLabel3 = "CourseDuplication Page 3";
- const collectionPageLabel4 = "CourseDuplication Page 4";
- const collectionPageLabel5 = "CourseDuplication Page 5";
- const activityLabel = "CourseDuplication Activity";
- const collectionLinkLabel = "CourseDuplication Collection Link";
-
- cy.log("Clean up from the last run");
-
- cy.deleteCourse({ label: sourceCourseLabel });
- cy.deleteCourse({ label: duplicateCourseLabel });
-
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Add Course"]').click();
- cy.get('[data-test="Confirm Add Course"]').click();
- //Assumes it's the left most "Untitled Course" is the one cypress made
- cy.log("Create a new course and label it");
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Course Card"]')
- .contains(defaultCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Settings MenuItem"]')
- .click();
- cy.get("#label").clear().type(sourceCourseLabel).blur();
- cy.get(".chakra-modal__close-btn").click();
-
- cy.log("Enter Course and make a collection");
- //Assumes it's the left most sourceCourseLabel is the one this cypress test made
- cy.get('[data-test="Course Card"]')
- .contains(sourceCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .parent()
- .parent()
- .find('[data-test="Card Image Link"]')
- .click();
-
- cy.get('[data-test="Dashboard Content Card"]').click();
- cy.get('[data-test="Add Collection Button"]').click();
-
- cy.log("Label the collection and two pages");
- cy.get(".navigationRow").eq(0).click();
- cy.get('[data-test="Collection Textfield"]')
- .clear()
- .type(collectionLabel)
- .blur();
- cy.wait(200);
- cy.get('[data-test="Add Page"]').click();
- cy.wait(200);
- cy.get('[data-test="Add Page"]').click();
- cy.wait(200);
- cy.get('[data-test="Add Page"]').click();
- cy.wait(200);
- cy.get('[data-test="Add Page"]').click();
- cy.wait(200);
- cy.get('[data-test="Add Page"]').click();
-
- cy.get('[data-test="folderToggleOpenIcon"]').click();
- cy.wait(200);
- cy.get(".navigationRow").eq(1).click();
- cy.get('[data-test="Label Page"]')
- .clear()
- .type(collectionPageLabel1)
- .blur();
- cy.wait(100);
- cy.get(".navigationRow").eq(2).click();
- cy.get('[data-test="Label Page"]')
- .clear()
- .type(collectionPageLabel2)
- .blur();
- cy.wait(100);
- cy.get(".navigationRow").eq(3).click();
- cy.get('[data-test="Label Page"]')
- .clear()
- .type(collectionPageLabel3)
- .blur();
- cy.wait(100);
- cy.get(".navigationRow").eq(4).click();
- cy.get('[data-test="Label Page"]')
- .clear()
- .type(collectionPageLabel4)
- .blur();
- cy.wait(100);
- cy.get(".navigationRow").eq(5).click();
- cy.get('[data-test="Label Page"]')
- .clear()
- .type(collectionPageLabel5)
- .blur();
- cy.wait(100);
-
- cy.get('[data-test="Main Panel"]').click(); //Deselect
-
- cy.log("add simple content for each page");
- cy.get(".navigationRow").eq(1).dblclick();
- cy.get(".cm-content").type(
- `${collectionPageLabel1}{enter}What is your name?
{enter}`,
- );
- cy.go("back");
- cy.get(".navigationRow").eq(2).dblclick();
- cy.get(".cm-content").type(
- `${collectionPageLabel2}{enter}What is your name?
{enter}`,
- );
- cy.go("back");
- cy.get(".navigationRow").eq(3).dblclick();
- cy.get(".cm-content").type(
- `${collectionPageLabel3}{enter}What is your name?
{enter}`,
- );
- cy.go("back");
- cy.get(".navigationRow").eq(4).dblclick();
- cy.get(".cm-content").type(
- `${collectionPageLabel4}{enter}What is your name?
{enter}`,
- );
- cy.go("back");
- cy.get(".navigationRow").eq(5).dblclick();
- cy.get(".cm-content").type(
- `${collectionPageLabel5}{enter}What is your name?
{enter}`,
- );
- cy.go("back");
-
- cy.log("Create an activity with only a collection link");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").eq(6).click();
- cy.get('[data-test="Label Activity"]').type(
- `{selectAll}{backspace}${activityLabel}{enter}`,
- );
- cy.get('[data-test="Add Collection Link"]').click();
- cy.get(".navigationRow")
- .eq(6)
- .find('[data-test="folderToggleOpenIcon"]')
- .click();
- cy.get(".navigationRow").eq(7).click();
- cy.get('[data-test="Delete Page"]').click();
- cy.get(".navigationRow").eq(7).click();
- cy.get('[data-test="Label Collection"]')
- .clear()
- .type(collectionLinkLabel)
- .blur();
- cy.get('[data-test="Collection Link Selector"]').select(0);
-
- cy.log("Assign the activity");
- cy.get(".navigationRow").eq(6).click();
- cy.get('[data-test="Assign Activity"]').click();
-
- cy.log("duplicate the course and test results");
- cy.get('[data-test="Crumb 0"] ').click();
- cy.get('[data-test="Course Card"]')
- .contains(sourceCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Duplicate MenuItem"]')
- .click();
-
- cy.get('[data-test="Duplicate Course Label Textfield"]')
- .clear()
- .type(duplicateCourseLabel)
- .blur();
- cy.get('[data-test="Duplicate Course Start Date"]')
- .clear()
- .type("2030-12-01");
- cy.get('[data-test="Duplicate Course End Date"]')
- .clear()
- .type("2030-12-01");
- cy.get('[data-test="Duplicate Submit Button"]').click();
- cy.wait(200);
-
- cy.get('[data-test="Course Card"]')
- .contains(duplicateCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .parent()
- .parent()
- .find('[data-test="Card Image Link"]')
- .click();
-
- cy.get('[data-test="Dashboard Content Card"]').click();
- cy.get(".navigationRow")
- .eq(0)
- .find('[data-test="folderToggleOpenIcon"]')
- .click();
- cy.get(".navigationRow")
- .eq(6)
- .find('[data-test="folderToggleOpenIcon"]')
- .click();
- cy.get(".navigationRow")
- .eq(7)
- .find('[data-test="folderToggleOpenIcon"]')
- .click();
-
- cy.get(".navigationRow").eq(0).contains(collectionLabel);
- cy.get(".navigationRow").eq(1).contains(collectionPageLabel1);
- cy.get(".navigationRow").eq(2).contains(collectionPageLabel2);
- cy.get(".navigationRow").eq(3).contains(collectionPageLabel3);
- cy.get(".navigationRow").eq(4).contains(collectionPageLabel4);
- cy.get(".navigationRow").eq(5).contains(collectionPageLabel5);
- cy.get(".navigationRow").eq(6).contains(activityLabel);
- cy.get(".navigationRow").eq(7).contains(collectionLinkLabel);
- cy.get(".navigationRow").eq(8).contains(`Link to ${collectionPageLabel1}`);
- cy.get(".navigationRow").eq(9).contains(`Link to ${collectionPageLabel2}`);
- });
-});
diff --git a/client/cypress/e2e/CourseChooser/menu.cy.js b/client/cypress/e2e/CourseChooser/menu.cy.js
deleted file mode 100644
index 33e1a63a1b..0000000000
--- a/client/cypress/e2e/CourseChooser/menu.cy.js
+++ /dev/null
@@ -1,187 +0,0 @@
-const hexToRgb = (hex) => {
- const r = parseInt(hex.slice(0, 2), 16);
- const g = parseInt(hex.slice(2, 4), 16);
- const b = parseInt(hex.slice(4, 6), 16);
- return `rgb(${r}, ${g}, ${b})`;
-};
-
-describe("Duplicate Course", function () {
- const userId = "cyuserId";
- const defaultCourseLabel = "Untitled Course";
-
- beforeEach(() => {
- cy.signin({ userId });
- cy.visit("/");
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Adding and Renaming a Course", () => {
- const renamedCourseLabel = "Rename a Course Test";
-
- cy.log("Clean up from the last run");
- cy.deleteCourse({ label: renamedCourseLabel });
-
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Add Course"]').click();
- cy.get('[data-test="Confirm Add Course"]').click();
- //Assumes it's the left most "Untitled Course" is the one cypress made
- cy.log("Create a new course and label it");
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Course Card"]')
- .contains(defaultCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Settings MenuItem"]')
- .click();
- cy.get("#label").clear().type(renamedCourseLabel).blur();
- cy.get(".chakra-modal__close-btn").click();
-
- cy.get('[data-test="Course Card"]').contains(renamedCourseLabel);
- });
-
- it("Adding and Delete a Course", () => {
- const deleteMeCourseLabel = "Delete Me Course Test";
-
- cy.log("Clean up from the last run");
- cy.deleteCourse({ label: deleteMeCourseLabel });
-
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Add Course"]').click();
- cy.get('[data-test="Confirm Add Course"]').click();
- //Assumes it's the left most "Untitled Course" is the one cypress made
- cy.log("Create a new course and label it");
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Course Card"]')
- .contains(defaultCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Settings MenuItem"]')
- .click();
- cy.get("#label").clear().type(deleteMeCourseLabel).blur();
- cy.get(".chakra-modal__close-btn").click();
-
- cy.get('[data-test="Course Card"]').contains(deleteMeCourseLabel);
-
- cy.log("Delete the course");
- cy.get('[data-test="Course Card"]')
- .contains(deleteMeCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Delete MenuItem"]')
- .click();
-
- cy.get('[data-test="Course Delete Button"]').click();
- cy.get('[data-test="Course Card"]')
- .contains(deleteMeCourseLabel)
- .should("not.exist");
- });
-
- it("Adding and Change the image of a Course", () => {
- const changeImageCourseLabel = "Change Image Course Test";
- const pictureChoice = "picture5.jpg";
- const colorChoice = "3D5A80";
- const rgbColorChoice = hexToRgb(colorChoice);
-
- cy.log("Clean up from the last run");
- cy.deleteCourse({ label: changeImageCourseLabel });
-
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Add Course"]').click();
- cy.get('[data-test="Confirm Add Course"]').click();
- //Assumes it's the left most "Untitled Course" is the one cypress made
- cy.log("Create a new course and label it");
- cy.get('[data-test="My Courses"]').click();
- cy.get('[data-test="Course Card"]')
- .contains(defaultCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Settings MenuItem"]')
- .click();
-
- cy.get("#label").clear().type(changeImageCourseLabel).blur();
- cy.get('[data-test="Choose Image Trigger"]').click();
- cy.get(`[data-test="Card Image ${pictureChoice}"]`).click();
- cy.get('[data-test="Choose Image Trigger"]').click();
-
- cy.get(".chakra-modal__close-btn").click();
-
- cy.log("Does it have the right image?");
-
- cy.get('[data-test="Course Card"]')
- .contains(changeImageCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .parent()
- .parent()
- .find('[data-test="Card Image Link"]')
- .should("have.attr", "src", `/drive_pictures/${pictureChoice}`);
-
- cy.log("Test Color instead of image");
-
- cy.get('[data-test="Course Card"]')
- .contains(changeImageCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .find('[data-test="Card Menu Button"]')
- .click()
- .parent()
- .find('[data-test="Course Settings MenuItem"]')
- .click();
-
- cy.get('[data-test="Choose Image Trigger"]').click();
- cy.get(`[data-test="Card Color ${colorChoice}"]`).click();
- cy.get('[data-test="Choose Color Trigger"]').click();
-
- cy.get(".chakra-modal__close-btn").click();
-
- cy.get('[data-test="Course Card"]')
- .contains(changeImageCourseLabel)
- .eq(0)
- .parent()
- .parent()
- .parent()
- .parent()
- .find('[data-test="Card Color Link"]')
- .should("have.css", "background-color", rgbColorChoice);
- });
-
- it.skip("Add Course Cancel", () => {
- //Test that course count is the same
- cy.log("Cancel adding a course");
- cy.get('[data-test="My Courses"]').click();
-
- cy.get('[data-test="Course Card"]').then(($cards) => {
- const numCardsBefore = $cards.length;
- cy.log(`${numCardsBefore} courses`);
- cy.get('[data-test="Add Course"]').click();
- cy.get('[data-test="Cancel Add Course"]').click();
- // cy.get('[data-test="Confirm Add Course"]').click();
- // cy.get('[data-test="Course Card"]').should(($cardsAfter) => {
- // expect($cardsAfter.length).to.eq(numCardsBefore);
- // });
- });
- });
-});
diff --git a/client/cypress/e2e/CourseEditor/CourseActivitySettings.cy.js b/client/cypress/e2e/CourseEditor/CourseActivitySettings.cy.js
deleted file mode 100644
index 2897c009df..0000000000
--- a/client/cypress/e2e/CourseEditor/CourseActivitySettings.cy.js
+++ /dev/null
@@ -1,604 +0,0 @@
-describe("Course Editor Tests", function () {
- before(() => {});
-
- beforeEach(() => {});
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- //TODO: not sure how to handle alert when button is pushed
- it.skip("DoenetML Code Copy", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid20";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Add single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get(".cm-content").type("TESTING!");
- cy.get('[data-test="Viewer Update Button"]');
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Copy DoenetML embed link"]').click();
- cy.contains("button", "Copy to clipboard").click();
- // cy.get('[data-test="Alert Title"]').contains("Embed Link Copied to Clipboard");
- // win.navigator.clipboard.readText().then((text) => {
- // console.log("Clipboard content: " + text);
- // // You can add your assertions here
- // });
- });
-
- it("Rename Activity", () => {
- const activity1Label = "Renamed Activity 1";
- const activity1Labelb = "Renamed Activity 1 2nd time";
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid2";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Add single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Editable Activity Label Preview"]').click();
- cy.get('[data-test="Editable Activity Label Input"]')
- .clear()
- .type(activity1Label)
- .blur();
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Activity Label"]').should("have.value", activity1Label);
- cy.get('[data-test="Activity Label"]').clear().type(activity1Labelb).blur();
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Editable Activity Label Preview"]').contains(
- activity1Labelb,
- );
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").last().contains(activity1Labelb);
- });
-
- it("Rename Pages and Activity", () => {
- const activity1Label = "Renamed Mulitpage Activity 1";
- const activity1Labelb = "Renamed Mulitpage Activity 1 2nd time";
- const page1Label = "Renamed Mulitpage page 1";
- const page1Labelb = "Renamed Mulitpage page 1 2nd time";
- const page2Label = "Renamed Mulitpage page 2";
- const page2Labelb = "Renamed Mulitpage page 2 2nd time";
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid3";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Add multipage activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().click();
- cy.get('[data-test="Add Page"]').click();
- cy.get(".navigationRow")
- .last()
- .get('[data-test="folderToggleOpenIcon"]')
- .click();
- cy.log("Upldate labels in the 2nd page's editor");
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Editable Page Label Preview"]').click();
- cy.get('[data-test="Editable Page Label Input"]')
- .clear()
- .type(page2Label)
- .blur();
- cy.get('[data-test="Editable Activity Label Preview"]').click();
- cy.get('[data-test="Editable Activity Label Input"]')
- .clear()
- .type(activity1Label)
- .blur();
- cy.wait(500); //Needed as we don't yet have alerts in the editor tool yet
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Activity Label"]').should("have.value", activity1Label);
- cy.get('[data-test="Activity Label"]').clear().type(activity1Labelb).blur();
- cy.get('[data-test="Alert Title"]').contains("Activity Label Updated");
- cy.get('[data-test="Page Label"]').should("have.value", page2Label);
- cy.get('[data-test="Page Label"]').clear().type(page2Labelb).blur();
- cy.get('[data-test="Alert Title"]').contains("Activity Page Label Updated");
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Editable Activity Label Preview"]').contains(
- activity1Labelb,
- );
- cy.get('[data-test="Editable Page Label Preview"]').contains(page2Labelb);
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").last().contains(page2Labelb);
- cy.get(".navigationRow").eq(-3).contains(activity1Labelb);
- cy.log("Upldate labels in the 1st page's editor");
- cy.get(".navigationRow").eq(-2).dblclick();
- cy.get('[data-test="Editable Activity Label Preview"]').contains(
- activity1Labelb,
- );
- cy.get('[data-test="Editable Page Label Preview"]').should(
- "not.contain",
- page2Labelb,
- );
- cy.get('[data-test="Editable Page Label Preview"]').click();
- cy.get('[data-test="Editable Page Label Input"]')
- .clear()
- .type(page1Label)
- .blur();
- cy.wait(500); //Needed as we don't yet have alerts in the editor tool yet
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Activity Label"]').should(
- "have.value",
- activity1Labelb,
- );
- cy.get('[data-test="Page Label"]').should("have.value", page1Label);
- cy.get('[data-test="Page Label"]').clear().type(page1Labelb).blur();
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Editable Activity Label Preview"]').contains(
- activity1Labelb,
- );
- cy.get('[data-test="Editable Page Label Preview"]').contains(page1Labelb);
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").eq(-1).contains(page2Labelb);
- cy.get(".navigationRow").eq(-2).contains(page1Labelb);
- cy.get(".navigationRow").eq(-3).contains(activity1Labelb);
- });
-
- it("Learning Outcomes", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid3";
- const learningOutcome1 = "learning outcome 1";
- const learningOutcome2 = "learning outcome 2";
- const learningOutcome3 = "learning outcome 3";
- const learningOutcome4 = "learning outcome 4";
- const learningOutcome5 = "learning outcome 5";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Add single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Controls Button"]').click();
- cy.log("Add five learning outcomes and blur or hit enter");
- // cy.get('[data-test="learning outcome 0"]').clear().type(learningOutcome1).blur(); //Blur doesn't trigger event
- cy.get('[data-test="learning outcome 0"]')
- .clear()
- .type(`${learningOutcome1}{enter}`);
- cy.get('[data-test="Alert Title"]').contains(
- "Updated learning outcome #1.",
- );
-
- cy.get('[data-test="add a learning outcome button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Blank learning outcome added.",
- );
- cy.get('[data-test="learning outcome 1"]')
- .clear()
- .type(`${learningOutcome2}{enter}`);
- cy.get('[data-test="Alert Title"]').contains(
- "Updated learning outcome #2.",
- );
-
- cy.get('[data-test="add a learning outcome button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Blank learning outcome added.",
- );
- cy.get('[data-test="learning outcome 2"]')
- .clear()
- .type(`${learningOutcome3}{enter}`);
- cy.get('[data-test="Alert Title"]').contains(
- "Updated learning outcome #3.",
- );
-
- cy.get('[data-test="add a learning outcome button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Blank learning outcome added.",
- );
- cy.get('[data-test="learning outcome 3"]')
- .clear()
- .type(`${learningOutcome4}{enter}`);
- cy.get('[data-test="Alert Title"]').contains(
- "Updated learning outcome #4.",
- );
-
- cy.get('[data-test="add a learning outcome button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Blank learning outcome added.",
- );
- cy.get('[data-test="learning outcome 4"]')
- .clear()
- .type(`${learningOutcome5}{enter}`);
- cy.get('[data-test="Alert Title"]').contains(
- "Updated learning outcome #5.",
- );
-
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="learning outcome 0"]').should(
- "have.value",
- learningOutcome1,
- );
- cy.get('[data-test="learning outcome 1"]').should(
- "have.value",
- learningOutcome2,
- );
- cy.get('[data-test="learning outcome 2"]').should(
- "have.value",
- learningOutcome3,
- );
- cy.get('[data-test="learning outcome 3"]').should(
- "have.value",
- learningOutcome4,
- );
- cy.get('[data-test="learning outcome 4"]').should(
- "have.value",
- learningOutcome5,
- );
-
- cy.get('[data-test="delete learning outcome 0 button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Deleted learning outcome #1.",
- );
- cy.get('[data-test="learning outcome 0"]').should(
- "have.value",
- learningOutcome2,
- );
- cy.get('[data-test="learning outcome 1"]').should(
- "have.value",
- learningOutcome3,
- );
- cy.get('[data-test="learning outcome 2"]').should(
- "have.value",
- learningOutcome4,
- );
- cy.get('[data-test="learning outcome 3"]').should(
- "have.value",
- learningOutcome5,
- );
-
- cy.get('[data-test="delete learning outcome 2 button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Deleted learning outcome #3.",
- );
- cy.get('[data-test="learning outcome 0"]').should(
- "have.value",
- learningOutcome2,
- );
- cy.get('[data-test="learning outcome 1"]').should(
- "have.value",
- learningOutcome3,
- );
- cy.get('[data-test="learning outcome 2"]').should(
- "have.value",
- learningOutcome5,
- );
-
- cy.get('[data-test="delete learning outcome 2 button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Deleted learning outcome #3.",
- );
- cy.get('[data-test="learning outcome 0"]').should(
- "have.value",
- learningOutcome2,
- );
- cy.get('[data-test="learning outcome 1"]').should(
- "have.value",
- learningOutcome3,
- );
-
- cy.get('[data-test="delete learning outcome 1 button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Deleted learning outcome #2.",
- );
- cy.get('[data-test="learning outcome 0"]').should(
- "have.value",
- learningOutcome2,
- );
-
- cy.get('[data-test="delete learning outcome 0 button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Deleted learning outcome #1.",
- );
- cy.get('[data-test="learning outcome 0"]').should("have.value", "");
- });
-
- it("Assignment Assigned and Settings stay", () => {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid4";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Add single page activity");
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Controls Button"]').click();
-
- cy.log("Assign the activity");
- cy.get('[data-test="Presentation Tab"]').click({ force: true });
- cy.get('[data-test="Assign Button"]').eq(0).click();
- cy.get('[data-test="Alert Title"]').contains("Activity is assigned.");
-
- cy.log("Presentation Controls");
- cy.get('[data-test="Individualize"] input').should("not.be.checked");
- cy.get('[data-test="Individualize"]').click();
- cy.get('[data-test="Alert Title"]').contains("Activity individualized.");
- cy.get('[data-test="Individualize"] input').should("be.checked");
-
- cy.get('[data-test="Show Solution"] input').should("be.checked");
- cy.get('[data-test="Show Solution"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Solution will be hidden for users taking activity.",
- );
- cy.get('[data-test="Show Solution"] input').should("not.be.checked");
-
- cy.get('[data-test="Time Limit"] input').eq(0).should("not.be.checked");
- cy.get('[data-test="Time Limit"]').eq(0).click();
- cy.get('[data-test="Alert Title"]').contains(
- "Time limit of 60 minutes for activity.",
- );
- cy.get('[data-test="Time Limit"] input').eq(0).should("be.checked");
- cy.get('[data-test="Time Limit Increment button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Time limited to 65 minutes for activity.",
- );
-
- cy.get('[data-test="Show Feedback"] input').should("be.checked");
- cy.get('[data-test="Show Feedback"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown feedback for activity.",
- );
- cy.get('[data-test="Show Feedback"] input').should("not.be.checked");
-
- cy.get('[data-test="Show Hints"] input').should("be.checked");
- cy.get('[data-test="Show Hints"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown hints for activity.",
- );
- cy.get('[data-test="Show Hints"] input').should("not.be.checked");
-
- cy.get('[data-test="Show Correctness"] input').should("be.checked");
- cy.get('[data-test="Show Correctness"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown correctness for activity.",
- );
- cy.get('[data-test="Show Correctness"] input').should("not.be.checked");
-
- cy.get('[data-test="Show Credit Achieved"] input').should("be.checked");
- cy.get('[data-test="Show Credit Achieved"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown credit achieved for activity.",
- );
- cy.get('[data-test="Show Credit Achieved"] input').should("not.be.checked");
-
- cy.get('[data-test="Paginate"] input').should("be.checked");
- cy.get('[data-test="Paginate"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown pagination for activity.",
- );
- cy.get('[data-test="Paginate"] input').should("not.be.checked");
-
- cy.get('[data-test="Show Finish Button"] input').should("not.be.checked");
- cy.get('[data-test="Show Finish Button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will be shown finish button for activity.",
- );
- cy.get('[data-test="Show Finish Button"] input').should("be.checked");
-
- cy.get('[data-test="AutoSubmit"] input').should("not.be.checked");
- cy.get('[data-test="AutoSubmit"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will automatically submit activity.",
- );
- cy.get('[data-test="AutoSubmit"] input').should("be.checked");
-
- cy.get('[data-test="Can View After Completed"] input').should("be.checked");
- cy.get('[data-test="Can View After Completed"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be allowed viewing after taking activity.",
- );
- cy.get('[data-test="Can View After Completed"] input').should(
- "not.be.checked",
- );
-
- cy.log("Assign Controls");
- cy.get('[data-test="Assign Tab"]').click();
-
- cy.get('[data-test="assign date"]').type("2023-08-29T01:23").blur();
- cy.get('[data-test="Alert Title"]').contains("Assigned date set.");
-
- cy.get('[data-test="due date"]').type("2023-09-01T04:56").blur();
- cy.get('[data-test="Alert Title"]').contains("Due date set.");
-
- cy.get('[data-test="Pin Assignment"] input').should("not.be.checked");
- cy.get('[data-test="Pin Assignment"]').click();
- cy.get('[data-test="Alert Title"]').contains("Activity pinned.");
- cy.get('[data-test="Pin Assignment"] input').should("be.checked");
-
- cy.get('[data-test="Proctor Makes Available"] input').should(
- "not.be.checked",
- );
- cy.get('[data-test="Proctor Makes Available"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Activity only allowed in a proctored exam.",
- );
- cy.get('[data-test="Proctor Makes Available"] input').should("be.checked");
-
- cy.log("Grade Controls");
- cy.get('[data-test="Grade Tab"]').click();
-
- cy.get('[data-test="Total Points NumberInputField"]').should(
- "have.value",
- "10",
- );
- cy.get('[data-test="Total Points Increment button"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Total points or percent set to 15.",
- );
- cy.get('[data-test="Total Points NumberInputField"]').should(
- "have.value",
- "15",
- );
-
- cy.get('[data-test="Grade Category"]').select("exams");
- cy.get('[data-test="Alert Title"]').contains(
- "Grade category set to exams.",
- );
-
- cy.get('[data-test="Number of Attempts Allowed Checkbox"] input').should(
- "not.be.checked",
- );
- cy.get('[data-test="Number of Attempts Allowed Checkbox"]').click();
- cy.get('[data-test="Alert Title"]').contains("1 attempt allowed.");
- cy.get('[data-test="Number of Attempts Allowed Checkbox"] input').should(
- "be.checked",
- );
- cy.get('[data-test="Number of Attempts Increment button"]').click();
- cy.get('[data-test="Alert Title"]').contains("2 attempts allowed.");
-
- cy.get('[data-test="Attempt Aggregation"]').select("Last Attempt");
- cy.get('[data-test="Alert Title"]').contains(
- "Aggregate attempts is based on score of last attempt.",
- );
-
- cy.get('[data-test="Show Solution In Gradebook"] input').should(
- "be.checked",
- );
- cy.get('[data-test="Show Solution In Gradebook"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "User will not be shown solution in gradebook.",
- );
- cy.get('[data-test="Show Solution In Gradebook"] input').should(
- "not.be.checked",
- );
-
- cy.log("General Controls");
- cy.get('[data-test="General Tab"]').click({ force: true });
- cy.get('[data-test="Public Checkbox"] input').should("not.be.checked");
- cy.get('[data-test="Public Checkbox"]').click();
- cy.get('[data-test="Alert Title"]').contains("Activity is public.");
- cy.get('[data-test="Public Checkbox"] input').should("be.checked");
-
- cy.get('[data-test="Show DoenetML Checkbox"] input').should(
- "not.be.checked",
- );
- cy.get('[data-test="Show DoenetML Checkbox"]').click();
- cy.get('[data-test="Alert Title"]').contains(
- "Users can see the source of the activity.",
- );
- cy.get('[data-test="Show DoenetML Checkbox"] input').should("be.checked");
-
- cy.log(
- "Go back to the old code and return to make sure the settings saved and load back",
- );
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").last().dblclick();
- cy.get('[data-test="Controls Button"]').click();
-
- cy.log("Check General Controls");
- cy.get('[data-test="Public Checkbox"] input').should("be.checked");
- cy.get('[data-test="Show DoenetML Checkbox"] input').should("be.checked");
-
- cy.log("Check Presentation Controls");
- cy.get('[data-test="Presentation Tab"]').click({ force: true });
- cy.get('[data-test="Individualize"] input').should("be.checked");
- cy.get('[data-test="Show Solution"] input').should("not.be.checked");
- cy.get('[data-test="Time Limit"] input').eq(0).should("be.checked");
- cy.get('[data-test="Time Limit NumberInputField"]').should(
- "have.value",
- "65",
- );
- cy.get('[data-test="Show Feedback"] input').should("not.be.checked");
- cy.get('[data-test="Show Hints"] input').should("not.be.checked");
- cy.get('[data-test="Show Correctness"] input').should("not.be.checked");
- cy.get('[data-test="Show Credit Achieved"] input').should("not.be.checked");
- cy.get('[data-test="Paginate"] input').should("not.be.checked");
- cy.get('[data-test="Show Finish Button"] input').should("be.checked");
- cy.get('[data-test="AutoSubmit"] input').should("be.checked");
- cy.get('[data-test="Can View After Completed"] input').should(
- "not.be.checked",
- );
-
- cy.log("Check Assign Controls");
- cy.get('[data-test="Assign Tab"]').click({ force: true });
- cy.get('[data-test="Pin Assignment"] input').should("be.checked");
- cy.get('[data-test="Proctor Makes Available"] input').should("be.checked");
-
- cy.log("Check Grade Controls");
- cy.get('[data-test="Grade Tab"]').click({ force: true });
- cy.get('[data-test="Total Points NumberInputField"]').should(
- "have.value",
- "15",
- );
- cy.get('[data-test="Number of Attempts Allowed Checkbox"] input').should(
- "be.checked",
- );
- cy.get('[data-test="Number of Attempts Allowed NumberInputfield"]').should(
- "have.value",
- "2",
- );
- cy.get('[data-test="Show Solution In Gradebook"] input').should(
- "not.be.checked",
- );
- });
-
- it("Collection page", () => {
- const collection1Label = "Renamed Collection 1";
- const page1Label = "Renamed Collection Page 1";
- const page1Labelb = "Renamed Collection Page 1 2nd time";
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- const courseId = "courseid4";
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=navigation&courseId=${courseId}`);
-
- cy.log("Open Editor to a page in the collection");
- cy.get('[data-test="Add Collection Button"]').click();
- cy.get(".navigationRow").last().click();
- cy.get('[data-test="Add Page"]').click();
- cy.wait(500);
- cy.get(".navigationRow")
- .eq(0)
- .find('[data-test="folderToggleOpenIcon"]')
- .click({ force: true });
- cy.get(".navigationRow").eq(1).dblclick();
- cy.get('[data-test="Editable Page Label Preview"]').click();
- cy.get('[data-test="Editable Page Label Input"]')
- .clear()
- .type(page1Label)
- .blur();
- cy.wait(500); //Needed as we don't yet have alerts in the editor tool yet
- cy.get('[data-test="Controls Button"]').click();
- cy.get('[data-test="Page Label"]').should("have.value", page1Label);
- cy.get('[data-test="Page Label"]').clear().type(page1Labelb).blur();
- cy.get('[data-test="Collection Label"]')
- .clear()
- .type(collection1Label)
- .blur();
- cy.get('[data-test="Alert Title"]').contains("Collection Label Updated");
- cy.get('[data-test="Close Settings Button"]').click();
- cy.get('[data-test="Close"]').click();
- cy.get(".navigationRow").last().contains(page1Labelb);
- cy.get(".navigationRow").eq(0).contains(collection1Label);
- });
-});
diff --git a/client/cypress/e2e/Dashboard/classTimesMenu.cy.js b/client/cypress/e2e/Dashboard/classTimesMenu.cy.js
deleted file mode 100644
index 1d924854d0..0000000000
--- a/client/cypress/e2e/Dashboard/classTimesMenu.cy.js
+++ /dev/null
@@ -1,49 +0,0 @@
-describe("Dashboard Classtime Menu tests", function () {
- const userId = "cyuserId";
- const courseId = "courseid1";
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.createCourse({ userId, courseId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- //Just have the database clear this out
- cy.task("queryDb", `DELETE FROM class_times WHERE courseId="${courseId}"`);
- cy.visit(`/course?tool=dashboard&courseId=${courseId}`);
- });
-
- it("Add a default time", () => {
- cy.get('[data-test="ClassTimes Menu"]').click();
- cy.get('[data-test="Add Classtime"]').click();
- cy.get('[data-test="DOTW Dropdown 0"]').contains("Monday");
- //Not sure why these don't work and component is changing anyways
- // cy.get('[data-test="Classtime start time 0"]').contains('9:00 AM');
- // cy.get('[data-test="Classtime end time 0"]').contains('10:00 AM');
- });
-
- it("Add and Delete a class time", () => {
- cy.get('[data-test="ClassTimes Menu"]').click();
- cy.get('[data-test="Add Classtime"]').click();
- cy.get('[data-test="DOTW Dropdown 0"]').should("exist");
- cy.get('[data-test="Classtime Delete Button 0"]').click();
- cy.get('[data-test="DOTW Dropdown 0"]').should("not.exist");
- });
-
- it("stores in the database", () => {
- cy.get('[data-test="ClassTimes Menu"]').click();
- cy.get('[data-test="Add Classtime"]').click();
- cy.get('[data-test="DOTW Dropdown 0"]').should("exist");
- cy.wait(200);
- cy.task(
- "queryDb",
- `SELECT * FROM class_times WHERE courseId="${courseId}"`,
- ).then((result) => {
- expect(result.length).eq(1);
- });
- });
-});
diff --git a/client/cypress/e2e/Gradebook/Gradebook.cy.js b/client/cypress/e2e/Gradebook/Gradebook.cy.js
deleted file mode 100644
index 2840aee256..0000000000
--- a/client/cypress/e2e/Gradebook/Gradebook.cy.js
+++ /dev/null
@@ -1,257 +0,0 @@
-import { cesc2 } from "../../../src/_utils/url";
-
-describe("Gradebook tests", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const doenetId2 = "activity2id";
- const pageDoenetId1 = "_page1id";
- const pageDoenetId2 = "_page2id";
- const pageDoenetId3 = "_page3id";
- const pageDoenetId4 = "_page4id";
- const shuffleDoenetId = "_shuffleId";
-
- const headerPixels = 40;
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
- cy.createCourse({ userId, courseId, studentUserId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.clearAllOfAUsersActivities({ userId: studentUserId });
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Gradebook show correct variant", () => {
- const doenetML1 = `
-
- Option 1
- : $n
- You answered
- `;
- const doenetML2 = `
-
- Option 2
- : $n
- You answered
- `;
- const doenetML3 = `
-
- Option 3
- : $n
- You answered
- `;
-
- cy.createMultipageActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId1,
- pageDoenetId2,
- pageDoenetId3,
- doenetML1,
- doenetML2,
- doenetML3,
- shufflePages: true,
- shuffleDoenetId,
- });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
-
- cy.get('[data-test="Assign Activity"]').click();
- cy.get('[data-test="Unassign Activity"]').should("be.visible");
-
- // update grade category to exams
- cy.get('[data-test="Grade Category"] > div:nth-child(2)')
- .click()
- .type("{downArrow}{downArrow}{enter}");
-
- cy.signin({ userId: studentUserId });
-
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow").eq(0).find(".navigationColumn1").click();
-
- cy.get('[data-test="View Activity"]').click();
-
- let pageOrder = [];
- let ns = [];
-
- cy.get(cesc2("#page1/_title1"))
- .invoke("text")
- .then((text) => {
- pageOrder.push(parseInt(text.slice(7)));
- });
-
- cy.get(cesc2("#page1/n"))
- .invoke("text")
- .then((text) => {
- ns.push(parseInt(text));
- });
-
- cy.get(cesc2("#page1/ans2") + " .mjx-mrow").should(
- "contain.text",
- "\uff3f",
- );
-
- cy.get(cesc2("#page1/ans") + " textarea").type("wrong{enter}", {
- force: true,
- });
-
- cy.get(cesc2("#page1/ans2") + " .mjx-mrow").should("contain.text", "wrong");
-
- cy.get("[data-test=next").click();
-
- cy.get(cesc2("#page2/_title1"))
- .invoke("text")
- .then((text) => {
- pageOrder.push(parseInt(text.slice(7)));
- });
- cy.get(cesc2("#page2/n"))
- .invoke("text")
- .then((text) => {
- ns.push(parseInt(text));
- });
-
- cy.get("[data-test=next").click();
-
- cy.get(cesc2("#page3/_title1"))
- .invoke("text")
- .then((text) => {
- pageOrder.push(parseInt(text.slice(7)));
- console.log("pageOrder", [...pageOrder]);
- });
- cy.get(cesc2("#page3/n"))
- .invoke("text")
- .then((text) => {
- ns.push(parseInt(text));
- console.log("ns", [...ns]);
-
- cy.get(cesc2("#page3/ans2") + " .mjx-mrow").should(
- "contain.text",
- "\uff3f",
- );
-
- cy.get(cesc2("#page3/ans") + " textarea").type(`${text}{enter}`, {
- force: true,
- });
-
- cy.get(cesc2("#page3/ans2") + " .mjx-mrow").should(
- "contain.text",
- text,
- );
- });
-
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "33.3%");
-
- cy.wait(1000);
- cy.get('[data-test="Crumb 2"]').click();
- cy.get(".navigationRow").should("have.length", 1);
-
- cy.visit(
- `/course?tool=gradebookStudentAssignment&courseId=${courseId}&userId=${studentUserId}&doenetId=${doenetId}`,
- ).then(() => {
- // put inside a "then" just so that pageOrder and ns have their new values
-
- cy.get(cesc2("#page3/_title1")).should(
- "have.text",
- `Option ${pageOrder[2]}`,
- );
- cy.get(cesc2("#page3/ans2") + " .mjx-mrow").should(
- "contain.text",
- `${ns[2]}`,
- );
-
- cy.get("[data-test=previous").click();
-
- cy.get(cesc2("#page2/_title1")).should(
- "have.text",
- `Option ${pageOrder[1]}`,
- );
- cy.get(cesc2("#page2/ans2") + " .mjx-mrow").should(
- "contain.text",
- "\uff3f",
- );
-
- cy.get("[data-test=previous").click();
-
- cy.get(cesc2("#page1/_title1")).should(
- "have.text",
- `Option ${pageOrder[0]}`,
- );
- cy.get(cesc2("#page1/ans2") + " .mjx-mrow").should(
- "contain.text",
- "wrong",
- );
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "33.3%");
- });
-
- cy.signin({ userId });
-
- cy.visit(
- `/course?tool=gradebookStudentAssignment&courseId=${courseId}&userId=${studentUserId}&doenetId=${doenetId}`,
- ).then(() => {
- // put inside a "then" just so that pageOrder and ns have their new values
-
- cy.get(cesc2("#page3/_title1")).should(
- "have.text",
- `Option ${pageOrder[2]}`,
- );
- cy.get(cesc2("#page3/ans2") + " .mjx-mrow").should(
- "contain.text",
- `${ns[2]}`,
- );
-
- cy.get("[data-test=previous").click();
-
- cy.get(cesc2("#page2/_title1")).should(
- "have.text",
- `Option ${pageOrder[1]}`,
- );
- cy.get(cesc2("#page2/ans2") + " .mjx-mrow").should(
- "contain.text",
- "\uff3f",
- );
-
- cy.get("[data-test=previous").click();
-
- cy.get(cesc2("#page1/_title1")).should(
- "have.text",
- `Option ${pageOrder[0]}`,
- );
- cy.get(cesc2("#page1/ans2") + " .mjx-mrow").should(
- "contain.text",
- "wrong",
- );
-
- cy.get('[data-test="Item 1 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 2 Credit"]').should("have.text", "0%");
- cy.get('[data-test="Item 3 Credit"]').should("have.text", "100%");
- cy.get('[data-test="Assignment Percent"]').should("have.text", "33.3%");
- });
- });
-});
diff --git a/client/cypress/e2e/Navigation/Activity.cy.js b/client/cypress/e2e/Navigation/Activity.cy.js
deleted file mode 100644
index c1db0adcae..0000000000
--- a/client/cypress/e2e/Navigation/Activity.cy.js
+++ /dev/null
@@ -1,116 +0,0 @@
-describe("Activity test", function () {
- const userId = "cyuserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- // const doenetId1 = "activity1id";
- // const pageDoenetId1 = "_page1id";
- // const doenetId2 = "activity2id";
- // const pageDoenetId2 = "_page2id";
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.createCourse({ userId, courseId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- // cy.createActivity({courseId,doenetId:doenetId1,parentDoenetId:courseId,pageDoenetId:pageDoenetId1});
- // cy.createActivity({courseId,doenetId:doenetId2,parentDoenetId:courseId,pageDoenetId:pageDoenetId2});
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- });
-
- it("Renaming activity", () => {
- const label1 = "Hello";
- const label2 = "First Activity";
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn1")
- .contains("Untitled Activity");
- cy.get(".navigationRow").eq(0).get(".navigationColumn1").click();
- cy.get('[data-test="Label Activity"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label1, { scrollBehavior: false });
- cy.get('[data-test="infoPanelItemLabel"]').click();
- cy.get('[data-test="rowLabel"]').should("contain.text", label1);
- cy.get('[data-test="Label Activity"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label2, { scrollBehavior: false })
- .type("{enter}", { scrollBehavior: false });
- cy.get('[data-test="rowLabel"]').should("contain.text", label2);
- });
-
- it("Renaming section", () => {
- const label1 = "section rename test";
- const label2 = "this section was renamed";
- cy.get('[data-test="Add Section Button"]').click();
- cy.contains(".navigationRow", "Untitled Section").click();
-
- cy.get('[data-test="Label Section"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label1, { scrollBehavior: false });
- cy.get('[data-test="infoPanelItemLabel"]').click();
- cy.get('[data-test="rowLabel"]').should("contain.text", label1);
- cy.get('[data-test="Label Section"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label2, { scrollBehavior: false })
- .type("{enter}", { scrollBehavior: false });
- cy.get('[data-test="rowLabel"]').should("contain.text", label2);
- });
-
- it("Adding sub-sections", () => {
- const label1 = "Adding sub-sections test";
- cy.get('[data-test="Add Section Button"]').click();
- cy.contains(".navigationRow", "Untitled Section").click();
-
- cy.get('[data-test="Label Section"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label1, { scrollBehavior: false });
- cy.get('[data-test="infoPanelItemLabel"]').click();
- cy.get('[data-test="rowLabel"]').should("contain.text", label1);
-
- // click on the section to expand it and show the sub-section
- cy.get('[data-test="folderToggleOpenIcon"]').click();
-
- cy.contains(".navigationRow", label1).click();
- cy.get('[data-test="Add Activity Button"]').click();
- cy.contains(".navigationRow", label1).click();
- // this used to fail when there was an activity in a section
- cy.get('[data-test="Add Section Button"]').click();
-
- cy.contains(".navigationRow", "Untitled Section").click();
- });
-
- it("Adding collection below section", () => {
- const label1 = "Adding collection below sections test";
- cy.get('[data-test="Add Section Button"]').click();
- cy.contains(".navigationRow", "Untitled Section").click();
-
- cy.get('[data-test="Label Section"]', { timeout: 20000 })
- .should("be.visible")
- .clear({ scrollBehavior: false })
- .type(label1, { scrollBehavior: false });
- cy.get('[data-test="infoPanelItemLabel"]').click();
- cy.get('[data-test="rowLabel"]').should("contain.text", label1);
-
- // click on the section to expand it and show the sub-section
- cy.get('[data-test="folderToggleOpenIcon"]').click();
-
- cy.contains(".navigationRow", label1).click();
- cy.get('[data-test="Add Activity Button"]').click();
- cy.contains(".navigationRow", label1).click();
- // this used to fail when there was an activity in a section
- cy.get('[data-test="Add Collection Button"]').click();
-
- cy.contains(".navigationRow", "Untitled Collection").click();
- });
-});
diff --git a/client/cypress/e2e/Navigation/Navigation.cy.js b/client/cypress/e2e/Navigation/Navigation.cy.js
deleted file mode 100644
index f0a3e8b7da..0000000000
--- a/client/cypress/e2e/Navigation/Navigation.cy.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// import {signIn} from '../DoenetSignin/DoenetSignin.cy';
-
-describe("Navigation test", function () {
- const userId = "cyuserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- // const doenetId1 = "activity1id";
- // const pageDoenetId1 = "_page1id";
- // const doenetId2 = "activity2id";
- // const pageDoenetId2 = "_page2id";
-
- before(() => {
- // cy.clearAllOfAUsersActivities({userId})
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.createCourse({ userId, courseId });
- });
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- // cy.createActivity({courseId,doenetId:doenetId1,parentDoenetId:courseId,pageDoenetId:pageDoenetId1});
- // cy.createActivity({courseId,doenetId:doenetId2,parentDoenetId:courseId,pageDoenetId:pageDoenetId2});
- cy.visit(`/course?tool=navigation&courseId=${courseId}`);
- });
-
- Cypress.on("uncaught:exception", (err, runnable) => {
- // returning false here prevents Cypress from
- // failing the test
- return false;
- });
-
- it("Test Add Activity", () => {
- cy.get('[data-test="Add Activity Button"]').click();
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.wait(500);
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn1")
- .contains("Untitled Activity");
- });
-
- it("Test Add Collection", () => {
- cy.get('[data-test="Add Collection Button"]').click();
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn1")
- .contains("Untitled Collection");
- });
-
- it("Test Add Section", () => {
- cy.get('[data-test="Add Section Button"]').click();
-
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the row to appear
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn1")
- .contains("Untitled Section");
- });
-
- it("Test Add a Activity, Collection and Section", () => {
- cy.get('[data-test="Add Activity Button"]').click();
- cy.get(".navigationRow").should("have.length", 1); //Need this to wait for the 1st one to appear
- cy.wait(500);
-
- cy.get('[data-test="Add Collection Button"]').click();
- cy.get(".navigationRow").should("have.length", 2); //Need this to wait for the 2nd one to appear
- cy.wait(500);
-
- cy.get('[data-test="Add Section Button"]').click();
- cy.get(".navigationRow").should("have.length", 3); //Need this to wait for the 3rd one to appear
- cy.wait(500);
-
- cy.get(".navigationRow")
- .eq(0)
- .get(".navigationColumn1")
- .contains("Untitled Activity");
- cy.get(".navigationRow")
- .eq(1)
- .get(".navigationColumn1")
- .contains("Untitled Collection");
- cy.get(".navigationRow")
- .eq(2)
- .get(".navigationColumn1")
- .contains("Untitled Section");
- });
-});
diff --git a/client/cypress/e2e/People/example.cy.js b/client/cypress/e2e/People/example.cy.js
deleted file mode 100644
index 8872e09a3e..0000000000
--- a/client/cypress/e2e/People/example.cy.js
+++ /dev/null
@@ -1,26 +0,0 @@
-describe("Examples", function () {
- const userId = "cyuserId";
- const courseId = "courseid1";
-
- before(() => {
- cy.clearCoursePeople({ courseId });
- cy.createCourse({ userId, courseId });
- });
-
- beforeEach(() => {
- cy.signin({ userId });
- cy.visit(`/`);
- });
-
- it("set can upload", () => {
- // cy.setUserUpload({userId,newValue:'0'})
- cy.setUserUpload({ userId, newValue: "1" });
- });
-
- it("set user's role can canEditContent", () => {
- const roleId = "canEditRoleId";
- cy.createUserRole({ courseId, roleId, label: "can edit role" });
- cy.updateRolePerm({ roleId, permName: "canEditContent", newValue: "1" });
- cy.setUserRole({ userId, courseId, roleId });
- });
-});
diff --git a/client/cypress/e2e/People/people.cy.js b/client/cypress/e2e/People/people.cy.js
deleted file mode 100644
index d0cba4c7d1..0000000000
--- a/client/cypress/e2e/People/people.cy.js
+++ /dev/null
@@ -1,156 +0,0 @@
-describe("People Test", function () {
- const userId = "cyuserId";
- const studentUserId = "cyStudentUserId";
-
- // generate people in cypress/fixtures/peopleExample.csv
- let peopleInCsv = [];
- let updatedPeopleInCsv = [];
- for (let i = 1; i <= 3; i++) {
- peopleInCsv.push({
- // first: i == 2 ? `firstCsv${i}` : "",
- // last: i == 1 || i == 3 ? `lastCsv${i}` : "",
- first: `firstCsv${i}`,
- last: `lastCsv${i}`,
- email: `csvtest${i}@gmail.com`,
- section: `csvSec${i}`,
- externalId: `exIdCsv${i}`,
- });
- //email and external remain constant
- updatedPeopleInCsv.push({
- first: i == 1 || i == 3 ? `updatedFirstCsv${i}` : `firstCsv${i}`,
- last: i == 2 ? `updatedLastCsv${i}` : `lastCsv${i}`,
- email: `csvtest${i}@gmail.com`,
- section: `csvSec${i}`,
- externalId: `exIdCsv${i}`,
- });
- }
-
- it("Add Person Test", () => {
- const courseId = "people_courseid1";
- const personToAdd = {
- first: "firstname",
- last: "lastname",
- email: "test@gmail.com",
- section: "testsect",
- externalId: "testExID",
- roleId: "people_courseid1SId",
- };
-
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=people&courseId=${courseId}`);
-
- cy.get('[data-test="First"]').type(personToAdd.first);
- cy.get('[data-test="Last"]').type(personToAdd.last);
- cy.get('[data-test="Email"]').type(personToAdd.email);
- cy.get('[data-test="Section"]').type(personToAdd.section);
- cy.get('[data-test="External Id"]').type(personToAdd.externalId);
- cy.get('[data-test="Add User"]').click();
- cy.wait(1000);
-
- cy.task(
- "queryDb",
- `SELECT * FROM course_user WHERE externalId="${personToAdd.externalId}"`,
- ).then((res) => {
- expect(res[0].roleId).to.equals(personToAdd.roleId);
- expect(res[0].section).to.equals(personToAdd.section);
- cy.task(
- "queryDb",
- `SELECT * FROM user WHERE userId="${res[0].userId}"`,
- ).then((result) => {
- expect(result[0].firstName).to.equals(personToAdd.first);
- expect(result[0].lastName).to.equals(personToAdd.last);
- expect(result[0].email).to.equals(personToAdd.email);
- });
- });
- });
-
- //TODO why are updated and peopleExample getting mixed?
- it.skip("CSV File Add+Update People Test", () => {
- const courseId = "people_courseid2";
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=people&courseId=${courseId}`);
-
- cy.get('[data-test="LoadPeople Menu"]').click();
- cy.get('[data-test="Import CSV file"]').attachFile("peopleExample.csv");
- cy.get('[data-test="Merge"]').click();
- cy.wait(1000);
-
- peopleInCsv.forEach((person) => {
- cy.task(
- "queryDb",
- `SELECT * FROM course_user WHERE externalId="${person.externalId}"`,
- ).then((res) => {
- expect(res[0].section).to.equals(person.section);
- cy.task(
- "queryDb",
- `SELECT * FROM user WHERE userId="${res[0].userId}"`,
- ).then((result) => {
- expect(result[0].firstName).to.equals(person.first);
- expect(result[0].lastName).to.equals(person.last);
- expect(result[0].email).to.equals(person.email);
- });
- });
- });
-
- cy.get('[data-test="Import CSV file"]').attachFile(
- "updatedPeopleExample.csv",
- );
- cy.get('[data-test="Merge"]').click();
- cy.wait(1000);
-
- updatedPeopleInCsv.forEach((person) => {
- cy.task(
- "queryDb",
- `SELECT * FROM course_user WHERE externalId="${person.externalId}"`,
- ).then((res) => {
- expect(res[0].section).to.equals(person.section);
- cy.task(
- "queryDb",
- `SELECT * FROM user WHERE userId="${res[0].userId}"`,
- ).then((result) => {
- expect(result[0].firstName).to.equals(person.first);
- expect(result[0].lastName).to.equals(person.last);
- expect(result[0].email).to.equals(person.email);
- });
- });
- });
- });
-
- it("Withdraw Enroll Test", () => {
- const courseId = "people_courseid3";
- cy.deleteCourseDBRows({ courseId });
- cy.createCourse({ userId, courseId, studentUserId });
- cy.signin({ userId });
- cy.visit(`course?tool=people&courseId=${courseId}`);
- cy.viewport(1200, 660);
-
- cy.get(`[data-test="Withdraw ${userId}@doenet.org"]`).click();
- cy.get('[data-test="People Table"]').should(
- "not.contain",
- `${userId}@doenet.org`,
- );
- cy.wait(1000);
-
- cy.task(
- "queryDb",
- `SELECT withdrew FROM course_user WHERE userId="${userId}" and courseId="${courseId}"`,
- ).then((res) => {
- expect(res[0].withdrew.data[0]).to.equals(1);
- });
-
- cy.get('[data-test="Show Withdrawn"]').click();
- cy.get('[data-test="Enroll cyuserId@doenet.org"]').click();
- cy.wait(1000);
-
- cy.task(
- "queryDb",
- `SELECT withdrew FROM course_user WHERE userId="cyuserId"`,
- ).then((res) => {
- expect(res[0].withdrew.data[0]).to.equals(0);
- });
- });
-});
diff --git a/client/cypress/e2e/course/courseNavigationOld.cy.js b/client/cypress/e2e/course/courseNavigationOld.cy.js
deleted file mode 100644
index a57ef45e3c..0000000000
--- a/client/cypress/e2e/course/courseNavigationOld.cy.js
+++ /dev/null
@@ -1,115 +0,0 @@
-describe("Course Navigation Tests", function () {
- beforeEach(() => {
- cy.fixture("courseAssignmentsSeed").then((seed) => {
- this.seed = seed;
- cy.request("POST", "api/cypressCleanupAssignments.php", this.seed).then(
- (response) => {
- cy.log(response);
- cy.request("POST", "api/cypressSetupAssignments.php", this.seed).then(
- (response) => {
- cy.log(response);
- cy.visit("/course");
- },
- );
- },
- );
- });
- });
-
- it.skip("overview", function () {
- // click on navbar
- cy.get("[data-test=overviewNavItem]").click();
- // check if selected navbar is prepended with *
- cy.get("[data-test=overviewNavItem]").should("have.text", "* Overview");
- // check url
- cy.url().should("include", "/course/?active=overview");
- // check main section heading
- cy.get("[data-test=sectionTitle]").should("have.text", "Overview");
-
- // check if overview is still selected and rendered after page reloaded
- cy.reload();
- cy.get("[data-test=overviewNavItem]").should("have.text", "* Overview");
- cy.url().should("include", "/course/?active=overview");
- cy.get("[data-test=sectionTitle]").should("have.text", "Overview");
- });
-
- it.skip("syllabus", function () {
- // click on navbar
- cy.get("[data-test=syllabusNavItem]").click();
- // check if selected navbar is prepended with *
- cy.get("[data-test=syllabusNavItem]").should("have.text", "* Syllabus");
- // check url
- cy.url().should("include", "/course/?active=syllabus");
- // check main section heading
- cy.get("[data-test=sectionTitle]").should("have.text", "Syllabus");
-
- // check if syllabus is still selected and rendered after page reloaded
- cy.reload();
- cy.get("[data-test=syllabusNavItem]").should("have.text", "* Syllabus");
- cy.url().should("include", "/course/?active=syllabus");
- cy.get("[data-test=sectionTitle]").should("have.text", "Syllabus");
- });
-
- it.skip("grades", function () {
- // click on navbar
- cy.get("[data-test=gradesNavItem]").click();
- // check if selected navbar is prepended with *
- cy.get("[data-test=gradesNavItem]").should("have.text", "* Grades");
- // check url
- cy.url().should("include", "/course/?active=grades");
- // check main section heading
- cy.get("[data-test=sectionTitle]").should("have.text", "Grades");
-
- // check if syllabus is still selected and rendered after page reloaded
- cy.reload();
- cy.get("[data-test=gradesNavItem]").should("have.text", "* Grades");
- cy.url().should("include", "/course/?active=grades");
- cy.get("[data-test=sectionTitle]").should("have.text", "Grades");
- });
-
- it.skip("assignments onclick", function () {
- // click on navbar
- cy.get("[data-test=assignmentsAccordion]").click();
- cy.get(".homeLeftNav > :nth-child(4)").click();
-
- // check url
- cy.get(".courseLeftNav > :nth-child(8)").click();
- cy.get(
- '[style="text-align: center; background-color: grey;"] > div',
- ).click();
- cy.get(cesc("#\\/_document1_heading")).should("have.text", "Assignment A3");
- cy.url().should(
- "include",
- "/course/?active=assignments&assignmentId=12248",
- );
-
- // check if assignment 3 is still selected and rendered after page reloaded
- cy.reload();
- cy.url().should(
- "include",
- "/course/?active=assignments&assignmentId=12248",
- );
- cy.get(cesc("#\\/_document1_heading")).should("have.text", "Assignment A3");
- });
-
- it.skip("assignments outline type sort order", function () {
- // click on navbar
- cy.get("[data-test=assignmentsAccordion]").click();
- cy.get(".homeLeftNav > :nth-child(4)").click();
- cy.get(
- '[style="text-align: center; background-color: grey;"] > div',
- ).click();
-
- cy.get("select").select("Assignment Date");
- cy.get(".courseLeftNav > :nth-child(3)").should(
- "have.text",
- "Assignment A1",
- );
-
- cy.get("select").select("Due Date");
- cy.get(".courseLeftNav > :nth-child(3)").should(
- "have.text",
- "Assignment A3",
- );
- });
-});
diff --git a/client/cypress/e2e/course/courseTiming.cy.js b/client/cypress/e2e/course/courseTiming.cy.js
deleted file mode 100644
index db07522b13..0000000000
--- a/client/cypress/e2e/course/courseTiming.cy.js
+++ /dev/null
@@ -1,44 +0,0 @@
-describe("Course Timing Tests", function () {
- const userId = "cyuserId";
- // const userId = "devuserId";
- const courseId = "courseid1";
- const doenetId = "activity1id";
- const pageDoenetId = "_page1id";
-
- before(() => {
- cy.signin({ userId });
- cy.clearAllOfAUsersCoursesAndItems({ userId });
- cy.createCourse({ userId, courseId });
- });
-
- beforeEach(() => {
- cy.signin({ userId });
- cy.clearIndexedDB();
- cy.clearAllOfAUsersActivities({ userId });
- cy.createActivity({
- courseId,
- doenetId,
- parentDoenetId: courseId,
- pageDoenetId,
- });
- cy.visit(`/course?tool=dashboard&courseId=${courseId}`);
- cy.get('[data-test="ClassTimes Menu"]').click();
- cy.get(".svg-inline--fa.fa-plus").click();
- });
-
- it.skip("choosing class timing by clicking", () => {
- const correctTime = "1:00 PM";
- cy.get(".rdt").eq(0).click();
- cy.get(".rdtCounter > .rdtBtn").eq(0).click();
- cy.get(".rdtCounter> .rdtBtn").eq(4).click();
- cy.get('[data-test="Main Panel"]').click();
- cy.get(".form-control").eq(0).should("have.value", correctTime);
- });
-
- it.skip("choosing class timing by typing", () => {
- cy.get(".rdt").eq(0).click();
- cy.get(" .form-control").eq(0).type("1:00 PM");
- cy.get('[data-test="Main Panel"]').click();
- cy.get(".form-control").eq(0).should("have.value", "1:00 PM");
- });
-});
diff --git a/client/cypress/e2e/course/headerOld.cy.js b/client/cypress/e2e/course/headerOld.cy.js
deleted file mode 100644
index 1fc01699f1..0000000000
--- a/client/cypress/e2e/course/headerOld.cy.js
+++ /dev/null
@@ -1,88 +0,0 @@
-describe("Page Header Tests", function () {
- beforeEach(() => {
- cy.visit("/course");
- });
-
- it.skip("toolbox button", function () {
- // click on toolbox button
- cy.get("[data-test=toolboxButton]").click();
-
- // check if toolbox modal is visible
- cy.get("[data-test=toolbox]").should("be.visible");
-
- // check if course is selected
- cy.get("[data-test=toolboxNavLinkToCourse]").should(
- "have.class",
- "selectedToolboxNavLink",
- );
-
- // click on toolbox button
- cy.get("[data-test=toolboxButton]").click();
-
- // check if toolbox modal is visible
- cy.get("[data-test=toolbox]").should("not.be.visible");
-
- // click on toolbox button
- cy.get("[data-test=toolboxButton]").click();
-
- // click on anywhere on the screen
- cy.get(".homeActiveSection").click();
-
- // check if toolbox modal is visible
- cy.get("[data-test=toolbox]").should("not.be.visible");
- });
-
- it.skip("toolbox menu links", function () {
- // check if admin link redirects to admin page
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToAdmin").click();
- cy.url().should("include", "/admin");
-
- // check if chooser link redirects to chooser page
- cy.visit("/course");
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToChooser]").click();
- cy.url().should("include", "/chooser");
-
- // check if documentation link redirects to documentation page
- cy.visit("/course");
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToDocumentation]").click();
- cy.url().should("include", "/docs");
-
- // check if editor link redirects to editor page
- cy.visit("/course");
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToEditor]").click();
- cy.url().should("include", "/editor");
- });
-
- it.skip("previous page button", function () {
- // redirect to documentation page
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToDocumentation").click();
- cy.url().should("include", "/docs");
-
- // check if previous page button points back to /course
- cy.get("[data-test=previousPageButton]").click();
- cy.url().should("include", "/course");
-
- // check if previous page button points back to /docs
- cy.get("[data-test=previousPageButton]").click();
- cy.url().should("include", "/docs");
-
- // check if previous page button points back to same page on refresh
- cy.reload();
- cy.get("[data-test=previousPageButton]").click();
- cy.url().should("include", "/course");
-
- // redirect to chooser page
- cy.get("[data-test=toolboxButton]").click();
- cy.get("[data-test=toolboxNavLinkToChooser").click();
- cy.url().should("include", "/chooser");
-
- // check if previous page button points to /course
- cy.get("[data-test=previousPageButton]").click();
- cy.url().should("include", "/course");
- });
-});
diff --git a/client/src/Tools/_framework/Paths/ActivityEditor.tsx b/client/src/Tools/_framework/Paths/ActivityEditor.tsx
index 3ff517003a..36d9032f43 100644
--- a/client/src/Tools/_framework/Paths/ActivityEditor.tsx
+++ b/client/src/Tools/_framework/Paths/ActivityEditor.tsx
@@ -197,7 +197,7 @@ function EditableName({ dataTest }) {
}}
>
-
+