From a02fe853a02a1dea9e4f24f26346d82ba84158fa Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Thu, 21 Mar 2024 21:20:43 +0530 Subject: [PATCH] [RFR][TA] Automate MTA-405 custom rules with target technology (#1032) Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts modified: cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts modified: cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts modified: cypress/e2e/models/administration/custom-migration-targets/custom-migration-target.ts modified: cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts modified: cypress/fixtures/custom-rules.json --- .../custom-migration-targets/custom-migration-target.ts | 6 ++++-- .../administration/custom-migration-targets/crud.test.ts | 7 +++++-- cypress/fixtures/custom-rules.json | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/models/administration/custom-migration-targets/custom-migration-target.ts b/cypress/e2e/models/administration/custom-migration-targets/custom-migration-target.ts index baf12ac66..d84147aa2 100644 --- a/cypress/e2e/models/administration/custom-migration-targets/custom-migration-target.ts +++ b/cypress/e2e/models/administration/custom-migration-targets/custom-migration-target.ts @@ -33,6 +33,7 @@ export interface CustomMigrationTarget { ruleTypeData: RulesRepositoryFields | RulesManualFields; language: Languages; sources?: string[]; + targets?: string[]; } export class CustomMigrationTarget { @@ -42,7 +43,8 @@ export class CustomMigrationTarget { imagePath: string, ruleTypeData: RulesRepositoryFields | RulesManualFields, language = Languages.Java, - sources?: string[] + sources?: string[], + targets?: string[] ) { this.name = name; this.description = description; @@ -134,7 +136,7 @@ export class CustomMigrationTarget { public static selectLanguage(language: Languages) { CustomMigrationTarget.open(); - cy.get(actionSelectToggle, { timeout: 2 * SEC }).click(); + cy.get(actionSelectToggle, { timeout: 30 * SEC }).click(); clickByText("button", language); } diff --git a/cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts b/cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts index 414f8e645..9c0346f19 100644 --- a/cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts +++ b/cypress/e2e/tests/administration/custom-migration-targets/crud.test.ts @@ -226,8 +226,8 @@ describe(["@tier1", "@dc", "@interop"], "Custom Migration Targets CRUD operation }); Object.values(Languages).forEach((language) => { - it(`${language} | custom rule with source technology`, function () { - const targetData = this.customMigrationTargets["rules_with_source_element"]; + it(`${language} | custom rule with source and target technology`, function () { + const targetData = this.customMigrationTargets["rules_with_source_target_element"]; const target = new CustomMigrationTarget( data.getRandomWord(8), data.getDescription(), @@ -266,6 +266,9 @@ describe(["@tier1", "@dc", "@interop"], "Custom Migration Targets CRUD operation cy.contains(button, "Next", { timeout: 200 }).click(); target.validateSourceTechnology(targetData.sources); + + // TC 405 - Validate Target technology + cy.get(".pf-v5-c-wizard__main-body").should("contain", targetData.targets); clickByText(button, "Cancel"); target.delete(); diff --git a/cypress/fixtures/custom-rules.json b/cypress/fixtures/custom-rules.json index 353dc5bae..d9fede168 100644 --- a/cypress/fixtures/custom-rules.json +++ b/cypress/fixtures/custom-rules.json @@ -26,9 +26,10 @@ "rulesFiles": ["xml/hazelcast.windup.xml"] }, - "rules_with_source_element": { + "rules_with_source_target_element": { "image": "img/cloud.png", "rulesFiles": ["xml/corporate-framework-config.windup.xml"], - "sources": ["traditional-corporate-framework"] + "sources": ["traditional-corporate-framework"], + "targets": ["cloud-corporate-framework"] } }