diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts index e03e70dcd8535..661ee1850bd85 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts @@ -10,7 +10,7 @@ import { GLOBAL_SEARCH_BAR_FILTER_ITEM } from '../../../screens/search_bar'; import { DATA_PROVIDERS } from '../../../screens/timeline'; import { login } from '../../../tasks/login'; -import { visit } from '../../../tasks/navigation'; +import { visitWithTimeRange } from '../../../tasks/navigation'; import { NETWORK_URL } from '../../../urls/navigation'; import { clickOnAddToTimeline, @@ -18,15 +18,13 @@ import { clickOnFilterIn, clickOnFilterOut, clickOnShowTopN, - mouseoverOnToOverflowItem, - openHoverActions, + withHoverActionsReady, } from '../../../tasks/network/flows'; import { openTimelineUsingToggle } from '../../../tasks/security_main'; const testDomain = 'myTest'; -// tracked by https://github.com/elastic/kibana/issues/161874 -describe.skip('Hover actions', { tags: ['@ess', '@serverless'] }, () => { +describe('Hover actions', { tags: ['@ess', '@serverless'] }, () => { const onBeforeLoadCallback = (win: Cypress.AUTWindow) => { // avoid cypress being held by windows prompt and timeout cy.stub(win, 'prompt').returns(true); @@ -42,9 +40,8 @@ describe.skip('Hover actions', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); - visit(NETWORK_URL, { visitOptions: { onBeforeLoad: onBeforeLoadCallback } }); - openHoverActions(); - mouseoverOnToOverflowItem(); + visitWithTimeRange(NETWORK_URL, { visitOptions: { onBeforeLoad: onBeforeLoadCallback } }); + withHoverActionsReady(); }); it('Adds global filter - filter in', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/overflow_items.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/overflow_items.cy.ts index 22c242f63e887..41df26cf36337 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/overflow_items.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/overflow_items.cy.ts @@ -16,16 +16,14 @@ import { import { login } from '../../../tasks/login'; import { visitWithTimeRange } from '../../../tasks/navigation'; -import { mouseoverOnToOverflowItem, openHoverActions } from '../../../tasks/network/flows'; +import { withHoverActionsReady } from '../../../tasks/network/flows'; import { NETWORK_URL } from '../../../urls/navigation'; const testDomainOne = 'myTest'; const testDomainTwo = 'myTest2'; -// FLAKY: https://github.com/elastic/kibana/issues/165692 -// Tracked by https://github.com/elastic/security-team/issues/7696 -describe.skip('Overflow items', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Overflow items', { tags: ['@ess', '@serverless'] }, () => { context('Network stats and tables', () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'network' }); @@ -41,8 +39,7 @@ describe.skip('Overflow items', { tags: ['@ess', '@serverless', '@brokenInServer cy.get(SHOW_TOP_FIELD).should('not.exist'); cy.get(COPY).should('not.exist'); - openHoverActions(); - mouseoverOnToOverflowItem(); + withHoverActionsReady(); }); after(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/network/flows.ts b/x-pack/test/security_solution_cypress/cypress/tasks/network/flows.ts index 5aa9ae55688cc..94338e182fc6f 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/network/flows.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/network/flows.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { recurse } from 'cypress-recurse'; import { ADD_TO_TIMELINE, COPY, @@ -50,3 +51,23 @@ export const clickOnCopyValue = () => { cy.get(COPY).first().focus(); cy.focused().click(); // eslint-disable-line cypress/unsafe-to-chain-command }; + +export function withHoverActionsReady() { + const actionsButtonInPortal = '[data-euiportal="true"] button[data-test-subj*="cellActions"]'; + recurse( + () => { + openHoverActions(); + mouseoverOnToOverflowItem(); + return cy.get('body').then(($body) => { + return $body.find(actionsButtonInPortal); + }); + }, + // Check if actions portal element is visible + ($el) => { + return $el.length > 0; + }, + { + delay: 500, + } + ); +}