-
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.
fix student test, and enable sort filter persistence
- both tests were using a demo space for testing - also added a new helper visitQaSubtabsUnit to improve readability
- Loading branch information
Showing
3 changed files
with
110 additions
and
42 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
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(); | ||
} |