Skip to content

Commit

Permalink
marking mta bug for test and adding success message check (#728)
Browse files Browse the repository at this point in the history
* marking mta bug for test and adding success message check

Signed-off-by: Neilhamza <[email protected]>

* correct delete message

Signed-off-by: Neilhamza <[email protected]>

---------

Signed-off-by: Neilhamza <[email protected]>
  • Loading branch information
Neilhamza authored Oct 5, 2023
1 parent 80a8ee3 commit 40289a5
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions cypress/e2e/tests/migration/controls/businessservices/crud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@ limitations under the License.
*/
/// <reference types="cypress" />

import { exists, login, notExists, selectUserPerspective } from "../../../../../utils/utils";
import {
checkSuccessAlert,
exists,
login,
notExists,
selectUserPerspective,
} from "../../../../../utils/utils";
import { BusinessServices } from "../../../../models/migration/controls/businessservices";
import { Stakeholders } from "../../../../models/migration/controls/stakeholders";

import * as data from "../../../../../utils/data_utils";
import { migration } from "../../../../types/constants";
import { stakeHoldersTable } from "../../../../views/stakeholders.view";
import * as commonView from "../../../../views/common.view";

describe(["@tier1", "@interop"], "Business service CRUD operations", () => {
before("Login", function () {
Expand All @@ -45,12 +52,20 @@ describe(["@tier1", "@interop"], "Business service CRUD operations", () => {

// Create new Business service
businessService.create();
checkSuccessAlert(
commonView.successAlertMessage,
`Success alert:Business service ${businessService.name} was successfully created.`
);
cy.wait("@postBusinessService");
exists(businessService.name);

// Edit Business service's name
let updatedBusinessServiceName = data.getCompanyName();
businessService.edit({ name: updatedBusinessServiceName });
checkSuccessAlert(
commonView.successAlertMessage,
`Success alert:Business service ${businessService.name} was successfully saved.`
);
cy.wait("@getBusinessService");
exists(updatedBusinessServiceName);

Expand All @@ -62,7 +77,7 @@ describe(["@tier1", "@interop"], "Business service CRUD operations", () => {
notExists(businessService.name);
});

it("Business service CRUD with owner", function () {
it("Bug MTA-1375: Business service CRUD with owner", function () {
selectUserPerspective(migration);

// Create owner - stakeholder
Expand All @@ -77,24 +92,34 @@ describe(["@tier1", "@interop"], "Business service CRUD operations", () => {
stakeholder.name
);
businessService.create();
checkSuccessAlert(
commonView.successAlertMessage,
`Success alert:Business service ${businessService.name} was successfully created.`
);
cy.wait("@postBusinessService");
exists(businessService.name);

// Edit Business service's name
let updatedBusinessServiceName = data.getCompanyName();
businessService.edit({ name: updatedBusinessServiceName });
checkSuccessAlert(
commonView.successAlertMessage,
`Success alert:Business service ${businessService.name} was successfully saved.`
);
cy.wait("@getBusinessService");
exists(updatedBusinessServiceName);

// Delete Business service
businessService.delete();
checkSuccessAlert(commonView.successAlertMessage, `Success alert:Business service deleted`);
cy.wait("@getBusinessService");

// Assert that Business service is deleted
notExists(businessService.name);

// Delete stakeholder owner
stakeholder.delete();
checkSuccessAlert(commonView.successAlertMessage, `Success alert:Stakeholder deleted`);
cy.wait("@getStakeholders");

// Assert that stakeholder owner is deleted
Expand Down

0 comments on commit 40289a5

Please sign in to comment.