Skip to content

Commit

Permalink
Fix cypress even better
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Nov 4, 2021
1 parent 57f27d7 commit 718e14e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ALERT_FLYOUT, CELL_TEXT, JSON_TEXT, TABLE_ROWS } from '../../screens/al

import {
expandFirstAlert,
refreshAlerts,
waitForAlertsIndexToBeCreated,
waitForAlertsPanelToBeLoaded,
} from '../../tasks/alerts';
Expand All @@ -32,6 +33,7 @@ describe('Alert details with unmapped fields', () => {
createCustomRuleActivated(getUnmappedRule());
loginAndWaitForPageWithoutDateRange(ALERTS_URL);
waitForAlertsPanelToBeLoaded();
refreshAlerts();
expandFirstAlert();
});

Expand Down
5 changes: 4 additions & 1 deletion x-pack/plugins/security_solution/cypress/tasks/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ export const goToOpenedAlerts = () => {
cy.get(LOADING_INDICATOR).should('not.exist');
};

export const openFirstAlert = () => {
export const refreshAlerts = () => {
// ensure we've refetched fields the first time index is defined
cy.get(REFRESH_BUTTON).should('have.text', 'Refresh');
cy.get(REFRESH_BUTTON).first().click({ force: true });
};

export const openFirstAlert = () => {
cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true });
cy.get(OPEN_ALERT_BTN).click();
};
Expand Down

0 comments on commit 718e14e

Please sign in to comment.