-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
393 additions
and
13 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
...s/e2e/ActivityEditor/activityEditor.cy.ts → ...press/e2e/Activities/activityEditor.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
describe("Activity Viewer Tests", function () { | ||
it("classifications shown in activity viewer", () => { | ||
cy.loginAsTestUser(); | ||
cy.createActivity({ | ||
activityName: "Classifications!", | ||
doenetML: "Hi!", | ||
classifications: [ | ||
{ | ||
systemShortName: "WeBWorK", | ||
category: "Algebra", | ||
subCategory: "Factoring", | ||
code: "Alg.F.2", | ||
}, | ||
{ | ||
systemShortName: "Common Core", | ||
category: "HS", | ||
subCategory: | ||
"Seeing Structure in Expressions. Write expressions in equivalent forms to solve problems.", | ||
code: "A.SSE.3 a.", | ||
}, | ||
], | ||
}).then((activityId) => { | ||
cy.visit(`/activityViewer/${activityId}`); | ||
|
||
cy.get('[data-test="Classifications Footer"]').should( | ||
"contain.text", | ||
"Alg.F.2", | ||
); | ||
cy.get('[data-test="Classifications Footer"]').should( | ||
"contain.text", | ||
"A.SSE.3 a.", | ||
); | ||
cy.get('[data-test="Classifications Footer"]').click(); | ||
|
||
cy.get('[data-test="Classification 1"]').should( | ||
"contain.text", | ||
"A.SSE.3 a.", | ||
); | ||
cy.get('[data-test="Classification 2"]').should( | ||
"contain.text", | ||
"Alg.F.2", | ||
); | ||
|
||
cy.get('[data-test="Close Settings Button"]').click(); | ||
cy.get('[data-test="Classification 1"]').should("not.exist"); | ||
|
||
cy.get('[data-test="Activity Information"]').click(); | ||
|
||
cy.get('[data-test="Classifications"]').click(); | ||
cy.get('[data-test="Classification 1"]').should( | ||
"contain.text", | ||
"A.SSE.3 a.", | ||
); | ||
cy.get('[data-test="Classification 2"]').should( | ||
"contain.text", | ||
"Alg.F.2", | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
describe("Code Viewer Tests", function () { | ||
it("classifications shown in code viewer", () => { | ||
cy.loginAsTestUser(); | ||
cy.createActivity({ | ||
activityName: "Classifications!", | ||
doenetML: "Hi!", | ||
classifications: [ | ||
{ | ||
systemShortName: "WeBWorK", | ||
category: "Algebra", | ||
subCategory: "Factoring", | ||
code: "Alg.F.2", | ||
}, | ||
{ | ||
systemShortName: "Common Core", | ||
category: "HS", | ||
subCategory: | ||
"Seeing Structure in Expressions. Write expressions in equivalent forms to solve problems.", | ||
code: "A.SSE.3 a.", | ||
}, | ||
], | ||
}).then((activityId) => { | ||
cy.visit(`/codeViewer/${activityId}`); | ||
|
||
cy.get('[data-test="Activity Information"]').click(); | ||
|
||
cy.get('[data-test="Classifications"]').click(); | ||
cy.get('[data-test="Classification 1"]').should( | ||
"contain.text", | ||
"A.SSE.3 a.", | ||
); | ||
cy.get('[data-test="Classification 2"]').should( | ||
"contain.text", | ||
"Alg.F.2", | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
describe("Classifications test", function () { | ||
it("cannot select incompatible license after remix, ShareAlike", () => { | ||
let code = Date.now().toString(); | ||
const scrappyEmail = `scrappy${code}@doo`; | ||
const scoobyEmail = `scooby${code}@doo`; | ||
|
||
cy.loginAsTestUser({ | ||
email: scoobyEmail, | ||
firstNames: "Scooby", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.createActivity({ | ||
activityName: "Share alike", | ||
doenetML: "Shared with ShareAlike", | ||
}).then((activityId) => { | ||
cy.visit(`/activityEditor/${activityId}`); | ||
|
||
cy.get('[data-test="Sharing Button"]').click(); | ||
|
||
cy.get('[data-test="Public Checkbox"]').click(); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"shared publicly", | ||
); | ||
|
||
cy.get('[data-test="Select License"]').select( | ||
"Creative Commons Attribution-ShareAlike 4.0", | ||
); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"changed license", | ||
); | ||
|
||
cy.loginAsTestUser({ | ||
email: scrappyEmail, | ||
firstNames: "Scrappy", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.visit(`/activityViewer/${activityId}`); | ||
cy.get('[data-test="Copy to Activities Button"]').click(); | ||
cy.get('[data-test="Go to Activities"]').click(); | ||
|
||
cy.get('[data-test="Card Menu Button"]').eq(0).click(); | ||
cy.get('[data-test="Share Menu Item"]').click(); | ||
|
||
cy.get('[data-test="Cannot Change License"]').should( | ||
"contain.text", | ||
"Creative Commons Attribution-ShareAlike 4.0", | ||
); | ||
cy.get('[data-test="Cannot Change License"]').should( | ||
"contain.text", | ||
"Cannot change license", | ||
); | ||
cy.get('[data-test="Select License"]').should("not.exist"); | ||
}); | ||
}); | ||
|
||
it("cannot select incompatible license after remix, NonCommercial-ShareAlike", () => { | ||
let code = Date.now().toString(); | ||
const scrappyEmail = `scrappy${code}@doo`; | ||
const scoobyEmail = `scooby${code}@doo`; | ||
|
||
cy.loginAsTestUser({ | ||
email: scoobyEmail, | ||
firstNames: "Scooby", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.createActivity({ | ||
activityName: "Non-commercial share alike", | ||
doenetML: "Shared with NonCommercial-ShareAlike", | ||
}).then((activityId) => { | ||
cy.visit(`/activityEditor/${activityId}`); | ||
|
||
cy.get('[data-test="Sharing Button"]').click(); | ||
|
||
cy.get('[data-test="Public Checkbox"]').click(); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"shared publicly", | ||
); | ||
|
||
cy.get('[data-test="Select License"]').select( | ||
"Creative Commons Attribution-NonCommercial-ShareAlike 4.0", | ||
); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"changed license", | ||
); | ||
|
||
cy.loginAsTestUser({ | ||
email: scrappyEmail, | ||
firstNames: "Scrappy", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.visit(`/activityViewer/${activityId}`); | ||
cy.get('[data-test="Copy to Activities Button"]').click(); | ||
cy.get('[data-test="Go to Activities"]').click(); | ||
|
||
cy.get('[data-test="Card Menu Button"]').eq(0).click(); | ||
cy.get('[data-test="Share Menu Item"]').click(); | ||
|
||
cy.get('[data-test="Cannot Change License"]').should( | ||
"contain.text", | ||
"Creative Commons Attribution-NonCommercial-ShareAlike 4.0", | ||
); | ||
cy.get('[data-test="Cannot Change License"]').should( | ||
"contain.text", | ||
"Cannot change license", | ||
); | ||
cy.get('[data-test="Select License"]').should("not.exist"); | ||
}); | ||
}); | ||
|
||
it("can select license after remix, Dual License", () => { | ||
let code = Date.now().toString(); | ||
const scrappyEmail = `scrappy${code}@doo`; | ||
const scoobyEmail = `scooby${code}@doo`; | ||
|
||
cy.loginAsTestUser({ | ||
email: scoobyEmail, | ||
firstNames: "Scooby", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.createActivity({ | ||
activityName: "Dual license", | ||
doenetML: "Shared with Dual License", | ||
}).then((activityId) => { | ||
cy.visit(`/activityEditor/${activityId}`); | ||
|
||
cy.get('[data-test="Sharing Button"]').click(); | ||
|
||
cy.get('[data-test="Public Checkbox"]').click(); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"shared publicly", | ||
); | ||
|
||
cy.get('[data-test="Select License"]').should( | ||
"contain.text", | ||
"Dual license Creative Commons Attribution-ShareAlike 4.0 OR Attribution-NonCommercial-ShareAlike 4.0", | ||
); | ||
|
||
cy.loginAsTestUser({ | ||
email: scrappyEmail, | ||
firstNames: "Scrappy", | ||
lastNames: "Doo", | ||
}); | ||
|
||
cy.visit(`/activityViewer/${activityId}`); | ||
cy.get('[data-test="Copy to Activities Button"]').click(); | ||
cy.get('[data-test="Go to Activities"]').click(); | ||
|
||
cy.get('[data-test="Card Menu Button"]').eq(0).click(); | ||
cy.get('[data-test="Share Menu Item"]').click(); | ||
|
||
cy.get('[data-test="Select License"]').select( | ||
"Creative Commons Attribution-ShareAlike 4.0", | ||
); | ||
cy.get('[data-test="Status message"]').should( | ||
"contain.text", | ||
"changed license", | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.