From 21ed69f35434209d04fb3189365d4da043b331d0 Mon Sep 17 00:00:00 2001
From: "miriam.aparicio" <miriam.aparicio@gmail.com>
Date: Thu, 24 Oct 2024 16:04:35 +0100
Subject: [PATCH] unskipp test suite, improve the wait()

---
 .../e2e/storage_explorer/storage_explorer.cy.ts    | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts
index 519f309105f54..c509e316543ca 100644
--- a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts
+++ b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts
@@ -36,8 +36,8 @@ const mainApiRequestsToIntercept = [
 ];
 
 const mainAliasNames = mainApiRequestsToIntercept.map(({ aliasName }) => `@${aliasName}`);
-// flaky test
-describe.skip('Storage Explorer', () => {
+
+describe('Storage Explorer', () => {
   before(() => {
     const { rangeFrom, rangeTo } = timeRange;
     synthtrace.index(
@@ -111,11 +111,10 @@ describe.skip('Storage Explorer', () => {
 
       cy.loginAsMonitorUser();
       cy.visitKibana(storageExplorerHref);
+      cy.wait(mainAliasNames);
     });
 
     it('with the correct environment when changing the environment', () => {
-      cy.wait(mainAliasNames);
-
       cy.getByTestSubj('environmentFilter').type('{selectall}production');
 
       cy.contains('button', 'production').click({ force: true });
@@ -127,19 +126,14 @@ describe.skip('Storage Explorer', () => {
     });
 
     it('when selecting a different time range and clicking the update button', () => {
-      cy.wait(mainAliasNames);
-
       cy.selectAbsoluteTimeRange(
         moment(timeRange.rangeFrom).subtract(5, 'm').toISOString(),
         moment(timeRange.rangeTo).subtract(5, 'm').toISOString()
       );
       cy.contains('Update').click();
-      cy.wait(mainAliasNames);
     });
 
     it('with the correct lifecycle phase when changing the lifecycle phase', () => {
-      cy.wait(mainAliasNames);
-
       cy.getByTestSubj('storageExplorerLifecyclePhaseSelect').click();
       cy.contains('button', 'Warm').click();
 
@@ -166,10 +160,10 @@ describe.skip('Storage Explorer', () => {
 
       cy.loginAsMonitorUser();
       cy.visitKibana(storageExplorerHref);
+      cy.wait(mainAliasNames);
     });
 
     it('shows storage details', () => {
-      cy.wait(mainAliasNames);
       cy.contains('opbeans-node');
 
       cy.getByTestSubj('storageDetailsButton_opbeans-node').click();