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

[Security Solution][Detections]Fixes Rule Management Cypress Tests #96505

Merged
merged 3 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
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 @@ -14,11 +14,7 @@ import {
SHOWING_RULES_TEXT,
} from '../../screens/alerts_detection_rules';

import {
goToManageAlertsDetectionRules,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
import {
changeRowsPerPageTo300,
deleteFirstRule,
Expand Down Expand Up @@ -47,7 +43,6 @@ describe('Alerts rules, prebuilt rules', () => {
const expectedElasticRulesBtnText = `Elastic rules (${expectedNumberOfRules})`;

loginAndWaitForPageWithoutDateRange(DETECTIONS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
Expand Down Expand Up @@ -79,7 +74,6 @@ describe('Deleting prebuilt rules', () => {

cleanKibana();
loginAndWaitForPageWithoutDateRange(DETECTIONS_URL);
waitForAlertsPanelToBeLoaded();
waitForAlertsIndexToBeCreated();
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ export const resetAllRulesIdleModalTimeout = () => {

export const changeRowsPerPageTo = (rowsCount: number) => {
cy.get(PAGINATION_POPOVER_BTN).click({ force: true });
cy.get(rowsPerPageSelector(rowsCount)).click();
cy.get(rowsPerPageSelector(rowsCount))
Copy link
Contributor

Choose a reason for hiding this comment

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

Click until we see the desired effect, the effect here being "element is not visible," indicating that the click was received and thus the popover was hidden.

In this way, we avoid the issue at hand, where we were trying to click an element as it was animated/redrawing. 👍

.pipe(($el) => $el.trigger('click'))
.should('not.be.visible');

waitForRulesTableToBeRefreshed();
};

Expand Down