Skip to content

Commit

Permalink
Merge branch 'main' into feature/collaborations-updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Li committed Sep 8, 2022
2 parents 4ca65ca + e755d2b commit 9b73af6
Show file tree
Hide file tree
Showing 175 changed files with 32,971 additions and 7,825 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: [pull_request, push]
env:
PLUGIN_NAME: dashboards-observability
OPENSEARCH_VERSION: 'main'
OPENSEARCH_PLUGIN_VERSION: 2.0.0.0
OPENSEARCH_PLUGIN_VERSION: 2.2.0.0

jobs:

Expand Down
504 changes: 462 additions & 42 deletions dashboards-observability/.cypress/integration/1_event_analytics.spec.js

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions dashboards-observability/.cypress/integration/2_notebooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
SAMPLE_URL,
SQL_QUERY_TEXT,
PPL_QUERY_TEXT,
NOTEBOOK_TEXT,
OPENSEARCH_URL,
} from '../utils/constants';

import { SAMPLE_PANEL } from '../utils/panel_constants';
Expand Down Expand Up @@ -63,6 +65,13 @@ describe('Testing notebooks table', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/notebooks`);
});

it('Notebooks table empty state', () => {
cy.get('#notebookArea').contains('Notebooks (0)').should('exist');
cy.get('.euiTextAlign.euiTextAlign--center').contains('No notebooks');
cy.get('.euiButton__text').eq(2).contains('Create notebook');
cy.get('.euiButton__text').eq(3).contains('Add samples');
});

it('Displays error toast for invalid notebook name', () => {
cy.get('.euiButton__text').contains('Create notebook').click();
cy.wait(delay);
Expand Down Expand Up @@ -125,6 +134,21 @@ describe('Testing notebooks table', () => {
.should('exist');
});

it('Notebooks table columns headers and pagination', () => {
cy.get('.euiTitle.euiTitle--small').contains('Notebooks').should('exist');
cy.get('.euiTableCellContent__text[title="Name"]').should('exist');
cy.get('.euiTableCellContent__text[title="Last updated"]').should('exist');
cy.get('.euiTableCellContent__text[title="Created"]').should('exist');
cy.get('[data-test-subj="tablePaginationPopoverButton"]').should('exist');
});

it('"Learn more" link under Notebooks header', () => {
cy.get('.euiTitle.euiTitle--small').contains('Notebooks');
cy.get('.euiTextColor.euiTextColor--subdued').contains(NOTEBOOK_TEXT);
cy.get('a.euiLink.euiLink--primary').contains('Learn more').click();
cy.get(`a[href="${OPENSEARCH_URL}"]`).should('exist');
});

it('Deletes notebooks', () => {
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]').click();
cy.wait(delay);
Expand Down Expand Up @@ -231,6 +255,16 @@ describe('Testing paragraphs', () => {
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Paragraph actions layout', () => {
cy.get('button[data-test-subj="notebook-paragraph-actions-button"]').should('exist').click();
cy.get('.euiContextMenuPanelTitle').contains('Actions');
cy.get('.euiContextMenuItem__text').eq(0).contains('Add paragraph to top');
cy.get('.euiContextMenuItem__text').eq(1).contains('Add paragraph to bottom');
cy.get('.euiContextMenuItem__text').eq(2).contains('Run all paragraphs');
cy.get('.euiContextMenuItem__text').eq(3).contains('Clear all outputs');
cy.get('.euiContextMenuItem__text').eq(4).contains('Delete all paragraphs');
});

it('Renders markdown', () => {
cy.get('.euiTextArea').should('not.exist');
cy.get(`a[href="${SAMPLE_URL}"]`).should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,108 @@ 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');
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', () => {
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();
});
});

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();
})
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/// <reference types="cypress" />

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(() => {
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -115,9 +137,143 @@ 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('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}');
})
});

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 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();
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();
});
});
Loading

0 comments on commit 9b73af6

Please sign in to comment.