Skip to content

Commit

Permalink
clicking on add to existing case should open a modal
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Oct 12, 2021
1 parent b4565d6 commit b9649ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions x-pack/test/functional/services/observability/alerts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const ACTION_COLUMN_INDEX = 1;
const ADD_TO_EXISTING_CASE_SELECTOR = 'add-existing-case-menu-item';
const ADD_TO_NEW_CASE_SELECTOR = 'add-new-case-item';
const CREATE_CASE_FLYOUT = 'create-case-flyout';
const SELECT_CASE_MODAL = 'all-cases-modal';

type WorkflowStatus = 'open' | 'acknowledged' | 'closed';

Expand Down Expand Up @@ -213,10 +214,22 @@ export function ObservabilityAlertsCommonProvider({
return await (await getAddToNewCaseSelector()).click();
};

const addToExistingCaseButtonClick = async () => {
return await (await getAddToExistingCaseSelector()).click();
};

const getCreateCaseFlyoutOrFail = async () => {
return await testSubjects.existOrFail(CREATE_CASE_FLYOUT);
};

const closeFlyout = async () => {
return await (await testSubjects.find('euiFlyoutCloseButton')).click();
};

const getAddtoExistingCaseModalOrFail = async () => {
return await testSubjects.existOrFail(SELECT_CASE_MODAL);
};

return {
getQueryBar,
clearQueryBar,
Expand Down Expand Up @@ -249,6 +262,9 @@ export function ObservabilityAlertsCommonProvider({
getAddToNewCaseSelectorOrFail,
missingAddToNewCaseSelectorOrFail,
getCreateCaseFlyoutOrFail,
closeFlyout,
addToNewCaseButtonClick,
addToExistingCaseButtonClick,
getAddtoExistingCaseModalOrFail,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
await observability.alerts.common.openActionsMenuForRow(0);
await observability.alerts.common.addToNewCaseButtonClick();
await observability.alerts.common.getCreateCaseFlyoutOrFail();
await observability.alerts.common.closeFlyout();
});
});

it('opens a modal when Add to existing case is clicked', async () => {});
it('opens a modal when Add to existing case is clicked', async () => {
await retry.try(async () => {
await observability.alerts.common.openActionsMenuForRow(0);
await observability.alerts.common.addToExistingCaseButtonClick();
await observability.alerts.common.getAddtoExistingCaseModalOrFail();
});
});
});

describe('When user has read permissions for cases', () => {
Expand Down

0 comments on commit b9649ba

Please sign in to comment.