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

This commit is contained in:
Tomasz Ciecierski 2023-05-16 09:59:34 +02:00 committed by GitHub
parent 314cc18584
commit 5e2ac5429b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -99,8 +99,7 @@ describe('Response actions', () => {
cleanupRule(ruleId);
});
// Flaky
it.skip('edit response action inside of a rule', () => {
it('edit response action inside of a rule', () => {
visitRuleActions(ruleId);
cy.getByTestSubj(`response-actions-list-item-0`).within(() => {
cy.getByTestSubj('input').should('have.value', 'Isolate host');
@ -124,8 +123,7 @@ describe('Response actions', () => {
cy.contains(`${ruleName} was saved`).should('exist');
});
// Flaky
it.skip('delete response action inside of a rule', () => {
it('delete response action inside of a rule', () => {
visitRuleActions(ruleId);
cy.getByTestSubj(`response-actions-list-item-0`).within(() => {
cy.getByTestSubj('remove-response-action').click();
@ -152,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

@ -49,7 +49,9 @@ 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').wait(500).click();
cy.getByTestSubj('edit-rule-actions-tab').should('exist');
cy.getByTestSubj('globalLoadingIndicator').should('not.exist');
cy.getByTestSubj('edit-rule-actions-tab').click();
};
export const tryAddingDisabledResponseAction = (itemNumber = 0) => {
cy.getByTestSubj('response-actions-wrapper').within(() => {