Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport main] Fix flaky tests for Trace Analytics and Panels #853

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ describe('Testing dashboard table', () => {
});

it('Redirects to traces table with filter', () => {
cy.get('.euiLink').contains('13').click();
cy.get('[data-test-subj="dashboard-table-traces-button"]')
.contains('13')
.click();
cy.wait(delayTime);

cy.contains(' (13)').should('exist');
Expand Down Expand Up @@ -107,7 +109,9 @@ describe('Testing plots', () => {

it('Renders service map', () => {
// plotly scale texts are in attribute "data-unformatted"
cy.get('text.ytitle[data-unformatted="Latency (ms)"]').should('exist');
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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,9 @@
import {
PANEL_DELAY as delay,
TEST_PANEL,
PPL_VISUALIZATIONS,
PPL_VISUALIZATIONS_NAMES,
supressResizeObserverIssue,
BASE_PATH,
} from '../../../utils/constants';

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

const moveToPanelHome = () => {
cy.visit(`${BASE_PATH}/app/observability-dashboards#`);
cy.wait(delay * 3);
Expand All @@ -35,40 +27,6 @@ const moveToTestPanel = () => {
cy.wait(delay);
};

describe('Creating visualizations', () => {
beforeEach(() => {
moveToEventsHome();
});

it('Create first visualization in event analytics', () => {
cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[0], {
delay: 50,
});
cy.get('.euiButton__text').contains('Refresh').trigger('mouseover').click();
cy.wait(delay);
supressResizeObserverIssue();
cy.get('button[id="main-content-vis"]')
.contains('Visualizations')
.trigger('mouseover')
.click();
cy.wait(delay * 2);
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]')
.trigger('mouseover')
.click();
cy.wait(1000);
cy.get('[data-test-subj="eventExplorer__querySaveName"]')
.focus()
.type(PPL_VISUALIZATIONS_NAMES[0], {
delay: 50,
});
cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]')
.trigger('mouseover')
.click();
cy.wait(delay);
cy.get('.euiToastHeader__title').contains('successfully').should('exist');
});
});

describe('Testing panels table', () => {
beforeEach(() => {
moveToPanelHome();
Expand Down Expand Up @@ -112,6 +70,7 @@ describe('Testing panels table', () => {
});

it('Deletes panels', () => {
cy.get('.panel-header-count').contains('(2)');
cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]')
.trigger('mouseover')
.click();
Expand Down Expand Up @@ -166,6 +125,7 @@ describe('Testing a panel', () => {
});
cy.get('.euiLink').contains('This year').trigger('mouseover').click();
cy.wait(delay * 2);
moveToTestPanel();
cy.get(
'.euiSuperDatePicker__prettyFormat[data-test-subj="superDatePickerShowDatesButton"]'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => {
timeout: TIMEOUT_DELAY,
}).click();
cy.get('.euiQuickSelect__applyButton').click();
cy.get('.euiSuperDatePicker__prettyFormatLink').click();
cy.get(
'button.euiDatePopoverButton--start[data-test-subj="superDatePickerstartDatePopoverButton"]'
).click();
cy.get('[data-test-subj="superDatePickerShowDatesButton"]').click();
cy.get('.euiTab__content').contains('Absolute').click();
cy.get('input[data-test-subj="superDatePickerAbsoluteDateInput"]', {
timeout: TIMEOUT_DELAY,
Expand Down
Loading