Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
a70a0e0
Copy to portfolio not Remix
kevincharles Sep 5, 2023
8035017
New Add Activity
kevincharles Sep 6, 2023
49e8aad
portfolioViewer refactored to publicOverview
kevincharles Sep 6, 2023
ea768f1
More transition changes
kevincharles Sep 7, 2023
25b6200
Embed link
kevincharles Sep 11, 2023
47b7dff
Merge remote-tracking branch 'upstream/main' into pageLink
kevincharles Sep 11, 2023
132341b
trying to fix Cypress tests
kevincharles Sep 13, 2023
25f786b
Merge remote-tracking branch 'upstream/main' into pageLink
kevincharles Sep 13, 2023
6a47a25
removed console log
kevincharles Sep 13, 2023
f75227d
Merge branch 'pageLink' into usability
kevincharles Sep 13, 2023
65388b8
working on overview
kevincharles Sep 13, 2023
59da414
overview start
kevincharles Sep 14, 2023
a1a70f9
latest
kevincharles Sep 18, 2023
72ac41e
Refactor to PortfolioActivity and PublicActivity
kevincharles Sep 19, 2023
c2250f9
Use _ pageId trick
kevincharles Sep 20, 2023
73834ae
Basic layout
kevincharles Sep 20, 2023
69e2b43
layed out header
kevincharles Sep 20, 2023
45ed7d4
More layout
kevincharles Sep 20, 2023
0be08c6
basic mode change
kevincharles Sep 20, 2023
aab4156
double click and hide right
kevincharles Sep 20, 2023
4f35935
Editor Mode without viewer refresh
kevincharles Sep 21, 2023
342b7be
Only can edit draft (not public)
kevincharles Sep 21, 2023
4e498a0
Merge remote-tracking branch 'upstream/main' into usability
kevincharles Sep 22, 2023
03c69c2
Handle save draft
kevincharles Sep 24, 2023
7027e3e
drawer
kevincharles Sep 25, 2023
af97379
remove height
kevincharles Sep 26, 2023
f5db1d0
Try Catch
kevincharles Sep 29, 2023
a2bcb68
small sizes needs work
kevincharles Oct 3, 2023
9a9e0f8
Viewer panel as component
kevincharles Oct 4, 2023
9c63907
EditorPanel and ViewerPanel as components
kevincharles Oct 4, 2023
d85cab7
stacked narrow editor
kevincharles Oct 4, 2023
ef0ef7a
URL edit param for edit mode
kevincharles Oct 4, 2023
a80abf9
Fixed Quirky narrow editor issue
kevincharles Oct 4, 2023
0db31a5
fix margin top of viewer
kevincharles Oct 4, 2023
ac14747
350 editor min width and 850 max viewer width
kevincharles Oct 5, 2023
694fd91
Closer to fixed
kevincharles Oct 5, 2023
6971609
fixed direction bug
kevincharles Oct 6, 2023
e7ebd72
Book Icon
kevincharles Oct 6, 2023
55713b3
Variant has label now
kevincharles Oct 9, 2023
3f1a596
Hover show full label
kevincharles Oct 10, 2023
8b24b6c
narrow mode
kevincharles Oct 10, 2023
4aa7230
Started on alerts
kevincharles Oct 10, 2023
1990cbb
taller viewer
kevincharles Oct 10, 2023
4fed984
narrow alert queue
kevincharles Oct 10, 2023
af392ed
label edge cases and start of publish draft
kevincharles Oct 11, 2023
9b3edf5
publish draft button enable and no select when no public
kevincharles Oct 11, 2023
44110d7
Publish draft works
kevincharles Oct 12, 2023
c68bfe9
breathing space on the sides
kevincharles Oct 12, 2023
2919efb
save space in narrow viewer for alerts
kevincharles Oct 12, 2023
84791e7
fix viewer height
kevincharles Oct 12, 2023
daebe9f
Alerts in Settings drawer
kevincharles Oct 12, 2023
26946ad
Merge remote-tracking branch 'upstream/main' into usability
kevincharles Oct 12, 2023
e164b76
Fixed documentation link
kevincharles Oct 13, 2023
395262a
Tooltip and disabled edit button in public mode
kevincharles Oct 13, 2023
f9c3669
Spinner and disabled until activity is added
kevincharles Oct 13, 2023
d0ad493
activity settings for new activity
kevincharles Oct 13, 2023
3d9a828
logo goes to portfolio
kevincharles Oct 13, 2023
4ecda36
Fixed logo
kevincharles Oct 13, 2023
402550a
Redesigned Sign in
kevincharles Oct 18, 2023
85e6ce5
start entering code
kevincharles Oct 19, 2023
817c7c7
email message and start of JWT as axios
kevincharles Oct 19, 2023
a929c0c
started all cards
kevincharles Oct 20, 2023
7a75b6a
process improvements
kevincharles Oct 20, 2023
6d8ee9e
last in the series
kevincharles Oct 21, 2023
7c15def
Progress on three path design
kevincharles Oct 22, 2023
4fa1e9b
basics of three path method
kevincharles Oct 22, 2023
3a06d31
handle code expired
kevincharles Oct 22, 2023
a7bf410
fixed bugs
kevincharles Oct 23, 2023
8ee7284
Base_Model conversion
kevincharles Oct 24, 2023
a8047f6
Fixed sign out
kevincharles Oct 24, 2023
d48b059
fix backticks
kevincharles Oct 24, 2023
28152a3
tests for signin
kevincharles Oct 25, 2023
baa2f19
cleaned tool root
kevincharles Oct 25, 2023
7589a9b
Removed commented code
kevincharles Oct 25, 2023
834f893
Chakra darkmode signout bug fixed
kevincharles Oct 25, 2023
1b54f33
Fixed measurement of signed out
kevincharles Oct 25, 2023
a9f1950
Merge remote-tracking branch 'upstream/main' into usability
kevincharles Oct 26, 2023
9e0acbf
merge in main and signin
kevincharles Oct 26, 2023
bc2f8e1
Make layer selector a controlled component
kevincharles Oct 26, 2023
e29b49d
save on close editor
kevincharles Oct 26, 2023
b469fad
DND
kevincharles Nov 6, 2023
9ff4dbb
Merge remote-tracking branch 'upstream/main' into usability
kevincharles Nov 7, 2023
550ff99
testing
kevincharles Nov 7, 2023
5d4aada
remove
kevincharles Nov 7, 2023
32c6679
fix publish button
kevincharles Nov 9, 2023
dd1724a
1st cypress test
kevincharles Nov 9, 2023
1202e84
2nd cypress test
kevincharles Nov 9, 2023
d0c3474
One more test
kevincharles Nov 9, 2023
66fd789
fixed make public and errors
kevincharles Nov 10, 2023
640d71d
load save Cypress and fixes
kevincharles Nov 14, 2023
8685157
Cypress Shared Activities and fixes
kevincharles Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 69 additions & 19 deletions cypress/e2e/AsStudent/signIn.cy.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
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", () => {
cy.createCourse({ userId, courseId });
cy.signin({ userId });
cy.clearIndexedDB();
cy.clearAllOfAUsersActivities({ userId });
cy.visit(`/course?tool=people&courseId=${courseId}`);

const emailAddress = "[email protected]";
cy.get('[data-test="First"]').type("Scooby");
cy.get('[data-test="Last"]').type("Doo");
Expand All @@ -42,8 +31,17 @@ describe("Student Sign-In Test", function () {
`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="signinCodeInput"]').type(code);
cy.get('[data-test="code-input-0"]').type(code.charAt(0));
cy.get('[data-test="code-input-1"]').type(code.charAt(1));
cy.get('[data-test="code-input-2"]').type(code.charAt(2));
cy.get('[data-test="code-input-3"]').type(code.charAt(3));
cy.get('[data-test="code-input-4"]').type(code.charAt(4));
cy.get('[data-test="code-input-5"]').type(code.charAt(5));
cy.get('[data-test="code-input-6"]').type(code.charAt(6));
cy.get('[data-test="code-input-7"]').type(code.charAt(7));
cy.get('[data-test="code-input-8"]').type(code.charAt(8));
cy.get('[data-test="submitCodeButton"]').click();
cy.get('[data-test="My Courses"]').click();
cy.get('[data-test="Course Label"]').should(
"have.text",
Expand All @@ -53,4 +51,56 @@ describe("Student Sign-In Test", function () {
cy.document().should("contain.text", "Welcome");
});
});

it("Signed out to in to out with all entry errors", () => {
const emailAddress = "[email protected]";
const firstName = "Scrapy";
const lastName = "Doo";
//Delete entry so we will need to enter the name
cy.task(
"queryDb",
`DELETE FROM user WHERE email='${emailAddress}'`,
).then(() => {
cy.visit(`/`);
cy.get('[data-test="Nav to signin"]').click();
cy.get('[data-test="email input"]').type(emailAddress);
cy.get('[data-test="sendEmailButton"]').click();
cy.wait(500); //Wait for it to be stored in db
cy.task(
"queryDb",
`SELECT signInCode FROM user_device ORDER BY id DESC LIMIT 1`,
).then((result) => {
const code = result[0].signInCode;
//Try no code
cy.get('[data-test="submitCodeButton"]').click();
cy.get('[data-test="code-err"]').should('contain', "Please enter the nine digits sent to your email.");
//Try only one number
cy.get('[data-test="code-input-0"]').type(code.charAt(0));
cy.get('[data-test="submitCodeButton"]').click();
cy.get('[data-test="code-err"]').should('contain', "Please enter all nine digits.");

cy.get('[data-test="code-input-0"]').type(code.charAt(0));
cy.get('[data-test="code-input-1"]').type(code.charAt(1));
cy.get('[data-test="code-input-2"]').type(code.charAt(2));
cy.get('[data-test="code-input-3"]').type(code.charAt(3));
cy.get('[data-test="code-input-4"]').type(code.charAt(4));
cy.get('[data-test="code-input-5"]').type(code.charAt(5));
cy.get('[data-test="code-input-6"]').type(code.charAt(6));
cy.get('[data-test="code-input-7"]').type(code.charAt(7));
cy.get('[data-test="code-input-8"]').type(code.charAt(8));
cy.get('[data-test="submitCodeButton"]').click();
//Try no names
cy.get('[data-test="submitName"]').click();
cy.get('[data-test="firstNameError"]').should('contain', 'Please enter your first name.')
cy.get('[data-test="lastNameError"]').should('contain', 'Please enter your last name.')

cy.get('[data-test="firstNameInput"]').type(firstName);
cy.get('[data-test="lastNameInput"]').type(lastName);
cy.get('[data-test="submitName"]').click();
cy.get('[data-test="AvatarMenuButton"]').click();
cy.get('[data-test="AvatarMenuSignOut"]').click();
cy.get('[data-test="homepage button"]').click();
});
});
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/DoenetML/tagSpecific/ref.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("ref Tag Tests", function () {
cy.get(cesc("#\\/_ref1"))
.should("have.text", "a Doenet doc")
.invoke("attr", "href")
.then((href) => expect(href).eq("/portfolioviewer/abcdefg"));
.then((href) => expect(href).eq("/publicOverview/abcdefg"));
});

it("url with no link text", () => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/People/people.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe("People Test", function () {
cy.wait(1000);

peopleInCsv.forEach((person) => {
console.log("person", person)
cy.task(
"queryDb",
`SELECT * FROM course_user WHERE externalId="${person.externalId}"`,
Expand All @@ -89,6 +90,7 @@ describe("People Test", function () {
"queryDb",
`SELECT * FROM user WHERE userId="${res[0].userId}"`,
).then((result) => {
console.log("result", 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);
Expand Down
66 changes: 47 additions & 19 deletions cypress/e2e/Portfolio/ActivityControls.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,21 @@ describe("Activity Controls Tests", function () {
return false;
});

it("Update Label of an Activity both ways", () => {
it("Update Label of an Activity twice", () => {
const label1 = "Scooby Doo";
const label2 = "Duck Tails";
cy.get('[data-test="Portfolio"]').click();
cy.get('[data-test="Add Activity"]').click();
cy.get('[data-test="Controls Button"]').click();
cy.get('[data-test="Activity Label"]').clear().type(label1);
cy.get('[data-test="Close Settings Button"]').click();
cy.get('[data-test="Activity Label Editable"]').contains(label1);
// cy.get('[data-test="Close Settings Button"]').click(); //Why does this not work?
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Label"]').eq(0).contains(label1);

cy.get(
'[data-test="Activity Label Editable"] [data-test="Editable Preview"]',
).click();
cy.get('[data-test="Activity Label Editable"] [data-test="Editable Input"]')
.type(label2)
.blur();
cy.wait(1000); //Need the interface to be faster to not have this
cy.get('[data-test="Controls Button"]').click();
cy.get('[data-test="Activity Label"]').should("have.value", label2);
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Settings Menu Item"]').click();
cy.get('[data-test="Activity Label"]').clear().type(label2);
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Label"]').eq(0).contains(label2);
});

it("Learning Outcomes", () => {
Expand All @@ -48,9 +44,9 @@ describe("Activity Controls Tests", function () {
const learningOutcome3 = "Five, six, pick up sticks";
const learningOutcome4 = "Seven, eight, lay them straight";
const learningOutcome5 = "Nine, ten, a big fat hen";
const learningOutcome6 = "The End";
cy.get('[data-test="Portfolio"]').click();
cy.get('[data-test="Add Activity"]').click();
cy.get('[data-test="Controls Button"]').click();
cy.get('[data-test="add a learning outcome button"]').click();
cy.get('[data-test="add a learning outcome button"]').click();
cy.get('[data-test="add a learning outcome button"]').click();
Expand All @@ -61,12 +57,11 @@ describe("Activity Controls Tests", function () {
cy.get('[data-test="learning outcome 2"]').type(learningOutcome3);
cy.get('[data-test="learning outcome 3"]').type(learningOutcome4);
cy.get('[data-test="learning outcome 4"]').type(learningOutcome5);
// cy.get('[data-test="add a learning outcome button"]').click();

cy.get('[data-test="Close Settings Button"]').click();
cy.wait(3000);
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Settings Menu Item"]').click();

cy.get('[data-test="Controls Button"]').click();
//Check the text.
cy.get('[data-test="learning outcome 0"]').should(
"have.value",
Expand All @@ -89,7 +84,40 @@ describe("Activity Controls Tests", function () {
learningOutcome5,
);

//Delete some
//Delete the first two
cy.get('[data-test="delete learning outcome 0 button"]').click();
cy.get('[data-test="delete learning outcome 0 button"]').click();
cy.get('[data-test="learning outcome 0"]').should(
"have.value",
learningOutcome3,
);
cy.get('[data-test="learning outcome 1"]').should(
"have.value",
learningOutcome4,
);
cy.get('[data-test="learning outcome 2"]').should(
"have.value",
learningOutcome5,
);
//Add another
cy.get('[data-test="add a learning outcome button"]').click();
cy.get('[data-test="learning outcome 3"]').type(learningOutcome6);

cy.get('[data-test="learning outcome 0"]').should(
"have.value",
learningOutcome3,
);
cy.get('[data-test="learning outcome 1"]').should(
"have.value",
learningOutcome4,
);
cy.get('[data-test="learning outcome 2"]').should(
"have.value",
learningOutcome5,
);
cy.get('[data-test="learning outcome 3"]').should(
"have.value",
learningOutcome6,
);
});
});
21 changes: 12 additions & 9 deletions cypress/e2e/Portfolio/ErrorsAndWarnings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("Porfolio Errors and Warnings ", function () {
const userId2 = "cyuserId2";

before(() => {
// cy.clearAllOfAUsersActivities({userId})
cy.clearAllOfAUsersActivities({ userId })
});
beforeEach(() => {
cy.signin({ userId });
Expand All @@ -26,13 +26,12 @@ describe("Porfolio Errors and Warnings ", function () {

cy.log("Create an activity");
cy.get('[data-test="Add Activity"]').click();
cy.get('[data-test="Activity Label"]').clear().type(label);
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Edit Menu Item"]').eq(0).click();

cy.get(
'[data-test="Activity Label Editable"] [data-test="Editable Preview"]',
).click();
cy.get('[data-test="Activity Label Editable"] [data-test="Editable Input"]')
.type(label)
.blur();
cy.get('[data-test="Activity Label Editable Preview"]').contains(label)

cy.get(".cm-content").type(`<p name="goodp">A good paragraph</p>{enter}`);

Expand Down Expand Up @@ -78,8 +77,10 @@ describe("Porfolio Errors and Warnings ", function () {
"contain.text",
"ErrorLine #3 Invalid component type: <invalid>",
);
cy.get('[data-test="Error Button"]').click();

cy.get(".cm-content").type(`{ctrl+end}{leftarrow}{backspace}`); //Delete the / in invalid

cy.get(".cm-content").type(`{ctrl+end}{leftarrow}{leftarrow}{backspace}`);
cy.get('[data-test="Viewer Update Button"]').click();

cy.get(cesc2("#/__error1")).should(
Expand Down Expand Up @@ -120,7 +121,9 @@ describe("Porfolio Errors and Warnings ", function () {
cy.get('[data-test="Warning Button"]').click();
cy.get('[data-test="Warning Content"]').should(
"contain.text",
"WarningLine #5 Attribute ninputs is deprecated. Use numInputs instead. Its use will become an error in the next major version (0.7). Version 0.6 will be phased out in summer 2024.",
"WarningLine #4 Attribute ninputs is deprecated. Use numInputs instead. Its use will become an error in the next major version (0.7). Version 0.6 will be phased out in summer 2024.",
);
cy.get('[data-test="Warning Button"]').click();

});
});
46 changes: 32 additions & 14 deletions cypress/e2e/Portfolio/LoadAndSaveEditor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,50 @@ describe("Load and Save Editor", function () {
const largeNumber = `12345678901234567890123456789012345678901234567890123456789012345678901234567890`;
cy.get('[data-test="Portfolio"]').click();
cy.get('[data-test="Add Activity"]').click();
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Edit Menu Item"]').eq(0).click();

cy.get(".cm-content").type(largeNumber);
cy.get('[data-test="Viewer Update Button"]').click();
cy.get(cesc2("#/_document1")).should("contains.text", largeNumber);

//Leave and come back
cy.get('[data-test="Logo Button"]').click();
cy.get('[data-test="Portfolio"]').click();
cy.get('[data-test="Private Activities"] [data-test="Card Image Link"] ')
.eq(0)
.click();
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Edit Menu Item"]').eq(0).click();
cy.get(cesc2("#/_document1")).should("contains.text", largeNumber);
// cy.get(cesc2(".cm-content")).should("have.text", largeNumber);
});

it("Quickly Save", () => {
it("Quickly Save and Refresh Save", () => {
const doenetML1 = "Draft content";
const doenetML2 = "More Draft content";
//Set it up
cy.get('[data-test="Portfolio"]').click();
cy.get('[data-test="Add Activity"]').click();
cy.get('.chakra-modal__close-btn').click();
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Edit Menu Item"]').eq(0).click();
cy.get(".cm-content").type(
`{ctrl+end}{rightarrow}{rightarrow}{rightarrow}{rightarrow}{rightarrow}<p name="draft">Draft content</p>`,
`{ctrl+end}{rightarrow}{rightarrow}{rightarrow}{rightarrow}{rightarrow}<p name="draft">${doenetML1}</p>`,
);

// cy.get('[data-test="Viewer Update Button"]').click();
// cy.get(cesc2("#/draft")).should("have.text", "Draft content");
//Leave
cy.get('[data-test="Logo Button"]').click();

//Go Back
cy.get('[data-test="Private Activities"] [data-test="Card Menu Button"]').eq(0).click();
cy.get('[data-test="Edit Menu Item"]').eq(0).click();

cy.get(cesc2("#/draft")).should("have.text", doenetML1);

//Enter more and hit refresh
cy.get(".cm-content").clear().type(
`{ctrl+end}{rightarrow}{rightarrow}{rightarrow}{rightarrow}{rightarrow}<p name="draft">${doenetML2}</p>`,
);
cy.reload();
cy.get(cesc2("#/draft")).should("have.text", doenetML2);

cy.get('[data-test="Portfolio"]').click();
cy.wait(500);
cy.get('[data-test="Private Activities"] [data-test="Card Image Link"] ')
.eq(0)
.click();
cy.get(cesc2("#/draft")).should("have.text", "Draft content");
});
});
Loading