Skip to content

Commit 8c3ac2f

Browse files
Fix Flaky Discover Table Tests (#1377) (#1379)
Signed-off-by: Suchit Sahoo <[email protected]> (cherry picked from commit c8cbf04) Co-authored-by: Suchit Sahoo <[email protected]>
1 parent 8854a87 commit 8c3ac2f

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -408,22 +408,27 @@ describe('discover_table', () => {
408408
describe('AutoSize table', () => {
409409
describe('Legacy Table', () => {
410410
it('check table Auto Size with change in time range', function () {
411-
cy.get('[aria-label="Next"]')
411+
cy.get('[data-test-subj="docTableExpandToggleColumn"]')
412412
.its('length')
413413
.then((noEntries) => {
414414
cy.setTopNavDate(
415415
'Sep 22, 2015 @ 14:00:00.000',
416-
'Sep 22, 2015 @ 18:00:00.000'
416+
'Sep 22, 2015 @ 14:05:00.000'
417417
);
418-
cy.waitForLoader();
419-
cy.get('[aria-label="Next"]')
418+
cy.verifyHitCount('2'); // Intentional Wait
419+
cy.get('[data-test-subj="docTableExpandToggleColumn"]')
420420
.its('length')
421421
.should('be.lessThan', noEntries);
422422
});
423423
});
424424

425425
it('check table Auto Size with filter', function () {
426-
cy.get('[aria-label="Next"]')
426+
cy.setTopNavDate(
427+
'Sep 22, 2015 @ 14:00:00.000',
428+
'Sep 22, 2015 @ 18:00:00.000'
429+
);
430+
cy.waitForLoader(); // Intentional Wait
431+
cy.get('[aria-label="Toggle row details"]')
427432
.its('length')
428433
.then((noEntries) => {
429434
cy.get('[data-test-subj="field-extension-showDetails"]')
@@ -432,8 +437,8 @@ describe('discover_table', () => {
432437
cy.get('[data-test-subj="plus-extension-gif"]')
433438
.click()
434439
.then(() => {
435-
cy.wait(2000);
436-
cy.get('[aria-label="Next"]')
440+
cy.verifyHitCount('1'); // Intentional Wait
441+
cy.get('[aria-label="Toggle row details"]')
437442
.its('length')
438443
.should('be.lessThan', noEntries);
439444
});
@@ -459,9 +464,9 @@ describe('discover_table', () => {
459464
.then((noEntries) => {
460465
cy.setTopNavDate(
461466
'Sep 22, 2015 @ 14:00:00.000',
462-
'Sep 22, 2015 @ 18:00:00.000'
467+
'Sep 22, 2015 @ 14:30:00.000'
463468
);
464-
cy.waitForLoader();
469+
cy.verifyHitCount('7');
465470
cy.get('[aria-label="Inspect document details"]')
466471
.its('length')
467472
.should('be.lessThan', noEntries);
@@ -475,11 +480,11 @@ describe('discover_table', () => {
475480
cy.get('[data-test-subj="field-extension-showDetails"]')
476481
.trigger('click')
477482
.then(() => {
478-
cy.get('[data-test-subj="plus-extension-gif"]')
483+
cy.get('[data-test-subj="plus-extension-css"]')
479484
.trigger('click')
480485
.then(() => {
481-
cy.switchDiscoverTable('new');
482-
cy.get('[aria-label="Inspect document details"]')
486+
cy.verifyHitCount('4');
487+
cy.get('[aria-label="Toggle row details"]')
483488
.its('length')
484489
.should('be.lessThan', noEntries);
485490
});

0 commit comments

Comments
 (0)