From ea99146432af3610e50f3221fadbef2d068554f9 Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Thu, 7 Sep 2023 16:49:54 +0200 Subject: [PATCH 1/6] add test scenario --- .../e2e/admin/administrateMigration.feature | 9 +++++--- .../support/pages/admin/pageAdministration.js | 23 ++++++++++++++++++- .../admin/administrateMigrationSteps.js | 16 +++++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index 4fd768a2..973494bb 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -19,8 +19,11 @@ Feature: Admin Users - To administrate the Migration process. Then I see the migration is active field Then I see the end migration button - - Scenario: Admin ends the migration + Scenario: Admin stops the migration When I click on end migration button + 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 - When I click on the end migration confirmation button + Then I see the end migration confirmation button is enabled + When I click on the end migration confirmation button \ No newline at end of file diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 876a4e44..30d8fa83 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -43,6 +43,7 @@ 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"]' disableTeamsVideoConferenceByAdmin () { @@ -332,7 +333,6 @@ class Management { .click() } - clickEndMigrationConfirmationCheckbox() { cy.get(Management.#endMigrationConfirmationCheckbox) .check( {force: true} ) @@ -342,5 +342,26 @@ class Management { cy.get(Management.#endMigrationConfirmationButton) .click() } + + 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') + } + } export default Management diff --git a/cypress/support/step_definition/admin/administrateMigrationSteps.js b/cypress/support/step_definition/admin/administrateMigrationSteps.js index 6604b26f..da863360 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -42,3 +42,19 @@ When('I click on the end migration confirmation button', () => { management.clickEndMigrationConfirmationButton() }); + +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() +}); \ No newline at end of file From af9a9800ed957bf3568fe26caca64c6064d86317 Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Fri, 8 Sep 2023 10:22:12 +0200 Subject: [PATCH 2/6] add test for info title,text,link --- .../e2e/admin/administrateMigration.feature | 3 +++ .../support/pages/admin/pageAdministration.js | 18 ++++++++++++++++++ .../admin/administrateMigrationSteps.js | 14 ++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index 973494bb..4ee86542 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -21,6 +21,9 @@ Feature: Admin Users - To administrate the Migration process. 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 diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 30d8fa83..d1703110 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -44,6 +44,9 @@ class Management { 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"]' disableTeamsVideoConferenceByAdmin () { @@ -343,6 +346,21 @@ class Management { .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'); diff --git a/cypress/support/step_definition/admin/administrateMigrationSteps.js b/cypress/support/step_definition/admin/administrateMigrationSteps.js index da863360..562d8283 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -43,6 +43,20 @@ 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() }); From 9a1d30f079075a22ff9e257c506aae673ae72dbe Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Fri, 8 Sep 2023 11:12:27 +0200 Subject: [PATCH 3/6] add test for switches --- .../e2e/admin/administrateMigration.feature | 2 ++ .../support/pages/admin/pageAdministration.js | 20 +++++++++++++++++++ .../admin/administrateMigrationSteps.js | 8 ++++++++ 3 files changed, 30 insertions(+) diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index 4ee86542..d8fb07f1 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -18,6 +18,8 @@ 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 + When I toggle the migration mandatory switch + When I toggle the sync during migration switch Scenario: Admin stops the migration When I click on end migration button diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index d1703110..dcc88964 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -47,6 +47,8 @@ class Management { 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"]' disableTeamsVideoConferenceByAdmin () { @@ -381,5 +383,23 @@ class Management { .should('be.enabled') } + toggleMigrationMandatorySwitch(){ + cy.get(Management.#migrationMandatorySwitch) + .should('not.be.checked'); + cy.get(Management.#migrationMandatorySwitch) + .click(); + cy.get(Management.#migrationMandatorySwitch) + .should('be.checked'); + } + + toggleSyncDuringMigrationSwitch(){ + cy.get(Management.#enableSyncDuringMigrationSwitch) + .should('not.be.checked'); + cy.get(Management.#enableSyncDuringMigrationSwitch) + .click(); + cy.get(Management.#enableSyncDuringMigrationSwitch) + .should('be.checked'); + } + } export default Management diff --git a/cypress/support/step_definition/admin/administrateMigrationSteps.js b/cypress/support/step_definition/admin/administrateMigrationSteps.js index 562d8283..e0d02074 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -71,4 +71,12 @@ Then('I can see the end migration confirmation button is disabled', () => { Then('I see the end migration confirmation button is enabled', () => { management.seeEndMigrationConfirmationButtonIsEnabled() +}); + +When('I toggle the migration mandatory switch', () => { + management.toggleMigrationMandatorySwitch() +}); + +When('I toggle the sync during migration switch', () => { + management.toggleSyncDuringMigrationSwitch() }); \ No newline at end of file From fe291c9e4259a207ae32cb397034df3abe93f328 Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Fri, 8 Sep 2023 11:56:22 +0200 Subject: [PATCH 4/6] add test scenario --- .../e2e/admin/administrateMigration.feature | 6 ++++- .../support/pages/admin/pageAdministration.js | 23 +++++++++++++++---- .../admin/administrateMigrationSteps.js | 12 ++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index d8fb07f1..942a410e 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -18,8 +18,12 @@ 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 - When I toggle the migration mandatory switch + 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 stops the migration When I click on end migration button diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index dcc88964..78f25ac3 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -383,13 +383,28 @@ class Management { .should('be.enabled') } - toggleMigrationMandatorySwitch(){ + seeMigrationMandatorySwitch(){ cy.get(Management.#migrationMandatorySwitch) - .should('not.be.checked'); + .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) + // .should('not.be.checked'); cy.get(Management.#migrationMandatorySwitch) .click(); - cy.get(Management.#migrationMandatorySwitch) - .should('be.checked'); + // cy.get(Management.#migrationMandatorySwitch) + // .should('be.checked'); } toggleSyncDuringMigrationSwitch(){ diff --git a/cypress/support/step_definition/admin/administrateMigrationSteps.js b/cypress/support/step_definition/admin/administrateMigrationSteps.js index e0d02074..c947395f 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -73,6 +73,18 @@ 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() }); From 3d827c08f5f62339c92d91715cbd5af51435dd2e Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Fri, 8 Sep 2023 11:57:25 +0200 Subject: [PATCH 5/6] adjust test --- cypress/support/pages/admin/pageAdministration.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 78f25ac3..a61239ae 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -399,21 +399,13 @@ class Management { } toggleMigrationMandatorySwitch(){ - // cy.get(Management.#migrationMandatorySwitch) - // .should('not.be.checked'); cy.get(Management.#migrationMandatorySwitch) .click(); - // cy.get(Management.#migrationMandatorySwitch) - // .should('be.checked'); } toggleSyncDuringMigrationSwitch(){ - cy.get(Management.#enableSyncDuringMigrationSwitch) - .should('not.be.checked'); cy.get(Management.#enableSyncDuringMigrationSwitch) .click(); - cy.get(Management.#enableSyncDuringMigrationSwitch) - .should('be.checked'); } } From d16dbf8fd8f4d74f07fbfd637d53750cc0e9e77c Mon Sep 17 00:00:00 2001 From: Malte Berg Date: Mon, 11 Sep 2023 13:22:38 +0200 Subject: [PATCH 6/6] Add timestamp test --- cypress/e2e/admin/administrateMigration.feature | 3 ++- cypress/support/pages/admin/pageAdministration.js | 6 ++++++ .../step_definition/admin/administrateMigrationSteps.js | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/admin/administrateMigration.feature b/cypress/e2e/admin/administrateMigration.feature index 942a410e..625d59ef 100644 --- a/cypress/e2e/admin/administrateMigration.feature +++ b/cypress/e2e/admin/administrateMigration.feature @@ -35,4 +35,5 @@ Feature: Admin Users - To administrate the Migration process. 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 \ No newline at end of file + 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 a61239ae..addbe8a1 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -49,6 +49,7 @@ class Management { 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 () { @@ -408,5 +409,10 @@ class Management { .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 c947395f..6663881e 100644 --- a/cypress/support/step_definition/admin/administrateMigrationSteps.js +++ b/cypress/support/step_definition/admin/administrateMigrationSteps.js @@ -91,4 +91,8 @@ When('I toggle the migration mandatory switch', () => { 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