From d061481e578c4f91ce9908e0784ac258f0186d2b Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 18 Sep 2024 18:08:40 -0500 Subject: [PATCH 1/4] Update Archetype.open() method Signed-off-by: Nandini Chandra --- cypress/e2e/models/migration/archetypes/archetype.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/models/migration/archetypes/archetype.ts b/cypress/e2e/models/migration/archetypes/archetype.ts index 25a71f6ab..4ada71b12 100644 --- a/cypress/e2e/models/migration/archetypes/archetype.ts +++ b/cypress/e2e/models/migration/archetypes/archetype.ts @@ -71,6 +71,7 @@ export class Archetype { const itemsPerPage = 100; if (forceReload) { cy.visit(Archetype.fullUrl, { timeout: 15 * SEC }).then((_) => + cy.get("h1", { timeout: 35 * SEC }).should("contain", 'Archetypes'); selectItemsPerPage(itemsPerPage) ); return; From f56e467bacdf31b39474959d4a275ca4d2427509 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 19 Sep 2024 13:32:25 -0500 Subject: [PATCH 2/4] Update Archetype.open() Signed-off-by: Nandini Chandra --- cypress/e2e/models/migration/archetypes/archetype.ts | 3 ++- cypress/utils/utils.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/models/migration/archetypes/archetype.ts b/cypress/e2e/models/migration/archetypes/archetype.ts index 4ada71b12..b93b2f603 100644 --- a/cypress/e2e/models/migration/archetypes/archetype.ts +++ b/cypress/e2e/models/migration/archetypes/archetype.ts @@ -71,7 +71,8 @@ export class Archetype { const itemsPerPage = 100; if (forceReload) { cy.visit(Archetype.fullUrl, { timeout: 15 * SEC }).then((_) => - cy.get("h1", { timeout: 35 * SEC }).should("contain", 'Archetypes'); + cy.wait(15 * SEC); + cy.get("h1", { timeout: 35 * SEC }).should("contain", 'Archetypes'); selectItemsPerPage(itemsPerPage) ); return; diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 64888f765..d8e1f4652 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -811,7 +811,7 @@ export function clickKebabMenuOptionArchetype(rowItem: string, itemName: string) .within(() => { click(sideKebabMenu); }); - cy.get(commonView.actionMenuItem).contains(itemName).click(); + cy.get(commonView.actionMenuItem).contains(itemName).click({ force: true }); } export function createMultipleJiraConnections( From 5a821d43c5b510e2bcd828070b9f874c3932ca40 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 19 Sep 2024 14:59:30 -0500 Subject: [PATCH 3/4] Pass forceReload=true to Stakeholders.openList() call Signed-off-by: Nandini Chandra --- .../tests/migration/archetypes/questionnaire_features.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts index 33d753a43..0f2a51017 100644 --- a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts +++ b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts @@ -139,6 +139,7 @@ describe(["@tier3"], "Tests for archetype questionnaire features", () => { after("Perform test data clean up", function () { Archetype.open(true); archetype.delete(); + Stakeholders.openList(true); deleteByList(stakeholderList); AssessmentQuestionnaire.deleteAllQuestionnaires(); }); From e486cde8b903ba20d29b499f1057f483efb92cac Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 19 Sep 2024 16:03:54 -0500 Subject: [PATCH 4/4] Some formatting Signed-off-by: Nandini Chandra --- .../assessment_questionnaire.ts | 1 + cypress/e2e/models/migration/archetypes/archetype.ts | 11 ++++++----- cypress/e2e/models/migration/controls/stakeholders.ts | 1 + .../archetypes/questionnaire_features.test.ts | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts b/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts index c6a4513b7..b000bcac1 100644 --- a/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts +++ b/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts @@ -30,6 +30,7 @@ export class AssessmentQuestionnaire { const itemsPerPage = 100; if (forceReload) { cy.visit(AssessmentQuestionnaire.fullUrl, { timeout: 35 * SEC }).then((_) => { + cy.wait(10 * SEC); selectItemsPerPage(itemsPerPage); }); return; diff --git a/cypress/e2e/models/migration/archetypes/archetype.ts b/cypress/e2e/models/migration/archetypes/archetype.ts index b93b2f603..b3028f4a4 100644 --- a/cypress/e2e/models/migration/archetypes/archetype.ts +++ b/cypress/e2e/models/migration/archetypes/archetype.ts @@ -70,11 +70,12 @@ export class Archetype { public static open(forceReload = false) { const itemsPerPage = 100; if (forceReload) { - cy.visit(Archetype.fullUrl, { timeout: 15 * SEC }).then((_) => - cy.wait(15 * SEC); - cy.get("h1", { timeout: 35 * SEC }).should("contain", 'Archetypes'); - selectItemsPerPage(itemsPerPage) - ); + cy.visit(Archetype.fullUrl, { timeout: 15 * SEC }).then((_) => { + // This explicit wait is required in some cases. + cy.wait(10 * SEC); + cy.get("h1", { timeout: 35 * SEC }).should("contain", "Archetypes"); + selectItemsPerPage(itemsPerPage); + }); return; } diff --git a/cypress/e2e/models/migration/controls/stakeholders.ts b/cypress/e2e/models/migration/controls/stakeholders.ts index 08270596f..7db91c9fd 100644 --- a/cypress/e2e/models/migration/controls/stakeholders.ts +++ b/cypress/e2e/models/migration/controls/stakeholders.ts @@ -63,6 +63,7 @@ export class Stakeholders { public static openList(forceReload = false): void { if (forceReload) { cy.visit(Stakeholders.fullUrl, { timeout: 35 * SEC }).then((_) => { + cy.wait(10 * SEC); cy.get("h1", { timeout: 60 * SEC }).should("contain", "Controls"); selectItemsPerPage(100); }); diff --git a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts index 0f2a51017..d69670524 100644 --- a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts +++ b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts @@ -141,6 +141,7 @@ describe(["@tier3"], "Tests for archetype questionnaire features", () => { archetype.delete(); Stakeholders.openList(true); deleteByList(stakeholderList); + AssessmentQuestionnaire.open(true); AssessmentQuestionnaire.deleteAllQuestionnaires(); }); });