From 605daf70abdf34849001cc78e7756c9eec6d0762 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 11:34:56 +0800 Subject: [PATCH] [discover] add wait for rendering historgram and disable home modals (#1302) (#1304) histogram can render slower than cypress selecting element but with the optimizations to the table this could have a slight race condition. also disable home modals when fleshing tenant settings Signed-off-by: Suchit Sahoo (cherry picked from commit d106cbbd97857e8c29896f46bec9763d694b8061) Co-authored-by: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com> --- .../data_explorer/discover_advanced_settings.spec.js | 11 ++++++++++- .../apps/data_explorer/discover_table.spec.js | 1 + cypress/utils/commands.js | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js index d95f9be45..58a5cd177 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js @@ -101,6 +101,7 @@ describe('discover_advanced_setting', () => { }); cy.reload(); cy.switchDiscoverTable('new'); + cy.wait(2000); // Intentional Wait to account for low performant env cy.get('.euiDataGridRowCell--date') .eq(0) @@ -123,6 +124,7 @@ describe('discover_advanced_setting', () => { }); cy.reload(); cy.switchDiscoverTable('new'); + cy.wait(2000); // Intentional Wait to account for low performant env cy.get('.euiDataGridRowCell--date') .eq(0) @@ -144,6 +146,7 @@ describe('discover_advanced_setting', () => { 'discover:sort:defaultOrder': 'desc', }); cy.reload(); + cy.wait(2000); // Intentional Wait to account for low performant env cy.get('[data-test-subj="docTableField"]') .eq(0) @@ -163,6 +166,7 @@ describe('discover_advanced_setting', () => { 'discover:sort:defaultOrder': 'asc', }); cy.reload(); + cy.wait(2000); // Intentional Wait to account for low performant env cy.get('[data-test-subj="docTableField"]') .eq(0) @@ -192,6 +196,7 @@ describe('discover_advanced_setting', () => { }); cy.reload(); cy.switchDiscoverTable('new'); + cy.wait(2000); // Intentional Wait to account for low performant env }); it('check new table respects Number of rows setting', function () { @@ -203,6 +208,7 @@ describe('discover_advanced_setting', () => { it('check legacy table respects Number of rows setting', function () { cy.switchDiscoverTable('legacy'); + cy.wait(2000); // Intentional Wait to account for low performant env cy.get('[aria-label="Next"]').should('have.length', 5); }); @@ -326,7 +332,8 @@ describe('discover_advanced_setting', () => { 'doc_table:highlight': false, }); cy.reload(); - // cy.switchDiscoverTable("legacy"); + cy.wait(2000); // Intentional Wait to account for low performant env + cy.get('mark').should('not.exist'); // reset the setting to default value @@ -373,6 +380,8 @@ describe('discover_advanced_setting', () => { defaultColumns: ['host', 'agent'], }); cy.reload(); + cy.wait(2000); // Intentional Wait to account for low performant env + cy.get('[data-test-subj="docTableHeader-agent"]').should('be.visible'); cy.get('[data-test-subj="docTableHeader-host"]').should('be.visible'); }); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js index 601138468..e21421b7f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js @@ -97,6 +97,7 @@ describe('discover_table', () => { describe('expand multiple documents in legacy table', () => { before(() => { cy.switchDiscoverTable('legacy'); + cy.wait(2000); // Intentional Wait to account for low performant env }); it('checks if multiple documents can be expanded in legacy table', function () { diff --git a/cypress/utils/commands.js b/cypress/utils/commands.js index a603184de..7271061f1 100644 --- a/cypress/utils/commands.js +++ b/cypress/utils/commands.js @@ -590,6 +590,8 @@ Cypress.Commands.add('loadSampleData', (type) => { Cypress.Commands.add('fleshTenantSettings', () => { if (Cypress.env('SECURITY_ENABLED')) { + localStorage.setItem('home:newThemeModal:show', 'false'); + localStorage.setItem('home:welcome:show', 'false'); // Go to the home page to flesh the tenant settings cy.visit(`/app/home`); cy.waitForLoader();