Skip to content

Commit

Permalink
App Analytics bug fixes (#782)
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Lee <[email protected]>
  • Loading branch information
eugenesk24 authored Jun 6, 2022
1 parent 6461026 commit 13748f9
Show file tree
Hide file tree
Showing 132 changed files with 14,747 additions and 9,476 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const landOnEventExplorer = () => {
cy.visit(
`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer`
);
cy.wait(delay);
cy.wait(delay * 2);
};

const landOnPanels = () => {
Expand All @@ -51,6 +51,22 @@ describe('Adding sample data and visualization', () => {
});
});

describe('Has working breadcrumbs', () => {
it('Redirect to correct page on breadcrumb click', () => {
landOnEventExplorer();
cy.wait(delay * 3);
cy.get('.euiBreadcrumb[href="#/event_analytics/explorer"]').contains('Explorer').click();
cy.wait(delay);
cy.get('[data-test-subj="searchAutocompleteTextArea"]').should('exist');
cy.get('.euiBreadcrumb[href="#/event_analytics"]').contains('Event analytics').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
cy.get('.euiBreadcrumb[href="observability-dashboards#/"]').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});
});

describe('Open flyout for a data row to see details', () => {
beforeEach(() => {
landOnEventExplorer();
Expand Down Expand Up @@ -374,11 +390,10 @@ describe('Switch on and off livetail', () => {
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[1].query);

cy.get('[data-test-subj=eventLiveTail]').click();
cy.get('[data-test-subj=eventLiveTail__delay10]').click();
cy.get('[data-test-subj=eventLiveTail__delay10s]').click();
cy.wait(delay * 2);
cy.get('.euiToastHeader__title').contains('On').should('exist');

cy.get('[data-test-subj=eventLiveTail]').click();
cy.get('[data-test-subj=eventLiveTail__off').click();
cy.wait(delay * 2);
cy.get('.euiToastHeader__title').contains('Off').should('exist');
Expand All @@ -393,7 +408,7 @@ describe('Live tail stop automatically', () => {
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[1].query);

cy.get('[data-test-subj=eventLiveTail]').click();
cy.get('[data-test-subj=eventLiveTail__delay10]').click();
cy.get('[data-test-subj=eventLiveTail__delay10s]').click();
cy.wait(delay * 2);
cy.get('.euiToastHeader__title').contains('On').should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ describe('Testing paragraphs', () => {
cy.wait(delay);
});

it('Has working breadcrumbs', () => {
cy.get('.euiBreadcrumb').contains(TEST_NOTEBOOK).click();
cy.wait(delay);
cy.get('.euiTitle').contains(TEST_NOTEBOOK).should('exist');
cy.get('.euiBreadcrumb').contains('Notebooks').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Notebooks').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Renders markdown', () => {
cy.get('.euiTextArea').should('not.exist');
cy.get(`a[href="${SAMPLE_URL}"]`).should('exist');
Expand Down Expand Up @@ -432,4 +444,20 @@ describe('Testing paragraphs', () => {

cy.get('.euiButton__text').contains('Create notebook').should('exist');
});

it('Cleans up test notebooks', () => {
cy.get('[data-test-subj="notebook-notebook-actions-button"]').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Delete notebook').click();
cy.wait(delay);

cy.get('button.euiButton--danger').should('be.disabled');

cy.get('input.euiFieldText[placeholder="delete"]').type('delete');
cy.get('button.euiButton--danger').should('not.be.disabled');
cy.get('.euiButton__text').contains('Delete').click();
cy.wait(delay * 3);

cy.get('.euiText').contains('No notebooks').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,39 @@ describe('Testing a panel', () => {
moveToTestPanel();
});

it('Opens visualization flyout from empty panel', () => {
cy.get('.euiButton').eq(4).contains('Add visualization').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Select existing visualization').click();
cy.wait(delay);
cy.get('.euiButton').contains('Cancel').click();
cy.get('.euiButton').eq(2).contains('Add visualization').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Select existing visualization').click();
cy.wait(delay);
cy.get('.euiButton').contains('Cancel').click();
cy.get('.euiButton').contains('Add visualization').first().click();
cy.get('.euiContextMenuItem__text').contains('Create new visualization').click();
cy.wait(delay);
cy.get('.euiBreadcrumb').contains('Explorer').should('exist');
cy.get('.euiCallOut').contains('No results match your search criteria').should('exist');
});

it('Redirects to correct page on breadcrumb click', () => {
moveToTestPanel();
cy.get('.euiBreadcrumb').contains(TEST_PANEL).click();
cy.wait(delay);
cy.get('.euiTitle').contains(TEST_PANEL).should('exist');
cy.get('.euiBreadcrumb').contains('Operational panels').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Operational panels').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Duplicate the open panel', () => {
moveToTestPanel();
cy.get('.euiButton__text').contains('Panel actions').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Duplicate panel').click();
Expand Down Expand Up @@ -226,9 +258,9 @@ describe('Testing a panel', () => {
});

it('Add existing visualization #1', () => {
cy.get('.euiButton__text').contains('Add Visualization').click();
cy.get('.euiButton__text').contains('Add visualization').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Select Existing Visualization').click();
cy.get('.euiContextMenuItem__text').contains('Select existing visualization').click();
cy.wait(delay);
cy.get('select').select(PPL_VISUALIZATIONS_NAMES[0]);
cy.get('button[aria-label="refreshPreview"]').click();
Expand All @@ -240,9 +272,9 @@ describe('Testing a panel', () => {
});

it('Add existing visualization #2', () => {
cy.get('.euiButton__text').contains('Add Visualization').click();
cy.get('.euiButton__text').contains('Add visualization').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Select Existing Visualization').click();
cy.get('.euiContextMenuItem__text').contains('Select existing visualization').click();
cy.wait(delay);
cy.get('select').select(PPL_VISUALIZATIONS_NAMES[1]);
cy.get('button[aria-label="refreshPreview"]').click();
Expand All @@ -257,17 +289,7 @@ describe('Testing a panel', () => {
cy.get('[data-test-subj="searchAutocompleteTextArea"]')
.click()
.wait(1500)
.type('where Carrier ')
.wait(1500)
.type('= ')
.wait(1500)
.type("'OpenSearch-Air'")
.wait(1500)
.type('| where Dest ')
.wait(1500)
.type('= ')
.wait(1500)
.type("'Munich Airport'");
.type("where Carrier = 'OpenSearch-Air'| where Dest = 'Munich Airport'", {delay: 500});
cy.get('.euiButton__text').contains('Refresh').click();
cy.wait(delay * 3);
cy.get('.xtick').should('contain', 'OpenSearch-Air');
Expand Down Expand Up @@ -353,9 +375,9 @@ describe('Testing a panel', () => {
});

it('Create new visualization and add to panel', () => {
cy.get('.euiButton__text').contains('Add Visualization').click();
cy.get('.euiButton__text').contains('Add visualization').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text').contains('Create New Visualization').click();
cy.get('.euiContextMenuItem__text').contains('Create new visualization').click();
cy.wait(delay * 3);
cy.url().should('match', new RegExp('(.*)#/event_analytics/explorer'));
cy.get('[id^=autocomplete-textarea]').type(PPL_VISUALIZATIONS[2]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ describe('Testing dashboard table', () => {
cy.contains('7.14%').should('exist');
});

it('Has working breadcrumbs', () => {
cy.get('.euiBreadcrumb').contains('Dashboard').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Adds the percentile filters', () => {
cy.contains(' >= 95 percentile').click({ force: true });
cy.wait(delay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,27 @@ describe('Testing service view', () => {
});

it('Renders service view', () => {
cy.get('h2.euiTitle').contains('frontend-client').should('exist');
cy.get('h2.euiTitle').contains(SERVICE_NAME).should('exist');
cy.contains('178.6').should('exist');
cy.contains('3.57%').should('exist');
cy.get('div.vis-network').should('exist');
});

it('Has working breadcrumbs', () => {
cy.get('.euiBreadcrumb').contains(SERVICE_NAME).click();
cy.wait(delay);
cy.get('h2.euiTitle').contains(SERVICE_NAME).should('exist');
cy.get('.euiBreadcrumb').contains('Services').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Services').should('exist');
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Renders spans data grid, flyout, filters', () => {
cy.get('button[data-datagrid-interactable="true"]').eq(0).click({ force: true });
cy.wait(delay);
Expand All @@ -103,6 +118,7 @@ describe('Testing service view', () => {
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');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ describe('Testing traces table', () => {
cy.contains('-').should('exist');
});

it('Sorts the traces table', () => {
cy.get('.euiTableRow').first().contains('-').should('exist');
cy.get('.euiTableCellContent').contains('Trace group').click();
cy.get('.euiTableRow').first().contains('/%2A%2A').should('exist');
});

it('Searches correctly', () => {
cy.get('input[type="search"]').focus().type(`${TRACE_ID}{enter}`);
cy.get('.euiButton__text').contains('Refresh').click();
Expand Down Expand Up @@ -75,6 +81,21 @@ describe('Testing trace view', () => {
cy.contains(`"${SPAN_ID}"`).should('exist');
});

it('Has working breadcrumbs', () => {
cy.get('.euiBreadcrumb').contains(TRACE_ID).click();
cy.wait(delay);
cy.get('h2.euiTitle').contains(TRACE_ID).should('exist');
cy.get('.euiBreadcrumb').contains('Traces').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Traces').should('exist');
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.wait(delay);
cy.get('.euiTitle').contains('Event analytics').should('exist');
});

it('Renders data grid, flyout and filters', () => {
cy.get('.euiToggle__input[title="Span list"]').click({ force: true });
cy.contains('2 columns hidden').should('exist');
Expand Down
Loading

0 comments on commit 13748f9

Please sign in to comment.