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] [TA] Add test for importing .csv file with missing application name #704

Merged
merged 6 commits into from
Sep 6, 2023
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 @@ -224,34 +224,48 @@ describe(["@tier2"], "Application import operations", () => {
verifyImportErrorMsg(errorMsgs);
});

it("Applications import for with inavlid record type", function () {
it("Application import with invalid record type", function () {
// The only valid record types for records in a CSV file are 1(application) or 2(dependency).
// In this test, we import a CSV file that has records with a record type that's neither 1 nor 2.
// Automates https://issues.redhat.com/browse/TACKLE-634
Application.open();
cy.wait("@getApplication");

// Import csv with invalid record type
const fileName = "invalid_record_type_21.csv";
importApplication(filePath + fileName);
cy.wait(2000);

// Open application imports page
openManageImportsPage();

// Verify import applications page shows correct information
verifyAppImport(fileName, "Completed", 0, 2);

var errorMsgs = [
const errorMsgs = [
"Invalid or unknown Record Type '3'. Must be '1' for Application or '2' for Dependency.",
"Invalid or unknown Record Type '100'. Must be '1' for Application or '2' for Dependency.",
];

// Verify the error report message
openErrorReport();
verifyImportErrorMsg(errorMsgs);
});

it("Import .CSV file with missing application name", function () {
// Automates Polarion MTA-368
Application.open();
cy.wait("@getApplication");

const fileName = "missing_application_name.csv";
importApplication(filePath + fileName);
cy.wait(2000);

openManageImportsPage();

verifyAppImport(fileName, "Completed", 0, 1);

const errorMsg = ["Application Name is mandatory."];
openErrorReport();
verifyImportErrorMsg(errorMsg);
});

after("Perform test data clean up", function () {
// Business services and apps were created during app imports; Hence these functions are being used for
// cleanup.
Expand Down
2 changes: 2 additions & 0 deletions cypress/fixtures/app_import/csv/missing_application_name.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,Tag Category 1,Tag 1,Tag Category 2,Tag 2,Tag Category 3,Tag 3,Tag Category 4,Tag 4,Tag Category 5,Tag 5,Tag Category 6,Tag 6,Tag Category 7,Tag 7,Tag Category 8,Tag 8,Tag Category 9,Tag 9,Tag Category 10,Tag 10,Tag Category 11,Tag 11,Tag Category 12,Tag 12,Tag Category 13,Tag 13,Tag Category 14,Tag 14,Tag Category 15,Tag 15,Tag Category 16,Tag 16,Tag Category 17,Tag 17,Tag Category 18,Tag 18,Tag Category 19,Tag 19,Tag Category 20,Tag 20
1,,Legacy Customers management service,,Retail,,,corp.acme.demo,customers-tomcat,0.0.1-SNAPSHOT,war,git,https://git-acme.local/customers.git,,,Operating System,RHEL 8,Database,Oracle,Language,Java,Runtime,Tomcat,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Loading