Skip to content

Commit

Permalink
Cypress testing fixes for 4_trace_analytics_dashboards
Browse files Browse the repository at this point in the history
Signed-off-by: TackAdam <[email protected]>
  • Loading branch information
TackAdam committed May 25, 2023
1 parent 6f653e2 commit c8a6e8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
21 changes: 7 additions & 14 deletions .cypress/integration/4_trace_analytics_dashboard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe('Testing dashboard table empty state', () => {
win.sessionStorage.clear();
},
});
cy.wait(delay * 3);
});

it('Renders empty state', () => {
Expand Down Expand Up @@ -104,23 +103,20 @@ describe('Testing dashboard table', () => {
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.get('.euiTitle').contains('Event analytics').should('exist');
cy.get('.euiTitle').contains('Logs').should('exist');
});

it('Adds the percentile filters', () => {
cy.wait(delay);//Needed after removing waits from setTimeFilter()
cy.contains(' >= 95 percentile').click({ force: true });
cy.wait(delay);
cy.contains(' >= 95 percentile').click({ force: true });
cy.wait(delay);

cy.contains('Latency percentile within trace group: >= 95th').should('exist');
cy.contains(' (7)').should('exist');
cy.contains('318.69').should('exist');

cy.contains(' < 95 percentile').click({ force: true });
cy.wait(delay);
cy.contains(' < 95 percentile').click({ force: true });
cy.wait(delay);

cy.contains('Latency percentile within trace group: < 95th').should('exist');
cy.contains(' (8)').should('exist');
Expand All @@ -134,16 +130,13 @@ describe('Testing dashboard table', () => {
});

it('Redirects to traces table with filter', () => {
cy.wait(delay);
cy.get('.euiLink').contains('13').click();
cy.wait(delay);

cy.get('h2.euiTitle').contains('Traces').should('exist');
cy.contains(' (13)').should('exist');
cy.contains('client_create_order').should('exist');

cy.get('.euiSideNavItemButton__label').contains('Trace analytics').click();
cy.wait(delay);

cy.contains('client_create_order').should('exist');
});
Expand Down Expand Up @@ -211,7 +204,6 @@ describe('Latency by trace group table', () =>{
it('Sorts the Latency by trace group table', () => {
cy.get('span[title*="Trace group name"]').click();
cy.get('[data-test-subj="dashboard-table-trace-group-name-button"]').eq(0).contains('/**').should('exist');
cy.wait(delay);
});

it('Verify tooltips in Latency by trace group table', () => {
Expand All @@ -232,7 +224,7 @@ describe('Latency by trace group table', () =>{
it('Verify Search engine on Trace dashboard', () => {
cy.get('.euiFieldSearch.euiFieldSearch--fullWidth').click().type('client_pay_order');
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.wait(delay);
cy.wait(delay);//Fails without
cy.get('.euiTableCellContent.euiTableCellContent--alignRight.euiTableCellContent--overflowingContent').contains('211.04').should('exist');
cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').click();
cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click();
Expand Down Expand Up @@ -264,6 +256,7 @@ describe('Testing filters on trace analytics page', { scrollBehavior: false }, (
});

it('Verify Change all filters', () =>{
cy.wait(delay);//Needed after removing waits from setTimeFilter()
cy.get('[data-test-subj="global-filter-button"]').click();
cy.get('.euiContextMenuPanelTitle').contains('Change all filters').should('exist');
cy.get('.euiContextMenuItem__text').eq(0).contains('Enable all');
Expand All @@ -274,8 +267,10 @@ describe('Testing filters on trace analytics page', { scrollBehavior: false }, (
})

it('Verify Add filter section', () => {
cy.wait(delay);//Needed after removing waits from setTimeFilter()
cy.get('[data-test-subj="addfilter"]').contains('+ Add filter').click();
cy.get('.euiPopoverTitle').contains('Add filter').should('exist');
cy.wait(delay);//drop down won't open without
cy.get('.euiComboBox__inputWrap.euiComboBox__inputWrap--noWrap').eq(0).trigger('mouseover').click();
cy.get('.euiComboBoxOption__content').eq(1).click();
cy.get('.euiComboBox__inputWrap.euiComboBox__inputWrap--noWrap').eq(1).trigger('mouseover').click();
Expand Down Expand Up @@ -370,9 +365,7 @@ describe('Testing switch mode to jaeger', () => {
});

it('Verifies traces links to traces page', () => {
cy.wait(delay);
cy.get('.euiLink').contains('7').click();
cy.wait(delay);

cy.get('h2.euiTitle').contains('Traces').should('exist');
cy.contains(' (7)').should('exist');
Expand All @@ -391,4 +384,4 @@ describe('Testing switch mode to jaeger', () => {
cy.contains('Error rate').should('exist');
cy.contains('Traces').should('exist');
});
});
});
3 changes: 0 additions & 3 deletions .cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => {
.focus()
.type('{selectall}' + startTime, { force: true });
if (setEndTime) {
cy.wait(delay);
cy.get(
'button.euiDatePopoverButton--end[data-test-subj="superDatePickerendDatePopoverButton"]'
).click();
cy.wait(delay);
cy.get('.euiTab__content').contains('Absolute').click();
cy.get('input[data-test-subj="superDatePickerAbsoluteDateInput"]')
.focus()
.type('{selectall}' + endTime, { force: true });
}
if (refresh) cy.get('.euiButton__text').contains('Refresh').click();
cy.wait(delay);
};

// notebooks
Expand Down

0 comments on commit c8a6e8b

Please sign in to comment.