Skip to content

Commit

Permalink
[RFR][TA] Automate MTA-405 custom rules with target technology (konve…
Browse files Browse the repository at this point in the history
…yor#1032)

Signed-off-by: Karishma Punwatkar <[email protected]>

	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
  • Loading branch information
kpunwatk authored Mar 21, 2024
1 parent 1e59e67 commit a02fe85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface CustomMigrationTarget {
ruleTypeData: RulesRepositoryFields | RulesManualFields;
language: Languages;
sources?: string[];
targets?: string[];
}

export class CustomMigrationTarget {
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions cypress/fixtures/custom-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}

0 comments on commit a02fe85

Please sign in to comment.