Skip to content

Commit 605daf7

Browse files
[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 <[email protected]> (cherry picked from commit d106cbb) Co-authored-by: Suchit Sahoo <[email protected]>
1 parent 43b4fa6 commit 605daf7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ describe('discover_advanced_setting', () => {
101101
});
102102
cy.reload();
103103
cy.switchDiscoverTable('new');
104+
cy.wait(2000); // Intentional Wait to account for low performant env
104105

105106
cy.get('.euiDataGridRowCell--date')
106107
.eq(0)
@@ -123,6 +124,7 @@ describe('discover_advanced_setting', () => {
123124
});
124125
cy.reload();
125126
cy.switchDiscoverTable('new');
127+
cy.wait(2000); // Intentional Wait to account for low performant env
126128

127129
cy.get('.euiDataGridRowCell--date')
128130
.eq(0)
@@ -144,6 +146,7 @@ describe('discover_advanced_setting', () => {
144146
'discover:sort:defaultOrder': 'desc',
145147
});
146148
cy.reload();
149+
cy.wait(2000); // Intentional Wait to account for low performant env
147150

148151
cy.get('[data-test-subj="docTableField"]')
149152
.eq(0)
@@ -163,6 +166,7 @@ describe('discover_advanced_setting', () => {
163166
'discover:sort:defaultOrder': 'asc',
164167
});
165168
cy.reload();
169+
cy.wait(2000); // Intentional Wait to account for low performant env
166170

167171
cy.get('[data-test-subj="docTableField"]')
168172
.eq(0)
@@ -192,6 +196,7 @@ describe('discover_advanced_setting', () => {
192196
});
193197
cy.reload();
194198
cy.switchDiscoverTable('new');
199+
cy.wait(2000); // Intentional Wait to account for low performant env
195200
});
196201

197202
it('check new table respects Number of rows setting', function () {
@@ -203,6 +208,7 @@ describe('discover_advanced_setting', () => {
203208

204209
it('check legacy table respects Number of rows setting', function () {
205210
cy.switchDiscoverTable('legacy');
211+
cy.wait(2000); // Intentional Wait to account for low performant env
206212
cy.get('[aria-label="Next"]').should('have.length', 5);
207213
});
208214

@@ -326,7 +332,8 @@ describe('discover_advanced_setting', () => {
326332
'doc_table:highlight': false,
327333
});
328334
cy.reload();
329-
// cy.switchDiscoverTable("legacy");
335+
cy.wait(2000); // Intentional Wait to account for low performant env
336+
330337
cy.get('mark').should('not.exist');
331338

332339
// reset the setting to default value
@@ -373,6 +380,8 @@ describe('discover_advanced_setting', () => {
373380
defaultColumns: ['host', 'agent'],
374381
});
375382
cy.reload();
383+
cy.wait(2000); // Intentional Wait to account for low performant env
384+
376385
cy.get('[data-test-subj="docTableHeader-agent"]').should('be.visible');
377386
cy.get('[data-test-subj="docTableHeader-host"]').should('be.visible');
378387
});

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe('discover_table', () => {
9797
describe('expand multiple documents in legacy table', () => {
9898
before(() => {
9999
cy.switchDiscoverTable('legacy');
100+
cy.wait(2000); // Intentional Wait to account for low performant env
100101
});
101102

102103
it('checks if multiple documents can be expanded in legacy table', function () {

cypress/utils/commands.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ Cypress.Commands.add('loadSampleData', (type) => {
590590

591591
Cypress.Commands.add('fleshTenantSettings', () => {
592592
if (Cypress.env('SECURITY_ENABLED')) {
593+
localStorage.setItem('home:newThemeModal:show', 'false');
594+
localStorage.setItem('home:welcome:show', 'false');
593595
// Go to the home page to flesh the tenant settings
594596
cy.visit(`/app/home`);
595597
cy.waitForLoader();

0 commit comments

Comments
 (0)