Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Application import: Verify assigned BS for imported application if BS already exists #1273

Merged
merged 5 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
deleteAppImportsTableRows,
deleteAllMigrationWaves,
} from "../../../../../utils/utils";
import { tdTag, trTag } from "../../../../../e2e/types/constants";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { ManageImports } from "../../../../models/migration/applicationinventory/manageImports";

Expand Down Expand Up @@ -78,7 +79,8 @@ describe(["@tier3"], "Application import operations", () => {
imports.verifyImportErrorMsg(errorMsgs);
});

it("Applications import for non existing tags and BS", function () {
it("Bug MTA-4257: 1)Applications import for non existing tags and BS \
2)Verify assigned BS for imported application if BS was created through previous import", function () {
Comment on lines +82 to +83
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we testing 2 things in the same test case instead of having two different it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @abrugaro. These are long running tests, so I decided to combine the two to save some time . I've combined tests in the same it block for Assessment tests in the past . Test # 2 requires a few steps from test # 1.

One disadvantage to combining tests is that it does introduce some dependency.

Application.open();
cy.wait("@getApplication");
// Import csv with non-existent tags
Expand All @@ -87,7 +89,22 @@ describe(["@tier3"], "Application import operations", () => {
importApplication(filePath + fileName, true);
cy.wait(2000);
ManageImports.open();
imports.verifyAppImport(fileName, "Completed", 2, "-");

// Automate bug MTA-4257, Polarion TC MTA-609
const fileName2 = "lantik_bug.csv";
importApplication(filePath + fileName2, true);
cy.wait(2000);
ManageImports.open();
imports.verifyAppImport(fileName, "Completed", 1, "-");
Application.open();
exists("App_bug4257");
cy.get(tdTag)
.contains("App_bug4257")
.closest(trTag)
.within(() => {
cy.get("td[data-label='Business Service']").should("contain.text", "Finance");
});
});

it("Applications import with minimum required field(s) and empty row", function () {
Expand Down
2 changes: 2 additions & 0 deletions cypress/fixtures/app_import/csv/lantik_bug.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Record Type 1,Application Name,Description,Comments,Business Service,Dependency,Dependency Direction,Binary Group,Binary Artifact,Binary Version,Binary Packaging,Repository Type,Repository URL,Repository Branch,Repository Path,Owner,Contributors,Tag Category 1,Tag 1,Tag Category 2,Tag 2,Tag Category 3,Tag 3,Tag Category 4,Tag 4
1,App_bug4257,,,Finance,,,,,,,,,,,,,,,,,,,,
3 changes: 2 additions & 1 deletion cypress/fixtures/app_import/csv/missing_tags_and_bs.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Record Type 1,Application Name,Description,Comments,Business Service,Dependency,Dependency Direction,Binary Group,Binary Artifact,Binary Version,Binary Packaging,Repository Type,Repository URL,Repository Branch,Repository Path,Owner,Contributors,Tag Category 1,Tag 1,Tag Category 2,Tag 2,Tag Category 3,Tag 3,Tag Category 4,Tag 4
1,Application123,Legacy Customers management service,,Finance,,,corp.acme.demo,customers-tomcat,0.0.1-SNAPSHOT,war,git,https://git-acme.local/customers.git,,,,,Operating System,RHEL 8,Database,Oracle,Language,TypeScript,Runtime,Tomcat
1,Application_123,Legacy Customers management service,,Finance,,,corp.acme.demo,customers-tomcat,0.0.1-SNAPSHOT,war,git,https://git-acme.local/customers.git,,,,,Operating System,RHEL 8,Database,Oracle,Language,TypeScript,Runtime,Tomcat
1,Application_456,,,HR,,,,,,,,,,,,,,,,,,,,