diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index 4fd768a2..625d59ef 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -18,9 +18,22 @@ Feature: Admin Users - To administrate the Migration process. When I click on agree migration button Then I see the migration is active field Then I see the end migration button + Then I see the migration mandatory switch is not checked + Scenario: Admin toggles ldap sync for school in migration + Then I see the sync during migration switch is visible and not checked + When I toggle the sync during migration switch + Then I see the sync during migration switch is checked - Scenario: Admin ends the migration + Scenario: Admin stops the migration When I click on end migration button + Then I see the end of migration information title + Then I see the end of migration information text + Then I see the end migration information link href is blog.niedersachsen.cloud/umzug + Then I see the end migration confirmation checkbox is unchecked + Then I see the abort button for end of migration conformation + Then I can see the end migration confirmation button is disabled When I click on the end migration confirmation checkbox + Then I see the end migration confirmation button is enabled When I click on the end migration confirmation button + Then I see the timestamp when the migration is finished \ No newline at end of file diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 876a4e44..addbe8a1 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -43,6 +43,13 @@ class Management { static #schoolNumberForm = '[data-testid="school-number"]' static #migrationTextSupportLink = '[data-testid="support-link"]' static #migrationTextBlogLink = '[data-testid="migration-blog-link"]' + static #endMigrationAbortButton = '[data-testid="disagree-btn"]' + static #endMigrationInformationTitle = '[data-testid="migration-warning-card-title"]' + static #endMigrationInformationText = '[data-testid="migration-warning-card-info-text"]' + static #endMigrationTextBlogLink = '[data-testid="end-warningcard-migration-blog-link"]' + static #migrationMandatorySwitch = '[data-testid="migration-mandatory-switch"]' + static #enableSyncDuringMigrationSwitch = '[data-testid="enable-sync-during-migration-switch"]' + static #migrationFinishedTimestamp = '[data-testid="migration-finished-timestamp"]' disableTeamsVideoConferenceByAdmin () { @@ -332,7 +339,6 @@ class Management { .click() } - clickEndMigrationConfirmationCheckbox() { cy.get(Management.#endMigrationConfirmationCheckbox) .check( {force: true} ) @@ -342,5 +348,71 @@ class Management { cy.get(Management.#endMigrationConfirmationButton) .click() } + + seeEndMigrationInformationTitle() { + cy.get(Management.#endMigrationInformationTitle) + .should('be.visible'); + } + + seeEndMigrationInformationText() { + cy.get(Management.#endMigrationInformationText) + .should('be.visible'); + } + + checkEndMigrationInfoLink() { + cy.get(Management.#endMigrationTextBlogLink) + .should("have.attr", "href", "https://blog.niedersachsen.cloud/umzug") + } + + seeEndMigrationConfirmationCheckboxIsUnchecked() { + cy.get(Management.#endMigrationConfirmationCheckbox) + .should('not.be.checked'); + } + + seeEndMigrationAbortButton(){ + cy.get(Management.#endMigrationAbortButton) + .should('be.visible'); + } + + seeEndMigrationConfirmationButtonIsDisabled(){ + cy.get(Management.#endMigrationConfirmationButton) + .should('be.disabled') + } + + seeEndMigrationConfirmationButtonIsEnabled(){ + cy.get(Management.#endMigrationConfirmationButton) + .should('be.enabled') + } + + seeMigrationMandatorySwitch(){ + cy.get(Management.#migrationMandatorySwitch) + .should('not.be.checked'); + } + + seeSyncDuringMigrationSwitchIsNotChecked(){ + cy.get(Management.#enableSyncDuringMigrationSwitch) + .should('not.be.checked') + } + + seeSyncDuringMigrationSwitchIsChecked(){ + cy.get(Management.#enableSyncDuringMigrationSwitch) + .and('be.checked') + } + + toggleMigrationMandatorySwitch(){ + cy.get(Management.#migrationMandatorySwitch) + .click(); + } + + toggleSyncDuringMigrationSwitch(){ + cy.get(Management.#enableSyncDuringMigrationSwitch) + .click(); + } + + seeMigrationFinishedTimestamp(){ + cy.get(Management.#migrationFinishedTimestamp) + .and('be.visible') + } + } export default Management diff --git a/cypress/support/step_definition/admin/administrateMigrationSteps.js b/cypress/support/step_definition/admin/administrateMigrationSteps.js index 6604b26f..6663881e 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -42,3 +42,57 @@ When('I click on the end migration confirmation button', () => { management.clickEndMigrationConfirmationButton() }); + + + +Then('I see the end of migration information title', () => { + management.seeEndMigrationInformationTitle() +}); + +Then('I see the end of migration information text', () => { + management.seeEndMigrationInformationText() +}); + +Then(/^I see the end migration information link href is blog\.niedersachsen\.cloud\/umzug$/, () =>{ + management.checkEndMigrationInfoLink() +}); + +Then('I see the end migration confirmation checkbox is unchecked', () => { + management.seeEndMigrationConfirmationCheckboxIsUnchecked() +}); + +Then('I see the abort button for end of migration conformation', () => { + management.seeEndMigrationAbortButton() +}); + +Then('I can see the end migration confirmation button is disabled', () => { + management.seeEndMigrationConfirmationButtonIsDisabled() +}); + +Then('I see the end migration confirmation button is enabled', () => { + management.seeEndMigrationConfirmationButtonIsEnabled() +}); + +Then('I see the migration mandatory switch is not checked', () => { + management.seeMigrationMandatorySwitch() +}); + +Then('I see the sync during migration switch is visible and not checked', () => { + management.seeSyncDuringMigrationSwitchIsNotChecked() +}); + +Then('I see the sync during migration switch is checked', () => { + management.seeSyncDuringMigrationSwitchIsChecked() +}); + +When('I toggle the migration mandatory switch', () => { + management.toggleMigrationMandatorySwitch() +}); + +When('I toggle the sync during migration switch', () => { + management.toggleSyncDuringMigrationSwitch() +}); + +Then('I see the timestamp when the migration is finished', () => { + management.seeMigrationFinishedTimestamp() +}); \ No newline at end of file