Skip to content

Commit

Permalink
N21-1479 group provisioning options (#162)
Browse files Browse the repository at this point in the history
* delete group folder
* provisioning options page test
* add post condition
* add test for ldap system
  • Loading branch information
IgorCapCoder authored Dec 19, 2023
1 parent 54fe773 commit ba777be
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 0 deletions.
49 changes: 49 additions & 0 deletions cypress/e2e/admin/administrateAuthentication.feature
Original file line number Diff line number Diff line change
@@ -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
Empty file.
100 changes: 100 additions & 0 deletions cypress/support/pages/admin/pageAdministration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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()
})

0 comments on commit ba777be

Please sign in to comment.