Skip to content

Commit e664601

Browse files
author
Adam Tackett
committed
fix flaky test5
Signed-off-by: Adam Tackett <tackadam@amazon.com>
1 parent d30a17b commit e664601

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.cypress/integration/notebooks_test/notebooks.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ describe('Testing paragraphs', () => {
394394
cy.get('h3[data-test-subj="notebookTitle"]').contains(TEST_NOTEBOOK).should('exist');
395395

396396
// Ensure button is visible and enabled before clicking
397-
cy.get('.euiButton__text').contains('Run all paragraphs').should('be.visible').parent('button').should('not.be.disabled');
398-
cy.get('.euiButton__text').contains('Run all paragraphs').click();
397+
cy.contains('button', 'Run all paragraphs').should('be.visible').and('not.be.disabled');
398+
cy.contains('button', 'Run all paragraphs').click();
399399

400400
// Wait for execution to complete
401401
cy.get('[data-test-subj="globalLoadingIndicator"]', { timeout: 60000 }).should('not.exist');

.cypress/integration/trace_analytics_test/trace_analytics_services.spec.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,17 @@ describe('Testing navigation from Services to Traces', () => {
476476
});
477477
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
478478

479-
cy.get("[data-test-subj='indexPattern-switch-link']").click();
479+
// Wait for services table to be fully rendered before interacting
480+
cy.get('.euiTableRow', { timeout: 15000 }).should('have.length.greaterThan', 0);
481+
482+
cy.get("[data-test-subj='indexPattern-switch-link']").should('be.visible').click();
480483
cy.get("[data-test-subj='data_prepper-mode']").click();
481484
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
482485
setTimeFilter();
483486
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
487+
488+
// Wait for table to reload with data prepper data
489+
cy.get('.euiTableRow', { timeout: 15000 }).should('have.length.greaterThan', 0);
484490
});
485491

486492
it('Clicks on the "Traces" shortcut to redirect', () => {
@@ -546,12 +552,22 @@ describe('Testing switch mode to jaeger', () => {
546552
});
547553

548554
it('Verifies traces links to traces page with filter applied', () => {
549-
cy.get('.euiTableRow').should('have.length.lessThan', 7); //Replaces Wait
555+
// Wait for table to have data loaded
556+
cy.get('.euiTableRow', { timeout: 15000 }).should('have.length.greaterThan', 0);
557+
cy.get('.euiTableRow').should('have.length.lessThan', 7);
558+
550559
cy.contains('7').should('exist');
551-
cy.get('[data-test-subj^="service-traces-redirection-btntrace_"]').first().click();
560+
cy.get('[data-test-subj^="service-traces-redirection-btntrace_"]').first().should('be.visible').click();
552561
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
553-
cy.contains(' (7)').should('exist');
562+
563+
// Wait for traces page to load
564+
cy.contains(' (7)', { timeout: 15000 }).should('exist');
565+
566+
// Wait for filter badge to appear and verify content
554567
cy.get("[data-test-subj='filterBadge']", { timeout: 15000 })
568+
.should('have.length.greaterThan', 0);
569+
570+
cy.get("[data-test-subj='filterBadge']")
555571
.eq(0)
556572
.should('contain', 'process.serviceName')
557573
.and('contain', 'customer');

0 commit comments

Comments
 (0)