From 003d7a4d56b503681bb383a048daa786844fe862 Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Wed, 25 May 2022 18:38:39 +0530 Subject: [PATCH 1/9] Added cypress test cases for tooltip and search engine on Trace dashboard Signed-off-by: Pratibha Pandey --- .../4_trace_analytics_dashboard.spec.js | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js index 6e510a8d8..7b0c5632e 100644 --- a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -187,3 +187,72 @@ describe('Testing plots', () => { cy.get('text.annotation-text[data-unformatted="Now: 108"]').should('exist'); }); }); + +describe('Latency by trace group table', () =>{ + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/home', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Verify columns in Latency by trace group table along with pagination functionality', () => { + cy.get('span.panel-title').eq(0).should('exist'); + cy.wait(delay); + cy.get('span[title*="Trace group name"]').should('exist'); + cy.get('span[title*="Latency variance (ms)"]').should('exist'); + cy.get('span[title*="Average latency (ms)"]').should('exist'); + cy.get('span[title*="24-hour latency trend"]').should('exist'); + cy.get('span[title*="Error rate"] .euiToolTipAnchor').should('exist'); + cy.get('span[title*="Traces"] .euiToolTipAnchor').should('exist'); + cy.get('[data-test-subj="tablePaginationPopoverButton"]').click(); + cy.get('.euiIcon.euiIcon--medium.euiIcon--inherit.euiContextMenu__icon').eq(0).should('exist').click(); + cy.get('[data-test-subj="pagination-button-next"]').should('exist').click(); + cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').contains('mysql').should('exist'); + }); + + 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', () => { + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover').blur({force:true}); + cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible');//.click().trigger('mouseout', {'force':true}); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).should('be.visible').trigger('mouseover'); + cy.contains('Range of latencies for traces within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).should('be.visible').trigger('mouseover'); + cy.contains('Average latency of traces within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).should('be.visible').trigger('mouseover'); + cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).should('be.visible').trigger('mouseover'); + cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).should('be.visible').trigger('mouseover'); + cy.contains('Count of traces with unique trace identifiers in the selected time range.'); + }); + + it('Verify Search engine on Trace dashboard', () => { + cy.get('.euiFieldSearch.euiFieldSearch--fullWidth').click().type('client_pay_order{enter}'); + cy.wait(delay); + 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(); + cy.get('.euiIcon.euiIcon--medium.euiContextMenu__arrow').click(); + cy.get('.euiContextMenuPanelTitle').contains('Edit filter').should('exist'); + cy.get('.euiButton.euiButton--primary.euiButton--fill').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(1).contains('Exclude results').click(); + cy.get('.euiTextColor.euiTextColor--danger').should('exist'); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(1).contains('Include results').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(2).contains('Temporarily disable').click(); + cy.get('.euiBadge.euiBadge--iconRight.globalFilterItem.globalFilterItem-isDisabled').should('exist').click(); + cy.get('.euiContextMenuItem__text').eq(2).contains('Re-enable').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(3).contains('Delete').click(); + }); +}); From d0cbb4a036a0fbae7c779f87b9cfc406f1269baa Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Fri, 27 May 2022 18:59:00 +0530 Subject: [PATCH 2/9] Added test cases for filters Signed-off-by: Pratibha Pandey --- .../4_trace_analytics_dashboard.spec.js | 60 +++++++++++++++---- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js index 7b0c5632e..b70b04a72 100644 --- a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -220,18 +220,18 @@ describe('Latency by trace group table', () =>{ }); it('Verify tooltips in Latency by trace group table', () => { - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover').blur({force:true}); - cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible');//.click().trigger('mouseout', {'force':true}); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).should('be.visible').trigger('mouseover'); - cy.contains('Range of latencies for traces within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).should('be.visible').trigger('mouseover'); - cy.contains('Average latency of traces within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).should('be.visible').trigger('mouseover'); - cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).should('be.visible').trigger('mouseover'); - cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).should('be.visible').trigger('mouseover'); - cy.contains('Count of traces with unique trace identifiers in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover'); + cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).trigger('mouseover'); + cy.contains('Range of latencies for traces within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).trigger('mouseover'); + cy.contains('Average latency of traces within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).trigger('mouseover'); + cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).trigger('mouseover'); + cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).trigger('mouseover'); + cy.contains('Count of traces with unique trace identifiers in the selected time range.').should('be.visible'); }); it('Verify Search engine on Trace dashboard', () => { @@ -256,3 +256,39 @@ describe('Latency by trace group table', () =>{ cy.get('.euiContextMenuItem__text').eq(3).contains('Delete').click(); }); }); + +describe('Testing filters on trace analytics page', () =>{ + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/home', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Verify Change all filters', () =>{ + cy.get('.euiButtonIcon.euiButtonIcon--primary.euiButtonIcon--empty.euiButtonIcon--xSmall').click(); + cy.get('.euiContextMenuPanelTitle').contains('Change all filters').should('exist'); + cy.get('.euiContextMenuItem__text').eq(0).contains('Enable all'); + cy.get('.euiContextMenuItem__text').eq(1).contains('Disable all'); + cy.get('.euiContextMenuItem__text').eq(2).contains('Invert inclusion'); + cy.get('.euiContextMenuItem__text').eq(3).contains('Invert enabled/disabled'); + cy.get('.euiContextMenuItem__text').eq(4).contains('Remove all'); + }) + + it('Verify Add filter section', () => { + cy.get('.euiPopover.euiPopover--anchorDownLeft').contains('+ Add filter').click(); + cy.get('.euiPopoverTitle').contains('Add filter').should('exist'); + cy.wait(delay); + 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(); + cy.get('.euiComboBoxOption__content').eq(2).click(); + cy.get('.euiButton.euiButton--primary.euiButton--fill').contains('Save').click(); + cy.get('.euiBadge__content').should('exist').click(); + cy.get('.euiIcon.euiIcon--medium.euiContextMenu__arrow').click(); + cy.get('[data-test-subj="filter-popover-cancel-button"]').contains('Cancel').click(); + cy.get('.euiIcon.euiIcon--small.euiIcon--inherit.euiBadge__icon').click(); + }) +}); From 069884db247b99471772953472ba24ec4d143d37 Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Wed, 25 May 2022 18:38:39 +0530 Subject: [PATCH 3/9] Added cypress test cases for tooltip and search engine on Trace dashboard Signed-off-by: Pratibha Pandey --- .../4_trace_analytics_dashboard.spec.js | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js index 6e510a8d8..7b0c5632e 100644 --- a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -187,3 +187,72 @@ describe('Testing plots', () => { cy.get('text.annotation-text[data-unformatted="Now: 108"]').should('exist'); }); }); + +describe('Latency by trace group table', () =>{ + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/home', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Verify columns in Latency by trace group table along with pagination functionality', () => { + cy.get('span.panel-title').eq(0).should('exist'); + cy.wait(delay); + cy.get('span[title*="Trace group name"]').should('exist'); + cy.get('span[title*="Latency variance (ms)"]').should('exist'); + cy.get('span[title*="Average latency (ms)"]').should('exist'); + cy.get('span[title*="24-hour latency trend"]').should('exist'); + cy.get('span[title*="Error rate"] .euiToolTipAnchor').should('exist'); + cy.get('span[title*="Traces"] .euiToolTipAnchor').should('exist'); + cy.get('[data-test-subj="tablePaginationPopoverButton"]').click(); + cy.get('.euiIcon.euiIcon--medium.euiIcon--inherit.euiContextMenu__icon').eq(0).should('exist').click(); + cy.get('[data-test-subj="pagination-button-next"]').should('exist').click(); + cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').contains('mysql').should('exist'); + }); + + 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', () => { + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover').blur({force:true}); + cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible');//.click().trigger('mouseout', {'force':true}); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).should('be.visible').trigger('mouseover'); + cy.contains('Range of latencies for traces within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).should('be.visible').trigger('mouseover'); + cy.contains('Average latency of traces within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).should('be.visible').trigger('mouseover'); + cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).should('be.visible').trigger('mouseover'); + cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).should('be.visible').trigger('mouseover'); + cy.contains('Count of traces with unique trace identifiers in the selected time range.'); + }); + + it('Verify Search engine on Trace dashboard', () => { + cy.get('.euiFieldSearch.euiFieldSearch--fullWidth').click().type('client_pay_order{enter}'); + cy.wait(delay); + 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(); + cy.get('.euiIcon.euiIcon--medium.euiContextMenu__arrow').click(); + cy.get('.euiContextMenuPanelTitle').contains('Edit filter').should('exist'); + cy.get('.euiButton.euiButton--primary.euiButton--fill').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(1).contains('Exclude results').click(); + cy.get('.euiTextColor.euiTextColor--danger').should('exist'); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(1).contains('Include results').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(2).contains('Temporarily disable').click(); + cy.get('.euiBadge.euiBadge--iconRight.globalFilterItem.globalFilterItem-isDisabled').should('exist').click(); + cy.get('.euiContextMenuItem__text').eq(2).contains('Re-enable').click(); + cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click(); + cy.get('.euiContextMenuItem__text').eq(3).contains('Delete').click(); + }); +}); From 87a1361bf2b22e0ac1db50690eca5fa50dc6d690 Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Fri, 27 May 2022 18:59:00 +0530 Subject: [PATCH 4/9] Added test cases for filters Signed-off-by: Pratibha Pandey --- .../4_trace_analytics_dashboard.spec.js | 60 +++++++++++++++---- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js index 7b0c5632e..b70b04a72 100644 --- a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -220,18 +220,18 @@ describe('Latency by trace group table', () =>{ }); it('Verify tooltips in Latency by trace group table', () => { - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover').blur({force:true}); - cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible');//.click().trigger('mouseout', {'force':true}); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).should('be.visible').trigger('mouseover'); - cy.contains('Range of latencies for traces within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).should('be.visible').trigger('mouseover'); - cy.contains('Average latency of traces within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).should('be.visible').trigger('mouseover'); - cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).should('be.visible').trigger('mouseover'); - cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.'); - cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).should('be.visible').trigger('mouseover'); - cy.contains('Count of traces with unique trace identifiers in the selected time range.'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(0).trigger('mouseover'); + cy.contains('Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(1).trigger('mouseover'); + cy.contains('Range of latencies for traces within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(2).trigger('mouseover'); + cy.contains('Average latency of traces within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(3).trigger('mouseover'); + cy.contains('24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(4).trigger('mouseover'); + cy.contains('Error rate based on count of trace errors within a trace group in the selected time range.').should('be.visible'); + cy.get('.euiIcon.euiIcon--small.euiIcon--subdued.euiIcon-isLoaded.eui-alignTop').eq(5).trigger('mouseover'); + cy.contains('Count of traces with unique trace identifiers in the selected time range.').should('be.visible'); }); it('Verify Search engine on Trace dashboard', () => { @@ -256,3 +256,39 @@ describe('Latency by trace group table', () =>{ cy.get('.euiContextMenuItem__text').eq(3).contains('Delete').click(); }); }); + +describe('Testing filters on trace analytics page', () =>{ + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/home', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Verify Change all filters', () =>{ + cy.get('.euiButtonIcon.euiButtonIcon--primary.euiButtonIcon--empty.euiButtonIcon--xSmall').click(); + cy.get('.euiContextMenuPanelTitle').contains('Change all filters').should('exist'); + cy.get('.euiContextMenuItem__text').eq(0).contains('Enable all'); + cy.get('.euiContextMenuItem__text').eq(1).contains('Disable all'); + cy.get('.euiContextMenuItem__text').eq(2).contains('Invert inclusion'); + cy.get('.euiContextMenuItem__text').eq(3).contains('Invert enabled/disabled'); + cy.get('.euiContextMenuItem__text').eq(4).contains('Remove all'); + }) + + it('Verify Add filter section', () => { + cy.get('.euiPopover.euiPopover--anchorDownLeft').contains('+ Add filter').click(); + cy.get('.euiPopoverTitle').contains('Add filter').should('exist'); + cy.wait(delay); + 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(); + cy.get('.euiComboBoxOption__content').eq(2).click(); + cy.get('.euiButton.euiButton--primary.euiButton--fill').contains('Save').click(); + cy.get('.euiBadge__content').should('exist').click(); + cy.get('.euiIcon.euiIcon--medium.euiContextMenu__arrow').click(); + cy.get('[data-test-subj="filter-popover-cancel-button"]').contains('Cancel').click(); + cy.get('.euiIcon.euiIcon--small.euiIcon--inherit.euiBadge__icon').click(); + }) +}); From 6b8151d0b6bd8908b76304040a783daf6107abe2 Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Tue, 31 May 2022 15:18:58 +0530 Subject: [PATCH 5/9] Added test cases for Service page in Trace analytics Signed-off-by: Pratibha Pandey --- .../4_trace_analytics_dashboard.spec.js | 12 ++--- .../5_trace_analytics_services.spec.js | 46 ++++++++++++++++++- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js index b70b04a72..f9bfb5760 100644 --- a/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/dashboards-observability/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -201,12 +201,12 @@ describe('Latency by trace group table', () =>{ it('Verify columns in Latency by trace group table along with pagination functionality', () => { cy.get('span.panel-title').eq(0).should('exist'); cy.wait(delay); - cy.get('span[title*="Trace group name"]').should('exist'); - cy.get('span[title*="Latency variance (ms)"]').should('exist'); - cy.get('span[title*="Average latency (ms)"]').should('exist'); - cy.get('span[title*="24-hour latency trend"]').should('exist'); - cy.get('span[title*="Error rate"] .euiToolTipAnchor').should('exist'); - cy.get('span[title*="Traces"] .euiToolTipAnchor').should('exist'); + cy.get('span[title="Trace group name"]').should('exist'); + cy.get('span[title="Latency variance (ms)"]').should('exist'); + cy.get('span[title="Average latency (ms)"]').should('exist'); + cy.get('span[title="24-hour latency trend"]').should('exist'); + cy.get('span[title="Error rate"] .euiToolTipAnchor').should('exist'); + cy.get('span[title="Traces"] .euiToolTipAnchor').should('exist'); cy.get('[data-test-subj="tablePaginationPopoverButton"]').click(); cy.get('.euiIcon.euiIcon--medium.euiIcon--inherit.euiContextMenu__icon').eq(0).should('exist').click(); cy.get('[data-test-subj="pagination-button-next"]').should('exist').click(); diff --git a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js index b03e10e64..d80d5585d 100644 --- a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js +++ b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js @@ -46,6 +46,28 @@ describe('Testing services table', () => { cy.contains(' (1)').should('exist'); cy.contains('3.57%').should('exist'); }); + + it('Verify columns in Services table', () => { + cy.get('.euiFlexItem.euiFlexItem--flexGrow10 .panel-title').contains('Services').should('exist'); + cy.get('.euiTableCellContent__text[title="Name"]').should('exist'); + cy.get('.euiTableCellContent__text[title="Average latency (ms)"]').should('exist'); + cy.get('.euiTableCellContent__text[title="Error rate"]').should('exist'); + cy.get('.euiTableCellContent__text[title="Throughput"]').should('exist'); + cy.get('.euiTableCellContent__text[title="No. of connected services"]').should('exist'); + cy.get('.euiTableCellContent__text[title="Connected services"]').should('exist'); + cy.get('.euiTableCellContent__text[title="Traces"]').should('exist'); + cy.get('[data-test-subj="tablePaginationPopoverButton"]').click(); + cy.get('.euiIcon.euiIcon--medium.euiIcon--inherit.euiContextMenu__icon').eq(0).should('exist').click(); + cy.get('[data-test-subj="pagination-button-next"]').should('exist').click(); + cy.get('.euiLink.euiLink--primary').contains('order').should('exist'); + }) + + it('Navigate from Services to Traces', () => { + cy.get('.euiTableCellContent__text[title="Traces"]').should('exist'); + cy.contains('74').should('exist').click(); + cy.get('.euiText.euiText--medium .panel-title').should('exist'); + cy.get('.euiBadge__childButton[data-test-subj="filterBadge"]').should('exist'); + }) }); describe('Testing service view empty state', () => { @@ -115,9 +137,31 @@ describe('Testing service view', () => { cy.get('.euiTextColor').contains('Span ID').trigger('mouseover'); cy.get('.euiButtonIcon[aria-label="span-flyout-filter-icon"').click({ force: true }); cy.wait(delay); - cy.get('.euiBadge__text').contains('spanId: ').should('exist'); cy.get('[data-test-subj="euiFlyoutCloseButton"]').click({ force: true }); cy.contains('Spans (1)').should('exist'); }); }); + +describe('Testing Service map', () => { + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/services', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it.only('Render Service map', () => { + cy.get('.euiText.euiText--medium .panel-title').contains('Service map'); + cy.get('[data-test-subj="latency"]').should('exist'); + cy.get('.ytitle').contains('Latency (ms)'); + cy.get('[data-text = "Error rate"]').click(); + cy.contains('60%'); + cy.get('[data-text = "Throughput"]').click(); + cy.contains('100'); + cy.get('.euiText.euiText--medium').contains('Focus on').should('exist'); + cy.get('[placeholder="Service name"]').focus().type('database{enter}'); + }) +}); From 5b4b79a93bdfb3319d3409eae2d3f325a73329ba Mon Sep 17 00:00:00 2001 From: Deepak Nevde Date: Wed, 1 Jun 2022 17:48:21 +0530 Subject: [PATCH 6/9] Added Cypress test cases for trace analytics services spans table Signed-off-by: Deepak Nevde --- .../5_trace_analytics_services.spec.js | 117 +++++++++++++++++- .../.cypress/utils/constants.js | 19 +++ 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js index d80d5585d..96dca8243 100644 --- a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js +++ b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js @@ -5,7 +5,7 @@ /// -import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter } from '../utils/constants'; +import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter, verify_traces_spans_data_grid_cols_exists, count_table_row } from '../utils/constants'; describe('Testing services table empty state', () => { beforeEach(() => { @@ -153,7 +153,7 @@ describe('Testing Service map', () => { setTimeFilter(); }); - it.only('Render Service map', () => { + it('Render Service map', () => { cy.get('.euiText.euiText--medium .panel-title').contains('Service map'); cy.get('[data-test-subj="latency"]').should('exist'); cy.get('.ytitle').contains('Latency (ms)'); @@ -165,3 +165,116 @@ describe('Testing Service map', () => { cy.get('[placeholder="Service name"]').focus().type('database{enter}'); }) }); + +describe('Testing traces Spans table verify table headers functionality', () => { + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/services', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Renders the spans table and verify coloums headers', () => { + cy.contains(' (8)').should('exist'); + cy.contains('analytics-service, frontend-client, recommendation').should('exist'); + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + cy.get('.panel-title').contains('Spans').should('exist'); + cy.get('.panel-title-count').contains('5').should('exist'); + verify_traces_spans_data_grid_cols_exists(); + }); + + it('Toggle columns and verify the columns hidden text verify rows', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + cy.get('[data-test-subj = "dataGridColumnSelectorButton"]').click(); + cy.get('.euiSwitch.euiSwitch--compressed.euiSwitch--mini .euiSwitch__button').eq(3).click(); + cy.get('.euiButtonEmpty__text').eq(3).click().should('have.text', '2 columns hidden'); + count_table_row(5); + }); + + it('Show all button Spans table', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + cy.get('[data-test-subj = "dataGridColumnSelectorButton"]').click(); + cy.get('.euiPopoverFooter .euiFlexItem.euiFlexItem--flexGrowZero').eq(0).should('have.text', 'Show all').click(); + cy.get('.euiDataGrid__focusWrap').click().should('exist'); + verify_traces_spans_data_grid_cols_exists(); + }); + + it('Hide all button Spans table', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + cy.get('[data-test-subj = "dataGridColumnSelectorButton"]').click(); + cy.get('.euiPopoverFooter .euiFlexItem.euiFlexItem--flexGrowZero').eq(1).should('have.text', 'Hide all').click(); + cy.get('.euiDataGrid__focusWrap').click().should('exist'); + cy.get('[data-test-subj="dataGridColumnSelectorPopover"]').should('have.text', '10 columns hidden'); + }); + + it('Render Spans table and change data table Density', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + verify_traces_spans_data_grid_cols_exists(); + cy.get('.euiButtonEmpty__text').contains('Density').click(); + cy.get('.euiButtonContent__icon').eq(5).click(); + cy.get('.euiButtonContent__icon').eq(6).click(); + cy.get('.euiButtonContent__icon').eq(7).click(); + }); + + it('Render Spans table and and click on sort', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + verify_traces_spans_data_grid_cols_exists(); + cy.get('[data-test-subj="dataGridColumnSortingButton"]').contains('Sort fields').should('exist').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-spanId').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-parentSpanId"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-traceId"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-traceGroup').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-durationInNanos"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-startTime"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-endTime').click(); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection-status.code"]').click(); + cy.get('.euiButtonEmpty__text').eq(5).contains('8 fields sorted').should('exist'); + cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection"]').click(); + cy.get('[data-test-subj="dataGridColumnSortingButton"]').should('exist').click(); + }); + +}); + + +describe('Testing traces Spans table and verify columns functionality', () => { + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/services', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it('Renders the spans table and click on first span to verify details', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + verify_traces_spans_data_grid_cols_exists(); + cy.get('.euiLink--primary').eq(4).click(); + cy.get('[data-test-subj="spanDetailFlyout"] .euiTitle.euiTitle--medium').contains('Span detail').should('exist'); + cy.get('.euiFlyoutBody .panel-title').contains('Overview').should('exist'); + cy.get('.euiTextColor.euiTextColor--subdued').contains('Span ID').should('exist'); + cy.get('.euiDescriptionList__description .euiFlexItem').eq(0).contains('d03fecfa0f55b77c').should('exist'); + cy.get('.euiFlyoutBody__overflowContent .panel-title').contains('Span attributes').should('exist'); + cy.get('.euiDescriptionList__description .euiFlexItem').eq(0).trigger('mouseover').click(); + cy.get('[aria-label="span-flyout-filter-icon"]').click(); + cy.get('.euiFlyout__closeButton.euiFlyout__closeButton--inside').click(); + cy.get('.euiBadge__content .euiBadge__text').contains('spanId: d03fecfa0f55b77c').should('exist'); + count_table_row(1); + cy.get('[aria-label="remove current filter"]').click(); + count_table_row(5); + }); + + it('Render Spans table and verify Column functionality', () => { + cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); + verify_traces_spans_data_grid_cols_exists(); + cy.get('.euiDataGridHeaderCell__content').contains('Span ID').click(); + cy.get('.euiListGroupItem__label').contains('Hide column').click(); + cy.get('.euiDataGridHeaderCell__content').contains('Trace ID').click(); + cy.get('.euiListGroupItem__label').contains('Sort A-Z').click(); + cy.get('.euiDataGridHeaderCell__content').contains('Trace group').click(); + cy.get('.euiListGroupItem__label').contains('Move left').click(); + }); +}); diff --git a/dashboards-observability/.cypress/utils/constants.js b/dashboards-observability/.cypress/utils/constants.js index 75e343086..79c4c064d 100644 --- a/dashboards-observability/.cypress/utils/constants.js +++ b/dashboards-observability/.cypress/utils/constants.js @@ -100,3 +100,22 @@ export const supressResizeObserverIssue = () => { if (err.message.includes('ResizeObserver loop')) return false; }); }; + +export const verify_traces_spans_data_grid_cols_exists = () => { + cy.get('.euiDataGridHeaderCell__content').contains('Span ID').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('Trace ID').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('Operation').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('Duration').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('Start time').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('End time').should('exist'); + cy.get('.euiDataGridHeaderCell__content').contains('Errors').should('exist'); +} + +export const count_table_row = (expected_row_count) => { + cy.get('.euiDataGridHeader [role="columnheader"]').then($el => { + let colmun_header_count = Cypress.$($el).length; + let table_grid_cell_count = Cypress.$('[data-test-subj="dataGridRowCell"]').length; + const total_row_count = table_grid_cell_count / colmun_header_count; + expect(total_row_count).to.equal(expected_row_count) + }); +} From 5717ee8202e47ec0d42c0041d84bed7ed3e30c6a Mon Sep 17 00:00:00 2001 From: Nidhi Singhai Date: Thu, 2 Jun 2022 13:53:19 +0530 Subject: [PATCH 7/9] Cypress test case for Traces Signed-off-by: Nidhi Singhai --- .../6_trace_analytics_traces.spec.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js index d8c5735fc..0e824d936 100644 --- a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js +++ b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js @@ -113,3 +113,38 @@ describe('Testing trace view', () => { cy.contains('Spans (1)').should('exist'); }); }); + +describe('Testing traces table Pagination', () => { + beforeEach(() => { + cy.visit('app/observability-dashboards#/trace_analytics/traces', { + onBeforeLoad: (win) => { + win.sessionStorage.clear(); + }, + }); + setTimeFilter(); + }); + + it.only('Renders the traces table pagination', () => { + cy.get('[data-test-subj="pagination-button-next"]').click(); + cy.contains('client_pay_order').should('exist'); + cy.get('[data-test-subj="pagination-button-previous"]').click(); + cy.contains('224.99').should('exist'); + cy.get('.euiButtonEmpty').contains('5').click(); + cy.contains('690d3c7af1a78cf89c43e...').should('exist'); + cy.contains('5be8370207cbb002a165d...').click(); + cy.contains('client_create_order').should('exist'); + cy.get('path[style*="rgb(116, 146, 231)"]').should('exist'); + cy.go('back'); + cy.wait(delay); + cy.get('.euiButtonEmpty__text').contains('Rows per page').click(); + cy.get('.euiContextMenuItem__text').contains('15 rows').click(); + cy.get('.euiTable--auto') + .find("tr") + .then((row) => { + //row.length will give you the row count + cy.log(row.length-1); + let total=row.length-1; + }); + cy.log('Rows are counted'); + }); +}); From 4575e40e2243285f944b23647c6e04c40a6a8aee Mon Sep 17 00:00:00 2001 From: Nidhi Singhai Date: Thu, 2 Jun 2022 17:02:49 +0530 Subject: [PATCH 8/9] Cypress test case for Traces Updated Signed-off-by: Nidhi Singhai --- .../integration/6_trace_analytics_traces.spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js index 0e824d936..61a007f59 100644 --- a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js +++ b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js @@ -114,7 +114,7 @@ describe('Testing trace view', () => { }); }); -describe('Testing traces table Pagination', () => { +describe('Testing traces table', () => { beforeEach(() => { cy.visit('app/observability-dashboards#/trace_analytics/traces', { onBeforeLoad: (win) => { @@ -124,7 +124,13 @@ describe('Testing traces table Pagination', () => { setTimeFilter(); }); - it.only('Renders the traces table pagination', () => { + it('Renders the traces table and verify Table Column, Pagination and Rows Data ', () => { + cy.get('.euiTableCellContent__text').contains('Trace ID').should('exist'); + cy.get('.euiTableCellContent__text').contains('Trace group').should('exist'); + cy.get('.euiTableCellContent__text').contains('Latency (ms)').should('exist'); + cy.get('.euiTableCellContent__text').contains('Percentile in trace group').should('exist'); + cy.get('.euiTableCellContent__text').contains('Errors').should('exist'); + cy.get('.euiTableCellContent__text').contains('Last updated').should('exist'); cy.get('[data-test-subj="pagination-button-next"]').click(); cy.contains('client_pay_order').should('exist'); cy.get('[data-test-subj="pagination-button-previous"]').click(); From b63917dbe2b4d2ad5a691a5bc21f2436ec0ee2f0 Mon Sep 17 00:00:00 2001 From: Pratibha Pandey Date: Tue, 7 Jun 2022 14:05:44 +0530 Subject: [PATCH 9/9] Worked on review comments Signed-off-by: Pratibha Pandey --- .../.cypress/integration/5_trace_analytics_services.spec.js | 3 +-- .../.cypress/integration/6_trace_analytics_traces.spec.js | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js index 96dca8243..bd2cd4c41 100644 --- a/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js +++ b/dashboards-observability/.cypress/integration/5_trace_analytics_services.spec.js @@ -176,7 +176,7 @@ describe('Testing traces Spans table verify table headers functionality', () => setTimeFilter(); }); - it('Renders the spans table and verify coloums headers', () => { + it('Renders the spans table and verify columns headers', () => { cy.contains(' (8)').should('exist'); cy.contains('analytics-service, frontend-client, recommendation').should('exist'); cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click(); @@ -235,7 +235,6 @@ describe('Testing traces Spans table verify table headers functionality', () => cy.get('[data-test-subj="dataGridColumnSortingPopoverColumnSelection"]').click(); cy.get('[data-test-subj="dataGridColumnSortingButton"]').should('exist').click(); }); - }); diff --git a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js index 61a007f59..14f71ec10 100644 --- a/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js +++ b/dashboards-observability/.cypress/integration/6_trace_analytics_traces.spec.js @@ -144,13 +144,12 @@ describe('Testing traces table', () => { cy.wait(delay); cy.get('.euiButtonEmpty__text').contains('Rows per page').click(); cy.get('.euiContextMenuItem__text').contains('15 rows').click(); + let expected_row_count=15; cy.get('.euiTable--auto') .find("tr") .then((row) => { - //row.length will give you the row count - cy.log(row.length-1); let total=row.length-1; + expect(total).to.equal(expected_row_count); }); - cy.log('Rows are counted'); }); });