Skip to content

Commit

Permalink
BC-6351 added toggle switch
Browse files Browse the repository at this point in the history
  • Loading branch information
csp175 committed Jan 29, 2024
1 parent 4bfa389 commit 982386d
Showing 1 changed file with 39 additions and 11 deletions.
50 changes: 39 additions & 11 deletions cypress/support/pages/admin/pageAdministration.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Management {
static #teamAdministrationNavigationButton = '[data-testid="Teams"]'
static #schoolAdministrationNavigationButton = '[data-testid="Schule"]'
static #studentTeamCheckbox = '[data-testid="student_team_checkbox"]'
static #videoConferenceToggle = '[data-testid="toggle_video_conference"]'
static #learningStoreStudentAccessToggle = '[data-testid="admin-school-toggle-learning-store"]'
static #videoConferenceToggle = 'input[data-testid="toggle_video_conference"]'
static #learningStoreStudentAccessToggle = 'input[data-testid="admin-school-toggle-learning-store"]'
static #submitButtonTeamsAdmin = '[data-testid="button_save_team_administration"]'
static #startMigrationButton = '[data-testid="migration-start-button"]'
static #migrationInformationText = '[data-testid="text-description"]'
Expand Down Expand Up @@ -77,17 +77,25 @@ class Management {
static #parameterInputField = '[data-testid="schoolParam"]'
static #dataTable = '[data-testid="table_container"]'

disableTeamsVideoConferenceByAdmin() {
cy.get(Management.#videoConferenceToggle).first().click()
}

clickOnAdminSettingsSave () {
cy.get(Management.#saveGeneralAdminSetting)
.click()
}

enableTeamsVideoConferenceByAdmin () {
cy.get(Management.#videoConferenceToggle).first().click()
cy.get(Management.#videoConferenceToggle).then(el => {
(el.attr('aria-checked') === 'true')
? cy.log('Element is already checked, skipping click')
: cy.get(Management.#videoConferenceToggle).click({force: true})
})
}

disableTeamsVideoConferenceByAdmin() {
cy.get(Management.#videoConferenceToggle).then(el => {
(el.attr('aria-checked') === 'false')
? cy.log('Element is already unchecked, skipping click')
: cy.get(Management.#videoConferenceToggle).click({force: true})
})
}

clickOnManageSchoolCard () {
Expand All @@ -110,15 +118,35 @@ class Management {
}

clickToggleSwitchToDisableAccessToLearningStore () {
cy.get(Management.#learningStoreStudentAccessToggle).first().click()
cy.get(Management.#learningStoreStudentAccessToggle).then(el => {
(el.attr('aria-checked') === 'false')
? cy.log('Element is already unchecked, skipping click')
: cy.get(Management.#learningStoreStudentAccessToggle).click({force: true})
})
}

clickToggleSwitchToEnableAccessToLearningStore () {
cy.get(Management.#learningStoreStudentAccessToggle).first().click()
cy.get(Management.#learningStoreStudentAccessToggle).then(el => {
(el.attr('aria-checked') === 'true')
? cy.log('Element is already checked, skipping click')
: cy.get(Management.#learningStoreStudentAccessToggle).click({force: true})
})
}

assertStudentsAccessIsUnchecked () {
cy.get(Management.#learningStoreStudentAccessToggle).should(
'have.attr',
'aria-checked',
'false'
)
}

assertStudentsAccessIsUnchecked() {
cy.get(Management.#learningStoreStudentAccessToggle).should('not.be.checked');
assertStudentsAccessIsChecked () {
cy.get(Management.#learningStoreStudentAccessToggle).should(
'have.attr',
'aria-checked',
'true'
)
}

clickSaveButtonToAllowStudentCreateTeam () {
Expand Down

0 comments on commit 982386d

Please sign in to comment.