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

[CloudSecurity] Fixing Detection Rule FTR tests #186667

Merged
merged 2 commits into from
Jun 25, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
pageObjects.header.waitUntilLoadingHasFinished();
});

// FLAKY: https://github.com/elastic/kibana/issues/168991
describe.skip('Create detection rule', () => {
describe('Create detection rule', () => {
it('Creates a detection rule from the Take Action button and navigates to rule page', async () => {
await latestFindingsTable.openFlyoutAt(0);
await misconfigurationsFlyout.clickTakeActionCreateRuleButton();
Expand All @@ -167,6 +166,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

await testSubjects.click('csp:toast-success-link');

await pageObjects.header.waitUntilLoadingHasFinished();
const rulePageTitle = await testSubjects.find('header-page-title');
expect(await rulePageTitle.getVisibleText()).to.be(ruleName1);
});
Expand All @@ -193,7 +193,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
expect(await toastMessageTitle.getVisibleText()).to.be(ruleName1);

await testSubjects.click('csp:toast-success-link');

await pageObjects.header.waitUntilLoadingHasFinished();
const rulePageTitle = await testSubjects.find('header-page-title');
expect(await rulePageTitle.getVisibleText()).to.be(ruleName1);
});
Expand All @@ -204,7 +204,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await misconfigurationsFlyout.clickTakeActionCreateRuleButton();

await testSubjects.click('csp:toast-success-link');

await pageObjects.header.waitUntilLoadingHasFinished();
const rulePageDescription = await testSubjects.find(
'stepAboutRuleDetailsToggleDescriptionText'
);
Expand All @@ -223,15 +223,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await misconfigurationsFlyout.clickTakeActionCreateRuleButton();
const flyout = await misconfigurationsFlyout.getElement();
await (await flyout.findByTestSubject('csp:findings-flyout-detection-rule-count')).click();

await pageObjects.header.waitUntilLoadingHasFinished();
expect(await (await testSubjects.find('ruleName')).getVisibleText()).to.be(ruleName1);
});
it('Clicking on count of Alerts should navigate to the alerts page', async () => {
await latestFindingsTable.openFlyoutAt(0);
await misconfigurationsFlyout.clickTakeActionCreateRuleButton();
const flyout = await misconfigurationsFlyout.getElement();
await (await flyout.findByTestSubject('csp:findings-flyout-alert-count')).click();

await pageObjects.header.waitUntilLoadingHasFinished();
expect(await (await testSubjects.find('header-page-title')).getVisibleText()).to.be(
'Alerts'
);
Expand Down