diff --git a/cypress/e2e/admin/administrateAuthentication.feature b/cypress/e2e/admin/administrateAuthentication.feature new file mode 100644 index 00000000..4902328f --- /dev/null +++ b/cypress/e2e/admin/administrateAuthentication.feature @@ -0,0 +1,49 @@ +# @release +Feature: Admin can edit system configuration + + As an admin I want to be able to edit system configurations + + @unstable_test + Scenario: As an admin i want to see my systems and edit ldap systems of provider: general + Given I am logged in as a 'admin1_nbc' at 'nbc' + When I go to administration page + When I go to school administration + When I click on authentication panel + Then I see a systems table + Then I see an ldap system + Then I see the 'SANIS' system with an edit button + When I click on the edit button of the ldap system + Then I see the ldap configuration page + When I go to administration page + When I go to school administration + When I click on authentication panel + Then I see a systems table + + @unstable_test + Scenario: As an admin i want to edit the group provisioning options of the moin.schule system + Given I see a system table + When I click on the edit button of the 'SANIS' system + Then I see the provisioning options page + Then I see 3 checkboxes with assigned default values + When I check all checkboxes + When I click the cancel button on the provisioning options page + Then I see a systems table + When I click on the edit button of the 'SANIS' system + Then I see 3 checkboxes with assigned default values + When I check all checkboxes + When I click the save button on the provisioning options page + Then I see a systems table + When I click on the edit button of the 'SANIS' system + Then I see all 3 checkboxes are checked + When I uncheck all checkboxes + When I click the save button on the provisioning options page + Then I see a systems table + When I click on the edit button of the 'SANIS' system + Then I see all 3 checkboxes are unchecked + + @unstable_test + Scenario: As a post-condition admin resets the provisioning options values + Given I see the provisioning options page + When I set the checkboxes to default values + When I click the save button on the provisioning options page + Then I see a systems table diff --git a/cypress/e2e/group/groupMembers.feature b/cypress/e2e/group/groupMembers.feature deleted file mode 100644 index e69de29b..00000000 diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index bd6919b8..df11fa00 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -59,6 +59,13 @@ class Management { static #cancelExternalToolDeletionButton = '[data-testid="delete-dialog-cancel"]' static #externalToolDeletionDialogText = '[data-testid="delete-dialog-content"]' static #externalToolDeletionDialogTitle = '[data-testid="delete-dialog-title"]' + static #systemPanel = '[data-testid="systems-panel"]' + static #systemtable = '[data-testid="system-table"]' + static #classOptionCheckbox = '[data-testid="checkbox-option-class"]' + static #courseOptionCheckbox = '[data-testid="checkbox-option-course"]' + static #othersOptionCheckbox = '[data-testid="checkbox-option-others"]' + static #saveProvisioningOptionsButton = '[data-testid="provisioning-options-save-button"]' + static #cancelProvisioningOptionsButton = '[data-testid="provisioning-options-cancel-button"]' disableTeamsVideoConferenceByAdmin() { cy.get(Management.#oldAdminPageVideoChatCheckBox) @@ -463,6 +470,99 @@ class Management { .should('have.length.gte', 1) } + clickOnAuthenticationPanel() { + cy.get(Management.#systemPanel) + .click() + } + + seeSystemTable() { + cy.get(Management.#systemtable) + .should('be.visible') + } + + seeLdapSystem() { + const ldapSystemEntry = cy.get(Management.#systemtable).find('td').contains('ldap') + ldapSystemEntry.should('be.visible') + + ldapSystemEntry.siblings('td').eq(2).find('a') + .should('be.visible') + } + + seeSpecificSystemWithEditButton(systemName) { + const systemEntry = cy.get(Management.#systemtable).find('td').contains(systemName) + systemEntry.should('be.visible') + + systemEntry.siblings('td').eq(2).find('a') + .should('be.visible') + } + + clickOnLdapEditButton() { + const ldapSystemEntry = cy.get(Management.#systemtable).find('td').contains('ldap') + + ldapSystemEntry.siblings('td').eq(2).find('a') + .click() + } + + seeLdapConfigurationPage() { + cy.url().should('include', '/administration/ldap/config?id=') + } + + clickOnSpecificSystemEditButton(systemName) { + const systemEntry = cy.get(Management.#systemtable).find('td').contains(systemName) + + systemEntry.siblings('td').eq(2).find('a') + .click() + } + + seeProvisioningOptionsPage() { + cy.url().should('include', '/administration/school-settings/provisioning-options?systemId=') + } + + seeCheckboxesWithDefaultValues() { + cy.get('[type=checkbox]').should('have.length', 3) + cy.get(Management.#classOptionCheckbox).should('be.checked') + cy.get(Management.#courseOptionCheckbox).should('not.be.checked') + cy.get(Management.#othersOptionCheckbox).should('not.be.checked') + } + + checkAllBoxes() { + cy.get(Management.#courseOptionCheckbox).check({force: true}) + cy.get(Management.#othersOptionCheckbox).check({force: true}) + } + + clickOnProvisioningOptionsCancelButton() { + cy.get(Management.#cancelProvisioningOptionsButton) + .click() + } + + clickOnProvisioningOptionsSaveButton() { + cy.get(Management.#saveProvisioningOptionsButton) + .click() + } + + seeAllCheckboxesAreChecked() { + cy.get(Management.#classOptionCheckbox).should('be.checked') + cy.get(Management.#courseOptionCheckbox).should('be.checked') + cy.get(Management.#othersOptionCheckbox).should('be.checked') + } + + resetCheckboxValues() { + cy.get(Management.#classOptionCheckbox).check({force: true}) + cy.get(Management.#courseOptionCheckbox).uncheck({force: true}) + cy.get(Management.#othersOptionCheckbox).uncheck({force: true}) + } + + uncheckAllBoxes() { + cy.get(Management.#classOptionCheckbox).uncheck({force: true}) + cy.get(Management.#courseOptionCheckbox).uncheck({force: true}) + cy.get(Management.#othersOptionCheckbox).uncheck({force: true}) + } + + seeAllCheckboxesAreUnchecked() { + cy.get(Management.#classOptionCheckbox).should('not.be.checked') + cy.get(Management.#courseOptionCheckbox).should('not.be.checked') + cy.get(Management.#othersOptionCheckbox).should('not.be.checked') + } } export default Management diff --git a/cypress/support/step_definition/admin/administrateAuthenticationSteps.js b/cypress/support/step_definition/admin/administrateAuthenticationSteps.js new file mode 100644 index 00000000..9b363cbf --- /dev/null +++ b/cypress/support/step_definition/admin/administrateAuthenticationSteps.js @@ -0,0 +1,67 @@ +import Management from "../../pages/admin/pageAdministration"; +const { When, Then } = require('@badeball/cypress-cucumber-preprocessor'); + +const management = new Management() +When('I click on authentication panel', () => { + management.clickOnAuthenticationPanel() +}) + +Then('I see a systems table', () => { + management.seeSystemTable() +}) + +Then('I see an ldap system', () => { + management.seeLdapSystem() +}) + +Then('I see the {string} system with an edit button', (systemName) => { + management.seeSpecificSystemWithEditButton(systemName) +}) + +When('I click on the edit button of the ldap system', () => { + management.clickOnLdapEditButton() +}) + +Then('I see the ldap configuration page', () => { + management.seeLdapConfigurationPage() +}) + +When('I click on the edit button of the {string} system', (systemName) => { + management.clickOnSpecificSystemEditButton(systemName) +}) + +Then('I see the provisioning options page', () => { + management.seeProvisioningOptionsPage() +}) + +Then('I see 3 checkboxes with assigned default values', () => { + management.seeCheckboxesWithDefaultValues() +}) + +When('I check all checkboxes', () => { + management.checkAllBoxes() +}) + +When('I click the cancel button on the provisioning options page', () => { + management.clickOnProvisioningOptionsCancelButton() +}) + +When('I click the save button on the provisioning options page', () => { + management.clickOnProvisioningOptionsSaveButton() +}) + +Then('I see all 3 checkboxes are checked', () => { + management.seeAllCheckboxesAreChecked() +}) + +When('I set the checkboxes to default values', () => { + management.resetCheckboxValues() +}) + +When('I uncheck all checkboxes', () => { + management.uncheckAllBoxes() +}) + +Then('I see all 3 checkboxes are unchecked', () => { + management.seeAllCheckboxesAreUnchecked() +})