Skip to content

Commit

Permalink
removed observability tests that can be run locally (#939) (#944)
Browse files Browse the repository at this point in the history
* removed tests that can be run locally
* remove unused references
* fixed import style

Signed-off-by: Paul Sebastian <paulstn@amazon.com>
(cherry picked from commit 76ec82d)
  • Loading branch information
paulstn authored Oct 30, 2023
1 parent c536def commit a0be908
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 577 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ describe('Testing dashboard table empty state', () => {
'[data-test-subj="trace-groups-service-operation-accordian"]'
).click();
});

it('Renders empty state', () => {
cy.contains(' (0)').should('exist');
cy.contains('No matches').should('exist');
});
});

describe('Testing dashboard table', () => {
Expand All @@ -39,13 +34,6 @@ describe('Testing dashboard table', () => {
).click();
});

it('Renders the dashboard table', () => {
cy.contains(' (10)').should('exist');
cy.contains('client_cancel_order').should('exist');
cy.contains('166.44').should('exist');
cy.contains('7.14%').should('exist');
});

it('Adds the percentile filters', () => {
cy.contains(' >= 95 percentile').click({ force: true });
cy.wait(delayTime);
Expand Down Expand Up @@ -107,26 +95,6 @@ describe('Testing plots', () => {
).click();
});

it('Renders service map', () => {
// plotly scale texts are in attribute "data-unformatted"
cy.get('text.ytitle[data-unformatted="Average duration (ms)"]').should(
'exist'
);
cy.get('text[data-unformatted="200"]').should('exist');
cy.get('.vis-network').should('exist');

cy.get('.euiButton__text[title="Errors"]').click();
cy.get('text.ytitle[data-unformatted="Error rate (%)"]').should('exist');

cy.get('.euiButton__text[title="Request Rate"]').click();
cy.get('text.ytitle[data-unformatted="Request rate (spans)"]').should(
'exist'
);

cy.get('input[type="search"]').eq(1).focus().type('payment{enter}');
cy.wait(delayTime);
});

it('Renders plots', () => {
cy.get('text.ytitle[data-unformatted="Error rate (%)"]').should('exist');
cy.get('text.annotation-text[data-unformatted="Now: 14.81%"]').should(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@

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

import {
delayTime,
SERVICE_NAME,
setTimeFilter,
} from '../../../utils/constants';

describe('Testing services table empty state', () => {
beforeEach(() => {
cy.visit('app/observability-traces#/services', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
});
cy.wait(delayTime * 3);
});

it('Renders empty state', () => {
cy.contains(' (0)').should('exist');
cy.contains('No matches').should('exist');
});
});
import { SERVICE_NAME, setTimeFilter } from '../../../utils/constants';

describe('Testing services table', () => {
beforeEach(() => {
Expand All @@ -37,13 +17,6 @@ describe('Testing services table', () => {
setTimeFilter();
});

it('Renders the services table', () => {
cy.contains(' (8)').should('exist');
cy.contains('analytics-service, frontend-client, recommendation').should(
'exist'
);
});

it('Searches correctly', () => {
cy.get('input[type="search"]')
.first()
Expand All @@ -66,12 +39,6 @@ describe('Testing service view empty state', () => {
},
});
});

it('Renders service view empty state', () => {
cy.contains('frontend-client').should('exist');
cy.get('.euiText').contains('0').should('exist');
cy.get('.euiText').contains('-').should('exist');
});
});

describe('Testing service view', () => {
Expand All @@ -87,9 +54,4 @@ describe('Testing service view', () => {
});
setTimeFilter(undefined, false);
});

it('Renders service view', () => {
cy.get('h2.euiTitle').contains(SERVICE_NAME).should('exist');
cy.get('div.vis-network').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@

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

import { delayTime, setTimeFilter, TRACE_ID } from '../../../utils/constants';
import { setTimeFilter, TRACE_ID } from '../../../utils/constants';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import dayjs from 'dayjs';

dayjs.extend(customParseFormat);

describe('Testing traces table empty state', () => {
beforeEach(() => {
cy.visit('app/observability-traces#/traces', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
});
cy.wait(delayTime * 3);
});

it('Renders empty state', () => {
cy.contains(' (0)').should('exist');
cy.contains('No matches').should('exist');
});
});

describe('Testing traces table', () => {
beforeEach(() => {
cy.visit('app/observability-traces#/traces', {
Expand All @@ -37,23 +21,6 @@ describe('Testing traces table', () => {
setTimeFilter();
});

it('Renders the traces table', () => {
cy.contains(' (108)').should('exist');
cy.get('.euiTableCellContent')
.eq(17)
.invoke('text')
.then((text) => {
expect(dayjs(text, 'MM/DD/YYYY HH:mm:ss', true).isValid()).to.be.true;
});
cy.contains('03f9c770db5ee2f1caac0...').should('exist');
cy.contains('224.99').should('exist');

// test data contains output from data-prepper 0.8, which doesn't have fields denormalized
// Trace Analytics should be able to handle the discrepancy if some fields cannot be parsed
cy.contains('Invalid date').should('exist');
cy.contains('-').should('exist');
});

it('Sorts the traces table', () => {
cy.get('.euiTableRow').first().contains('-').should('exist');
cy.get('.euiTableCellContent').contains('Trace group').click();
Expand Down
103 changes: 0 additions & 103 deletions cypress/integration/plugins/observability-dashboards/4_panels.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ const moveToPanelHome = () => {
cy.wait(delay * 3);
};

const moveToTestPanel = () => {
moveToPanelHome();
cy.get('.euiTableCellContent')
.contains(TEST_PANEL)
.trigger('mouseover')
.click();
cy.wait(delay * 3);
cy.get('h1').contains(TEST_PANEL).should('exist');
cy.wait(delay);
};

describe('Testing panels table', () => {
beforeEach(() => {
moveToPanelHome();
Expand Down Expand Up @@ -68,96 +57,4 @@ describe('Testing panels table', () => {
.click();
cy.wait(delay);
});

it('Deletes panels', () => {
cy.get('.panel-header-count').contains('(2)');
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]')
.trigger('mouseover')
.click();
cy.wait(delay);
cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text')
.contains('Delete')
.trigger('mouseover')
.click();
cy.wait(delay);

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

cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', {
delay: 50,
});
cy.get('button.euiButton--danger').should('not.be.disabled');
cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click();

cy.get('.euiTextAlign')
.contains('No Observability Dashboards')
.should('exist');

// keep a panel for testing
cy.get('.euiButton__text')
.contains('Create Dashboard')
.trigger('mouseover')
.click();
cy.wait(delay);
cy.get('input.euiFieldText').focus().type(TEST_PANEL, {
delay: 50,
});
cy.get('.euiButton__text')
.contains(/^Create$/)
.trigger('mouseover')
.click();
cy.wait(delay * 2);
});
});

describe('Testing a panel', () => {
it('Move to test panel', () => {
moveToTestPanel();
});

it('Change date filter of the panel', () => {
cy.get(
'.euiButtonEmpty[data-test-subj="superDatePickerToggleQuickMenuButton"]'
).click({
force: true,
});
cy.get('.euiLink').contains('This year').trigger('mouseover').click();
cy.wait(delay * 2);
moveToTestPanel();
cy.get(
'.euiSuperDatePicker__prettyFormat[data-test-subj="superDatePickerShowDatesButton"]'
)
.contains('This year')
.should('exist');
cy.wait(delay);
});
});

describe('Clean up all test data', () => {
it.skip('Deletes test panel', () => {
moveToPanelHome();
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]')
.trigger('mouseover')
.click();
cy.wait(delay);
cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click();
cy.wait(delay);
cy.get('.euiContextMenuItem__text')
.contains('Delete')
.trigger('mouseover')
.click();
cy.wait(delay);
cy.get('button.euiButton--danger').should('be.disabled');
cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', {
delay: 50,
});
cy.get('button.euiButton--danger').should('not.be.disabled');
cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click();
cy.wait(delay * 5);
cy.get('[data-test-subj="customPanels__noPanelsHome"]')
.contains('No Observability Dashboards')
.should('exist');
});
});

This file was deleted.

Loading

0 comments on commit a0be908

Please sign in to comment.