[Defend Workflows] Rewrite visitRuleActions to make tests more stable (#157691)

This commit is contained in:
Tomasz Ciecierski 2023-05-15 22:48:00 +02:00 committed by GitHub
parent c322ac5048
commit 49c77f22cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View file

@ -150,8 +150,7 @@ describe('Response actions', () => {
cleanupRule(ruleId);
});
// FLAKY: https://github.com/elastic/security-team/issues/6518
it.skip('All response action controls are disabled', () => {
it('All response action controls are disabled', () => {
visitRuleActions(ruleId);
cy.getByTestSubj('response-actions-wrapper').within(() => {
cy.getByTestSubj('Endpoint Security-response-action-type-selection-option').should(

View file

@ -50,15 +50,7 @@ export const fillUpNewRule = (name = 'Test', description = 'Test') => {
export const visitRuleActions = (ruleId: string) => {
cy.visit(`app/security/rules/id/${ruleId}/edit`);
cy.getByTestSubj('edit-rule-actions-tab').should('exist');
// strange rerendering behaviour. the following make sure the test doesn't fail
cy.get('body').then(($body) => {
if ($body.find('[data-test-subj="globalLoadingIndicator"]').length) {
cy.getByTestSubj('globalLoadingIndicator').should('exist');
cy.getByTestSubj('globalLoadingIndicator').should('not.exist');
}
cy.getByTestSubj('globalLoadingIndicator').should('not.exist');
});
cy.getByTestSubj('globalLoadingIndicator').should('not.exist');
cy.getByTestSubj('edit-rule-actions-tab').click();
};
export const tryAddingDisabledResponseAction = (itemNumber = 0) => {