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]marking mta bug for test and adding success message check #728

Merged
merged 2 commits into from
Oct 5, 2023
Merged
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
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(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for late comment.

We are adding these message checks only once in a test so that if message changes only one test fails .
So in the CRUD test we assert for success create , edit and delete messages .
Not in any other tests.
Please remove them in a separate PR .

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah but this is the CRUD test, I may be missing something but I think this is the place to check for notifications.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I know all are crud tests in this file but validation in one test is good.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh ok, makes sense, thanks for clarifying

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