Skip to content

Commit

Permalink
Fix Flaky Discover Table Tests (#1377) (#1379)
Browse files Browse the repository at this point in the history
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
(cherry picked from commit c8cbf04)

Co-authored-by: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com>
  • Loading branch information
opensearch-trigger-bot[bot] and LDrago27 authored Jun 12, 2024
1 parent 8854a87 commit 8c3ac2f
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,27 @@ describe('discover_table', () => {
describe('AutoSize table', () => {
describe('Legacy Table', () => {
it('check table Auto Size with change in time range', function () {
cy.get('[aria-label="Next"]')
cy.get('[data-test-subj="docTableExpandToggleColumn"]')
.its('length')
.then((noEntries) => {
cy.setTopNavDate(
'Sep 22, 2015 @ 14:00:00.000',
'Sep 22, 2015 @ 18:00:00.000'
'Sep 22, 2015 @ 14:05:00.000'
);
cy.waitForLoader();
cy.get('[aria-label="Next"]')
cy.verifyHitCount('2'); // Intentional Wait
cy.get('[data-test-subj="docTableExpandToggleColumn"]')
.its('length')
.should('be.lessThan', noEntries);
});
});

it('check table Auto Size with filter', function () {
cy.get('[aria-label="Next"]')
cy.setTopNavDate(
'Sep 22, 2015 @ 14:00:00.000',
'Sep 22, 2015 @ 18:00:00.000'
);
cy.waitForLoader(); // Intentional Wait
cy.get('[aria-label="Toggle row details"]')
.its('length')
.then((noEntries) => {
cy.get('[data-test-subj="field-extension-showDetails"]')
Expand All @@ -432,8 +437,8 @@ describe('discover_table', () => {
cy.get('[data-test-subj="plus-extension-gif"]')
.click()
.then(() => {
cy.wait(2000);
cy.get('[aria-label="Next"]')
cy.verifyHitCount('1'); // Intentional Wait
cy.get('[aria-label="Toggle row details"]')
.its('length')
.should('be.lessThan', noEntries);
});
Expand All @@ -459,9 +464,9 @@ describe('discover_table', () => {
.then((noEntries) => {
cy.setTopNavDate(
'Sep 22, 2015 @ 14:00:00.000',
'Sep 22, 2015 @ 18:00:00.000'
'Sep 22, 2015 @ 14:30:00.000'
);
cy.waitForLoader();
cy.verifyHitCount('7');
cy.get('[aria-label="Inspect document details"]')
.its('length')
.should('be.lessThan', noEntries);
Expand All @@ -475,11 +480,11 @@ describe('discover_table', () => {
cy.get('[data-test-subj="field-extension-showDetails"]')
.trigger('click')
.then(() => {
cy.get('[data-test-subj="plus-extension-gif"]')
cy.get('[data-test-subj="plus-extension-css"]')
.trigger('click')
.then(() => {
cy.switchDiscoverTable('new');
cy.get('[aria-label="Inspect document details"]')
cy.verifyHitCount('4');
cy.get('[aria-label="Toggle row details"]')
.its('length')
.should('be.lessThan', noEntries);
});
Expand Down

0 comments on commit 8c3ac2f

Please sign in to comment.