Skip to content

Commit

Permalink
Merge branch '2.x' into backport/backport-1781-to-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanL1997 authored Dec 17, 2024
2 parents d8498bc + 2f8b27f commit 63d6423
Show file tree
Hide file tree
Showing 225 changed files with 15,745 additions and 8,870 deletions.
55 changes: 26 additions & 29 deletions .cypress/integration/app_analytics_test/app_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ describe('Setting availability', () => {
cy.get('.euiTableRow').should('have.length.lessThan', 1);
cy.get('[data-test-subj="applicationTitle"]').should('contain', nameThree);
cy.get('.euiBreadcrumb[href="#/"]').click();
cy.reload();
cy.get(`[data-test-subj="${nameThree}ApplicationLink"]`);
cy.get('[data-test-subj="setAvailabilityHomePageLink"]').first().click();
cy.get('[data-test-subj="applicationTitle"]').should('contain', nameThree);
Expand Down Expand Up @@ -254,13 +255,15 @@ describe('Viewing application', () => {

it('Shows latency variance in dashboards table', () => {
changeTimeTo24('years');
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
cy.get('[data-test-subj="dashboardTable"]').first().within(($table) => {
cy.get('.plot-container').should('have.length.at.least', 1);
})
});

it('Adds filter when Trace group name is clicked', () => {
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
cy.get('[data-test-subj="dashboard-table-trace-group-name-button"]').contains('client_create_order').click();
cy.get('[data-test-subj="client_create_orderFilterBadge"]').should('exist');
Expand All @@ -271,7 +274,7 @@ describe('Viewing application', () => {

it('Opens service detail flyout when Service Name is clicked', () => {
cy.get('[data-test-subj="app-analytics-serviceTab"]').click();
cy.get('.euiLink').contains('authentication').click();
cy.get('*[data-test-subj^="service-link"]').eq(0).click();
cy.get('[data-test-subj="serviceDetailFlyoutTitle"]').should('be.visible');
cy.get('[data-test-subj="Number of connected servicesDescriptionList"]').should('contain', '3');
cy.get('[data-text="Errors"]').eq(1).click(); // Selecting errors tab within flyout
Expand All @@ -294,6 +297,7 @@ describe('Viewing application', () => {
});
cy.get('[data-test-subj="euiFlyoutCloseButton"]').click();
cy.get('[data-test-subj="traceDetailFlyout"]').should('not.exist');
cy.get('[data-test-subj="superDatePickerShowDatesButton"]').click();//added to replace wait
cy.get('[title="03f9c770db5ee2f1caac0afc36db49ba"]').click();
cy.get('[data-text="Span list"]').click();
cy.get('[data-test-subj="dataGridRowCell"]').contains('d67c5bb617ba9203').click();
Expand Down Expand Up @@ -432,11 +436,12 @@ describe('Viewing application', () => {
cy.get('[data-test-subj="app-analytics-configTab"]').click();
cy.get('select').select(visOneName);
cy.intercept('PUT', `**/api/observability/application`).as('selectUpdate');
cy.wait('@selectUpdate')
cy.wait(2000); // despite the previous wait grabbing the call that updates the panel select, it doesn't appear without this
cy.wait('@selectUpdate');

moveToHomePage();
cy.intercept('GET', `**/api/observability/operational_panels/panels/**`).as('loadingPanels')
cy.wait('@loadingPanels');
cy.reload();
cy.get('[data-test-subj="AvailableAvailabilityBadge"][style="background-color: rgb(84, 179, 153); color: rgb(0, 0, 0);"]').should('contain', 'Available');
moveToApplication(nameOne);
cy.get('[data-test-subj="app-analytics-configTab"]').click();
Expand Down Expand Up @@ -479,8 +484,7 @@ describe('Separate from other plugins', () => {
cy.visit(
`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/`
);
cy.get('[data-test-subj="operationalPanelsActionsButton"]', { timeout: timeoutDelay }).click();
cy.get('[data-test-subj="addSampleContextMenuItem"]', { timeout: timeoutDelay }).click();
cy.get('.euiButtonContent').contains('Add samples').click();
cy.get('[data-test-subj="confirmModalConfirmButton"]', { timeout: timeoutDelay }).click();
cy.get('.euiLink').contains('[Logs] Web traffic Panel').first().click();
cy.get('[data-test-subj="addVisualizationButton"]').click();
Expand Down Expand Up @@ -517,10 +521,12 @@ describe('Editing application', () => {
cy.get('[data-test-subj="logSourceAccordion"]').trigger('mouseover').click();
cy.get('[data-test-subj="searchAutocompleteTextArea"]').should('be.disabled');
cy.get('[data-test-subj="servicesEntitiesAccordion"]').trigger('mouseover').click();
cy.get('[data-test-subj="servicesEntitiesCountBadge"]').should('contain', '1');
cy.get('[data-test-subj="servicesEntitiesComboBox"]').click();
cy.get('.euiFilterSelectItem').contains(service_two).click();
cy.get('[data-test-subj="servicesEntitiesCountBadge"]').should('contain', '2');
cy.get('[data-test-subj="traceGroupsAccordion"]').trigger('mouseover').click();
cy.get('[data-test-subj="traceGroupsCountBadge"]').should('contain', '2');
cy.get('[data-test-subj="comboBoxToggleListButton"]').eq(1).click();
cy.get('.euiFilterSelectItem').contains(trace_three).trigger('click');
cy.get('[data-test-subj="traceGroupsCountBadge"]').should('contain', '3');
Expand All @@ -547,39 +553,30 @@ describe('Application Analytics home page', () => {
});

it('Renames application', () => {
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('[data-test-subj="renameApplicationContextMenuItem"]').should('be.disabled');
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('.euiTableRow').first().find('.euiCheckbox').click();
cy.wait(2000); // checkbox being clicked has a small delay before enabling action button
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('[data-test-subj="renameApplicationContextMenuItem"]').click();
cy.get('[data-test-subj="customModalFieldText"]').clear().click().type(newName);
cy.get('[data-test-subj="runModalButton"]').click();
cy.get('[data-test-subj="renameApplication"]').eq(0).click();
cy.get('input[type="text"]').clear().click().type(newName);
cy.get('.euiButton__text').contains('Rename').click();
cy.get('.euiToast').contains(`Application successfully renamed to "${newName}"`);
cy.get('.euiTableRow').first().within(($row) => {
cy.get('.euiLink').contains(newName).should('exist');
});
});

it('Deletes application', () => {
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('[data-test-subj="deleteApplicationContextMenuItem"]').should('exist');
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('.euiTableRow').first().within(($row) => {
cy.get('.euiCheckbox').click();
});
cy.get('.euiTableRow').eq(1).within(($row) => {
cy.get('.euiCheckbox').click();
});
cy.get('.euiTableRow').eq(2).within(($row) => {
cy.get('.euiCheckbox').click();
});
cy.get('[data-test-subj="appAnalyticsActionsButton"]').click();
cy.get('[data-test-subj="deleteApplicationContextMenuItem"]').click();
cy.get('.euiFieldSearch').clear().type(nameTwo);
cy.get('[data-test-subj="deleteApplication"]').click();
cy.get('[data-test-subj="popoverModal__deleteTextInput"]').type('delete');
cy.get('[data-test-subj="popoverModal__deleteButton"').click();
cy.get('.euiToast').contains(`Applications successfully deleted!`);
cy.get(`[data-test-subj="${newName}ApplicationLink"]`).should('not.exist');
cy.get('.euiFieldSearch').clear().type(nameThree);
cy.get('[data-test-subj="deleteApplication"]').click();
cy.get('[data-test-subj="popoverModal__deleteTextInput"]').type('delete');
cy.get('[data-test-subj="popoverModal__deleteButton"').click();
cy.get('.euiFieldSearch').clear().type(newName);
cy.get('[data-test-subj="deleteApplication"]').click();
cy.get('[data-test-subj="popoverModal__deleteTextInput"]').type('delete');
cy.get('[data-test-subj="popoverModal__deleteButton"').click();
cy.get('.euiFieldSearch').clear()
cy.get('[data-test-subj="applicationHomePageTitle"]').contains('(0)');
});
});
54 changes: 18 additions & 36 deletions .cypress/integration/event_analytics_test/event_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ import {
} from '../../utils/event_analytics/helpers';

describe('Adding sample data and visualization', () => {
it('Adds sample flights data for event analytics', () => {
it('Adds sample flights and logs data for event analytics', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardflights"]')
.contains(/(Add|View) data/)
.click();
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardlogs"]')
.contains(/(Add|View) data/)
.click();
});
});

Expand All @@ -53,28 +57,6 @@ describe('Has working breadcrumbs', () => {
});
});

describe('Search a query on event home', () => {
it('Search a query and redirect to explorer to display query output', () => {
landOnEventHome();

cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query);
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click();
cy.get('[data-test-subj="superDatePickerCommonlyUsed_Year_to date"]').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click();
cy.window()
.its('store')
.invoke('getState')
.then((state) => {
expect(Object.values(state.queries)[0]['rawQuery'].trim()).equal(TEST_QUERIES[0].query);
expect(Object.values(state.queries)[0]['selectedDateRange'][0]).equal('now/y');
expect(Object.values(state.queries)[0]['selectedDateRange'][1]).equal('now');
});

cy.url().should('contain', '#/explorer');
cy.get('[data-test-subj="searchAutocompleteTextArea"]').contains(TEST_QUERIES[0].query);
});
});

describe('Open flyout for a data row to see details', () => {
beforeEach(() => {
landOnEventExplorer();
Expand All @@ -83,7 +65,7 @@ describe('Open flyout for a data row to see details', () => {
});

it('Should be able to open flyout and see data, json and traces', () => {
cy.get('[data-test-subj="eventExplorer__flyoutArrow"]').first().click();
cy.get('[data-test-subj="eventExplorer__flyout"]').first().click();
cy.get('.observability-flyout').should('exist');
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content')
.contains('Table')
Expand All @@ -97,7 +79,7 @@ describe('Open flyout for a data row to see details', () => {
});

it('Should be able to see surrounding docs', () => {
cy.get('[data-test-subj="eventExplorer__flyoutArrow"]').first().click();
cy.get('[data-test-subj="eventExplorer__flyout"]').first().click();
cy.get('.observability-flyout span.euiButton__text')
.contains('View surrounding events')
.should('be.visible')
Expand Down Expand Up @@ -190,14 +172,12 @@ describe('Click actions test', () => {
});

it('Actions - click event explorer', () => {
cy.get('[data-test-subj="eventHomeAction"]').click();
cy.get('[data-test-subj="eventHomeAction__explorer"]').click();
cy.url().should('contain', '#/explorer');
});

it('Actions - add sample data', () => {
cy.get('[data-test-subj="eventHomeAction"]').click();
cy.get('[data-test-subj="eventHomeAction__addSamples"]').click();
cy.get('[data-test-subj="actionAddSamples"]').click();
cy.get('[data-test-subj="confirmModalConfirmButton"]').click();
cy.get('.euiToastHeader__title').should('contain', 'successfully');
});
Expand All @@ -218,6 +198,7 @@ describe('Saves a query on explorer page', () => {
querySearch(TEST_QUERIES[1].query, TEST_QUERIES[1].dateRangeDOM);
cy.get('button[id="main-content-vis"]').contains('Visualizations').click();
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click();
cy.get('[data-test-subj="comboBoxToggleListButton"]').eq(2).click();
cy.get('[data-test-subj="eventExplorer__querySaveName"]')
.focus()
.type(SAVE_QUERY2, { force: true });
Expand Down Expand Up @@ -299,7 +280,7 @@ describe('Override timestamp for an index', () => {
landOnEventExplorer();
clearQuerySearchBoxText('searchAutocompleteTextArea');
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[2].query);
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.get('.tab-title').contains('Events').click();
cy.get('[data-test-subj="eventExplorer__overrideDefaultTimestamp"]').click({ force: true });

Expand All @@ -318,10 +299,10 @@ describe('Toggle the sidebar fields', () => {
querySearch(TEST_QUERIES[0].query, YEAR_TO_DATE_DOM_ID);
cy.get('[data-test-subj="fieldToggle-AvgTicketPrice"]').click();
cy.get('[data-test-subj="field-AvgTicketPrice"]').should('exist');
cy.get('[data-test-subj="docTable"]').find('th').contains('_source').should('not.exist');
cy.get('[data-test-subj="docTable"]').find('.euiDataGridHeaderCell').contains('Source').should('not.exist');
cy.get('[data-test-subj="fieldToggle-AvgTicketPrice"]').click();
cy.get('[data-test-subj="field-AvgTicketPrice"]').should('exist');
cy.get('[data-test-subj="docTable"]').find('th').contains('_source').should('exist');
cy.get('[data-test-subj="docTable"]').find('.euiDataGridHeaderCell').contains('Source').should('exist');
});
});

Expand Down Expand Up @@ -473,7 +454,8 @@ describe('Visualizing data', () => {
});

it('Visualize pie chart', () => {
cy.get('[data-test-subj="comboBoxInput"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('[data-test-subj="comboBoxInput"]').eq(1).click();
cy.get('[data-test-subj="comboBoxOptionsList "] span').contains(VIS_TYPE_PIE).click();
cy.get('[data-test-subj="vizConfigSection-series"]')
.find('[data-test-subj="viz-config-add-btn"]')
Expand All @@ -482,7 +464,7 @@ describe('Visualizing data', () => {
cy.get('[data-test-subj="vizConfigSection-dimensions"]')
.find('[data-test-subj="viz-config-add-btn"]')
.click();
cy.get('[data-test-subj="explorer__vizDataConfig-panel"]')
cy.get('.logExplorerVisConfig__section')
.find('[data-test-subj="comboBoxInput"]')
.click()
.type(FIELD_HOST);
Expand All @@ -497,7 +479,7 @@ describe('Visualizing data', () => {
});

it('Visualize vertical bar chart', () => {
cy.get('[data-test-subj="comboBoxInput"]').click();
cy.get('[data-test-subj="comboBoxInput"]').eq(1).click();
cy.get('[data-test-subj="comboBoxOptionsList "] span').contains(VIS_TYPE_VBAR).click();
cy.get('[data-test-subj="vizConfigSection-series"]')
.find('[data-test-subj="viz-config-add-btn"]')
Expand All @@ -506,7 +488,7 @@ describe('Visualizing data', () => {
cy.get('[data-test-subj="vizConfigSection-dimensions"]')
.find('[data-test-subj="viz-config-add-btn"]')
.click();
cy.get('[data-test-subj="explorer__vizDataConfig-panel"]')
cy.get('.logExplorerVisConfig__section')
.find('[data-test-subj="comboBoxInput"]')
.click()
.type(FIELD_HOST);
Expand All @@ -515,7 +497,7 @@ describe('Visualizing data', () => {
cy.get('[data-test-subj="vizConfigSection-breakdowns"]')
.find('[data-test-subj="viz-config-add-btn"]')
.click();
cy.get('[data-test-subj="explorer__vizDataConfig-panel"]')
cy.get('.logExplorerVisConfig__section')
.find('[data-test-subj="comboBoxInput"]')
.click()
.type(FIELD_AGENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('Add nginx integration instance flow', () => {

cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('be.disabled');

cy.get(`input.euiFieldText[placeholder="${testInstance}"]`).focus().type(testInstance, {
cy.get(`input.euiFieldText[placeholder="delete"]`).focus().type("delete", {
delay: 50,
});
cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('not.be.disabled');
Expand Down
Loading

0 comments on commit 63d6423

Please sign in to comment.