-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2412 from concord-consortium/188315060-fix-teache…
…r-share-test Fix Cypress tests around sorted documents
- Loading branch information
Showing
6 changed files
with
121 additions
and
44 deletions.
There are no files selected for viewing
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
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,27 @@ | ||
/** | ||
* Visit qaConfigSubtabsUnit as a teacher or student. | ||
* If visiting as a student you can also specify the group the student should be in. | ||
* After visiting the unit, it will wait for CLUE to load. | ||
* | ||
* @param {*} params {student?: id, teacher?: id, group?: id} | ||
*/ | ||
export function visitQaSubtabsUnit(params) { | ||
const teacherQueryParams = `${Cypress.config("qaConfigSubtabsUnitTeacher1")}`; | ||
const studentQueryParams = `${Cypress.config("qaConfigSubtabsUnitStudent5")}`; | ||
let queryParams; | ||
if ("student" in params) { | ||
queryParams = studentQueryParams.replace("student:5", `student:${params.student}`); | ||
if ("group" in params) { | ||
queryParams = queryParams.replace("qaGroup=5", `qaGroup=${params.group}`); | ||
} | ||
} else if ("teacher" in params) { | ||
if ("group" in params) { | ||
throw new Error(`teachers aren't in groups: ${params.group}`); | ||
} | ||
queryParams = teacherQueryParams.replace("teacher:1", `teacher:${params.teacher}`); | ||
} else { | ||
throw new Error(`unknown params ${JSON.stringify(params)}`); | ||
} | ||
cy.visit(queryParams); | ||
cy.waitForLoad(); | ||
} |
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