Skip to content

Commit

Permalink
removed observability tests that can be run locally (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#939)

* removed tests that can be run locally
* remove unused references
* fixed import style

Signed-off-by: Paul Sebastian <[email protected]>
(cherry picked from commit 76ec82d)
  • Loading branch information
paulstn committed Oct 28, 2023
1 parent 1cf80d2 commit 81c97a5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 350 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,6 +5,7 @@

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

<<<<<<< HEAD
import { delayTime, setTimeFilter, TRACE_ID } from '../../../utils/constants';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import dayjs from 'dayjs';
Expand All @@ -26,6 +27,9 @@ describe('Testing traces table empty state', () => {
cy.contains('No matches').should('exist');
});
});
=======
import { setTimeFilter, TRACE_ID } from '../../../utils/constants';
>>>>>>> 76ec82d (removed observability tests that can be run locally (#939))

describe('Testing traces table', () => {
beforeEach(() => {
Expand All @@ -37,6 +41,7 @@ describe('Testing traces table', () => {
setTimeFilter();
});

<<<<<<< HEAD
it('Renders the traces table', () => {
cy.contains(' (108)').should('exist');
cy.get('.euiTableCellContent')
Expand All @@ -54,6 +59,8 @@ describe('Testing traces table', () => {
cy.contains('-').should('exist');
});

=======
>>>>>>> 76ec82d (removed observability tests that can be run locally (#939))
it('Sorts the traces table', () => {
cy.get('.euiTableRow').first().contains('-').should('exist');
cy.get('.euiTableCellContent').contains('Trace group').click();
Expand Down
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,6 +57,7 @@ describe('Testing panels table', () => {
.click();
cy.get('.panel-header-count').contains('(2)');
});
<<<<<<< HEAD

it('Deletes panels', () => {
cy.get('.panel-header-count').contains('(2)');
Expand Down Expand Up @@ -160,4 +150,6 @@ describe('Clean up all test data', () => {
.contains('No Observability Dashboards')
.should('exist');
});
=======
>>>>>>> 76ec82d (removed observability tests that can be run locally (#939))
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,12 @@
import {
delayTime,
TEST_NOTEBOOK,
MARKDOWN_TEXT,
SAMPLE_URL,
SQL_QUERY_TEXT,
PPL_QUERY_TEXT,
BASE_PATH,
} from '../../../utils/constants';

const moveToEventsHome = () => {
cy.visit(`${BASE_PATH}/app/observability-logs#/`);
cy.wait(delayTime * 3);
};

const moveToPanelHome = () => {
cy.visit(`${BASE_PATH}/app/observability-dashboards#/`);
cy.wait(delayTime * 3);
};
const moveToTestNotebook = () => {
cy.visit(`${BASE_PATH}/app/observability-notebooks#/`, {
timeout: delayTime * 3,
Expand All @@ -35,123 +25,11 @@ const moveToTestNotebook = () => {
.click();
};

describe('Adding sample visualization', () => {
it('Add sample observability data', () => {
moveToEventsHome();
cy.get('button[data-test-subj="eventHomeAction"]')
.trigger('mouseover')
.click();
cy.wait(100);
cy.get('button[data-test-subj="eventHomeAction__addSamples"]')
.trigger('mouseover')
.click();
cy.wait(100 * 3);
cy.get('.euiModalHeader__title[data-test-subj="confirmModalTitleText"]')
.contains('Add samples')
.should('exist');
cy.wait(100);

cy.get('button[data-test-subj="confirmModalConfirmButton"]')
.trigger('mouseover')
.click();
cy.wait(100 * 5);
cy.get('.euiToastHeader__title', { timeout: delayTime * 3 }).should(
'contain',
'successfully'
);
cy.wait(100);
});
});

describe('Testing notebooks table', () => {
beforeEach(() => {
cy.visit(`${BASE_PATH}/app/observability-notebooks#/`);
});

it('Creates a notebook and redirects to the notebook', () => {
cy.get('.euiButton__text').contains('Create notebook').click();
cy.wait(delayTime);
cy.get('input.euiFieldText').type(TEST_NOTEBOOK);
cy.get('.euiButton__text')
.contains(/^Create$/)
.click();
cy.wait(delayTime);

cy.contains(TEST_NOTEBOOK).should('exist');
});

it('Duplicates and renames a notebook', () => {
cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Actions').click();
cy.wait(delayTime);
cy.get('.euiContextMenuItem__text').contains('Duplicate').click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Duplicate').click();
cy.wait(delayTime);

cy.get('.euiCheckbox__input[title="Select this row"]').eq(1).click();
cy.wait(delayTime);
cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Actions').click();
cy.wait(delayTime);
cy.get('.euiContextMenuItem__text').contains('Rename').click();
cy.wait(delayTime);
cy.get('input.euiFieldText').type(' (rename)');
cy.get('.euiButton__text').contains('Rename').click();
cy.wait(delayTime);
});

it('Deletes notebooks', () => {
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]').click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Actions').click();
cy.wait(delayTime);
cy.get('.euiContextMenuItem__text').contains('Delete').click();
cy.wait(delayTime);

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.get('.euiTextAlign').contains('No notebooks').should('exist');

// keep a notebook for testing
cy.get('.euiButton__text').contains('Create notebook').click();
cy.wait(delayTime);
cy.get('input.euiFieldText').type(TEST_NOTEBOOK);
cy.get('.euiButton__text')
.contains(/^Create$/)
.click();
cy.wait(delayTime * 2);
});
});

describe('Testing paragraphs', () => {
beforeEach(() => {
moveToTestNotebook();
});

it('Goes into a notebook and creates paragraphs', () => {
cy.get('.euiButton__text').contains('Add').click();
cy.wait(delayTime);

cy.get('.euiTextArea').should('exist');

cy.get('.euiButton__text').contains('Run').click();
cy.wait(delayTime);
cy.get('.euiTextColor').contains('Input is required.').should('exist');
cy.get('.euiTextArea').clear();
cy.get('.euiTextArea').type(MARKDOWN_TEXT);
cy.wait(delayTime);

cy.get('.euiButton__text').contains('Run').click();
cy.wait(delayTime);
});

it('Renders markdown', () => {
cy.get('.euiTextArea').should('not.exist');
cy.get(`a[href="${SAMPLE_URL}"]`).should('exist');
Expand Down Expand Up @@ -282,58 +160,3 @@ describe('Testing paragraphs', () => {
cy.get('.euiText').contains('No notebooks').should('exist');
});
});

describe('clean up all test data', () => {
it('Delete visualizations from event analytics', () => {
moveToEventsHome();
cy.get('[data-test-subj="tablePaginationPopoverButton"]')
.trigger('mouseover')
.click();
cy.get('.euiContextMenuItem__text')
.contains('50 rows')
.trigger('mouseover')
.click();
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]')
.trigger('mouseover')
.click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click();
cy.wait(delayTime);
cy.get('.euiContextMenuItem__text')
.contains('Delete')
.trigger('mouseover')
.click();
cy.wait(delayTime);
cy.get('button.euiButton--danger').should('be.disabled');
cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', {
delayTime: 50,
});
cy.get('button.euiButton--danger').should('not.be.disabled');
cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click();
cy.wait(delayTime);
cy.get('.euiTextAlign')
.contains('No Queries or Visualizations')
.should('exist');
});

it('Deletes test panel', () => {
moveToPanelHome();
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]')
.trigger('mouseover')
.click();
cy.wait(delayTime);
cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click();
cy.wait(delayTime);
cy.get('.euiContextMenuItem__text')
.contains('Delete')
.trigger('mouseover')
.click();
cy.wait(delayTime);
cy.get('button.euiButton--danger').should('be.disabled');
cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', {
delayTime: 50,
});
cy.get('button.euiButton--danger').should('not.be.disabled');
cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click();
});
});
Loading

0 comments on commit 81c97a5

Please sign in to comment.