Skip to content

Commit

Permalink
[RFR] Fix Jenkins failures build 47 (#871)
Browse files Browse the repository at this point in the history
* Fix Jenkins failures build 47

Signed-off-by: Shveta Sachdeva <[email protected]>

* Fix Jenkins failures build 47

Signed-off-by: Shveta Sachdeva <[email protected]>

---------

Signed-off-by: Shveta Sachdeva <[email protected]>
Co-authored-by: Shveta Sachdeva <[email protected]>
  • Loading branch information
sshveta and Shveta Sachdeva authored Dec 11, 2023
1 parent 74497a2 commit 9f783c8
Show file tree
Hide file tree
Showing 12 changed files with 297 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ describe(["@tier3"], "Miscellaneous Questinnaire tests", () => {
throw new Error(`File is not in YAML format: ${filePath}`);
}
});
cy.readFile(filePath).should("contain", "Test questionnaire (SAMPLE)");
cy.readFile(filePath).should(
"contain",
"Uploadable Cloud Readiness Questionnaire Template"
);
});

after("Cleaning up", function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ describe(["@tier1"], "Upload Binary Analysis", () => {
application.verifyAnalysisStatus(AnalysisStatuses.completed);
});

it("DIVA report generation", function () {
it("Analysis for spring-petclinic application", function () {
const application = new Analysis(
getRandomApplicationData("DIVA"),
getRandomAnalysisData(this.analysisData["analysis_for_DIVA-report"])
getRandomApplicationData("spring"),
getRandomAnalysisData(this.analysisData["analysis_for_spring_petclinic_app"])
);
application.create();
applicationsList.push(application);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
} from "../../../../../utils/utils";
import {
button,
name,
clearAllFilters,
tag,
CredentialType,
Expand All @@ -40,6 +39,7 @@ import {
subversion,
git,
artifact,
appName,
} from "../../../../types/constants";

import * as data from "../../../../../utils/data_utils";
Expand Down Expand Up @@ -107,7 +107,7 @@ describe(["@tier2"], "Application inventory filter validations", function () {

// Enter an existing name substring and assert
var validSearchInput = applicationsList[0].name.substring(0, 11);
applySearchFilter(name, validSearchInput);
applySearchFilter(appName, validSearchInput);
cy.wait(2000);
exists(applicationsList[0].name);

Expand All @@ -117,20 +117,9 @@ describe(["@tier2"], "Application inventory filter validations", function () {
clickByText(button, clearAllFilters);

// Enter an exact existing name and assert
applySearchFilter(name, applicationsList[1].name);
applySearchFilter(appName, applicationsList[1].name);
cy.wait(2000);
exists(applicationsList[1].name);

clickByText(button, clearAllFilters);

// Enter a non-existing name substring and apply it as search filter
applySearchFilter(name, invalidSearchInput);
cy.wait(3000);

// Assert that no search results are found
cy.get("h2").contains("No applications available");

// Clear all filters
clickByText(button, clearAllFilters);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let stakeholderList: Array<Stakeholders> = [];
let applicationList: Array<Application> = [];
const yamlFile = "questionnaire_import/cloud-native.yaml";

describe(["@tier3"], "1 Bug: Tests related to application assessment and review", () => {
describe(["@tier3"], "Tests related to application assessment and review", () => {
before("Perform application assessment and review", function () {
login();
cy.intercept("GET", "/hub/application*").as("getApplication");
Expand Down Expand Up @@ -88,7 +88,7 @@ describe(["@tier3"], "1 Bug: Tests related to application assessment and review"
applicationList[0].verifyStatus("review", "Not started");
});

it("Bug MTA-1722: View archived questionnaire", function () {
it("View archived questionnaire", function () {
// Polarion TC MTA-392
const application = new Application(getRandomApplicationData());
application.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,19 @@ describe(["@tier1"], "Migration Waves Validations", () => {
.closest(MigrationWaveView.generalDatePicker)
.find(MigrationWaveView.calendarButton)
.click();
// Start date can be today's date and after.
cy.get(`button[aria-label="${nowDateLabel}"]`).should("be.enabled").click();

const tomorrow = new Date(now);
tomorrow.setDate(now.getDate() + 1);

const dateTomorrowLabel = new Intl.DateTimeFormat("en-GB", options).format(tomorrow);
// Start date should be greater than actual date
cy.get(`button[aria-label="${nowDateLabel}"]`).should("be.disabled");
cy.get(`button[aria-label="${dateTomorrowLabel}"]`).should("be.enabled").click();

cy.get(MigrationWaveView.endDateInput)
.closest(MigrationWaveView.generalDatePicker)
.find(MigrationWaveView.calendarButton)
.click(); // End date should be greater than start date
cy.get(`button[aria-label="${dateTomorrowLabel}"]`).should("be.disabled");
const dayAfterTomorrow = new Date(now);
dayAfterTomorrow.setDate(now.getDate() + 2);
const dayAfterTomorrowLabel = new Intl.DateTimeFormat("en-GB", options).format(
dayAfterTomorrow
);
cy.get(`button[aria-label="${dayAfterTomorrowLabel}"]`).should("be.enabled").click();

.click();
// End date should be greater than start date
cy.get(`button[aria-label="${nowDateLabel}"]`).should("be.disabled");
cy.get(`button[aria-label="${dateTomorrowLabel}"]`).should("be.enabled").click();
cy.get(commonView.submitButton).should("be.enabled");
clickJs(cancelButton);
});
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/tests/migration/reports/applicationRisk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ import {
} from "../../../../utils/utils";
import { verifyApplicationRisk } from "../../../models/migration/reports/reports";
import { navMenu } from "../../../views/menu.view";
import { migration, reports, SEC } from "../../../types/constants";
import { legacyPathfinder, migration, reports, SEC } from "../../../types/constants";
import { Stakeholders } from "../../../models/migration/controls/stakeholders";
import { Application } from "../../../models/migration/applicationinventory/application";
import { AssessmentQuestionnaire } from "../../../models/administration/assessment_questionnaire/assessment_questionnaire";

let stakeholdersList: Array<Stakeholders> = [];
let applicationsList: Array<Application> = [];

describe(["@tier2"], "1 Bug: Application risks tests", () => {
describe(["@tier2"], "Application risks tests", () => {
let riskType = ["low", "medium", "high"];

before("Login and Create Test Data", function () {
login();

AssessmentQuestionnaire.enable(legacyPathfinder);
stakeholdersList = createMultipleStakeholders(1);
applicationsList = createMultipleApplications(3);
for (let i = 0; i < applicationsList.length; i++) {
Expand All @@ -51,7 +52,7 @@ describe(["@tier2"], "1 Bug: Application risks tests", () => {
}
});

it("Bug MTA-1746: Application risk validation", function () {
it("Application risk validation", function () {
selectUserPerspective(migration);
clickByText(navMenu, reports);
cy.wait(3 * SEC);
Expand Down
17 changes: 0 additions & 17 deletions cypress/e2e/tests/rbac/upload_binary_analysis_architect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ describe(["@tier3"], "Upload Binary Analysis", () => {
application.verifyAnalysisStatus(AnalysisStatuses.completed);
});

it("DIVA report generation", function () {
const application = new Analysis(
getRandomApplicationData("DIVA"),
getRandomAnalysisData(this.analysisData["analysis_for_DIVA-report"])
);
application.create();
applications.push(application);
cy.wait("@getApplication");
cy.wait(2 * SEC);
// Need to log out as admin and login as Architect to perform analysis
logout();
userArchitect.login();

application.analyze();
application.verifyAnalysisStatus(AnalysisStatuses.completed);
});

afterEach("Persist session", function () {
Application.open(true);
});
Expand Down
18 changes: 0 additions & 18 deletions cypress/e2e/tests/rbac/upload_binary_analysis_migrator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,6 @@ describe.skip(["@tier3"], "Upload Binary Analysis", () => {
application.verifyAnalysisStatus(AnalysisStatuses.completed);
});

it("Bug MTA-1455: DIVA report generation", function () {
const application = new Analysis(
getRandomApplicationData("DIVA"),
getRandomAnalysisData(this.analysisData["analysis_for_DIVA-report"])
);
application.create();
applications.push(application);

cy.wait("@getApplication");
cy.wait(2 * SEC);
// Need to log out as admin and login as Architect to perform analysis
logout();
userMigrator.login();

application.analyze();
application.verifyAnalysisStatus(AnalysisStatuses.completed);
});

afterEach("Persist session", function () {
Application.open(true);
});
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const jobFunction = "Job function";
export const member = "Member";
export const memberCount = "Member count";
export const name = "Name";
export const appName = "Name";
export const next = "Next";
export const priority = "Priority";
export const question = "Question";
Expand Down
3 changes: 1 addition & 2 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@
"storyPoints": 5
},

"analysis_for_DIVA-report": {
"analysis_for_spring_petclinic_app": {
"source": "Upload a local binary",
"target": ["Jakarta EE 9"],
"binary": ["spring-petclinic-2.4.0.BUILD-SNAPSHOT.jar"],
"enableTransaction": true,
"appName": "spring-petclinic-2.4.0.BUILD-SNAPSHOT.jar",
"storyPoints": 42
},
Expand Down
Loading

0 comments on commit 9f783c8

Please sign in to comment.