Skip to content

Commit

Permalink
Merge branch 'main' into feature/multitenancy
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianQuispel authored Feb 16, 2024
2 parents 0daad29 + 2409cf7 commit 0f4fb09
Show file tree
Hide file tree
Showing 17 changed files with 7,273 additions and 1,255 deletions.
35 changes: 18 additions & 17 deletions .cypress/integration/panels_test/panels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
TEST_PANEL,
} from '../../utils/panel_constants';

describe('Panels testing with Sample Data', () => {
describe('Panels testing with Sample Data', { defaultCommandTimeout: 10000 }, () => {
suppressResizeObserverIssue(); //needs to be in file once

before(() => {
Expand All @@ -43,19 +43,18 @@ describe('Panels testing with Sample Data', () => {
});

it('Create first visualization in event analytics', () => {
cy.get('[data-test-subj="eventHomeAction__explorer"]').click();
cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[0], {
delay: 50,
});
cy.get('.euiButton__text').contains('Refresh').trigger('mouseover').click();
cy.wait(delay); //occationaly refresh wont work without this
cy.get('.euiButton__text').contains('Run').trigger('mouseover').click();
cy.get('button[id="main-content-vis"]')
.contains('Visualizations')
.trigger('mouseover', { force: true })
.click({ force: true });
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]')
.trigger('mouseover')
.click({ force: true });
cy.wait(delay * 5); //Wont save as correct name without wait
cy.get('[data-test-subj="eventExplorer__querySaveName"]')
.focus()
.type(PPL_VISUALIZATIONS_NAMES[0]);
Expand All @@ -65,16 +64,21 @@ describe('Panels testing with Sample Data', () => {
});

it('Create second visualization in event analytics', () => {
cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[1]);
cy.get('.euiButton__text').contains('Refresh').trigger('mouseover').click();
cy.get('[data-test-subj="eventHomeAction__explorer"]').click();
// Workaround until issue #1403 is fixed
// Should be the following commented lines
// cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[1], {
// delay: 50,
// });
cy.get('[id^=autocomplete-textarea]').focus().invoke('val', PPL_VISUALIZATIONS[1]).trigger('input').trigger('change');
cy.get('.euiButton__text').contains('Run').trigger('mouseover').click();
cy.get('button[id="main-content-vis"]')
.contains('Visualizations')
.trigger('mouseover')
.click({ force: true });
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]')
.trigger('mouseover')
.click();
cy.wait(delay * 5); //Wont save as correct name without wait
cy.get('[data-test-subj="eventExplorer__querySaveName"]')
.focus()
.type(PPL_VISUALIZATIONS_NAMES[1]);
Expand Down Expand Up @@ -151,7 +155,6 @@ describe('Panels testing with Sample Data', () => {
it('Searches panels', () => {
createLegacyPanel('Legacy Named');
createSavedObjectPanel('Saved Object');
cy.wait(delay); //Needed so the panel appears on the dashboard page
cy.reload();
cy.get('input[data-test-subj="operationalPanelSearchBar"]')
.focus()
Expand Down Expand Up @@ -306,15 +309,17 @@ describe('Panels testing with Sample Data', () => {
cy.get('h1[data-test-subj="panelNameHeader"]').contains('Renamed Panel').should('exist');
});

it('Change date filter of the panel', () => {
cy.get('.euiButtonEmpty[data-test-subj="superDatePickerToggleQuickMenuButton"]').click({
// Skipping for now as it's flaky (failed on 34th run)
it.skip('Change date filter of the panel', () => {
cy.intercept('**').as('putRequest');
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click({
force: true,
});
cy.wait(delay); //flyout won't open sometimes without
cy.wait('@putRequest');
cy.get('button[data-test-subj="superDatePickerCommonlyUsed_This_year"]').click({
force: true,
});
cy.get('button[data-test-subj="superDatePickerShowDatesButton"]')
cy.get('[data-test-subj="superDatePickerShowDatesButton"]')
.contains('This year')
.should('exist');
});
Expand All @@ -329,7 +334,6 @@ describe('Panels testing with Sample Data', () => {
cy.get('button[data-test-subj="selectExistingVizContextMenuItem"]').click();
cy.get('select').select(PPL_VISUALIZATIONS_NAMES[0]);
cy.get('button[aria-label="refreshPreview"]').trigger('mouseover').click();
cy.get('.plot-container').should('exist');
cy.get('button[data-test-subj="addFlyoutButton"]').click({ force: true });
cy.get('.euiToastHeader__title').contains('successfully').should('exist');
});
Expand All @@ -344,7 +348,6 @@ describe('Panels testing with Sample Data', () => {
cy.get('button[data-test-subj="selectExistingVizContextMenuItem"]').click();
cy.get('select').select(PPL_VISUALIZATIONS_NAMES[1]);
cy.get('button[aria-label="refreshPreview"]').trigger('mouseover').click();
cy.get('.plot-container').should('exist');
cy.get('button[data-test-subj="addFlyoutButton"]').click({ force: true });
cy.get('.euiToastHeader__title').contains('successfully').should('exist');
});
Expand Down Expand Up @@ -380,7 +383,6 @@ describe('Panels testing with Sample Data', () => {
cy.get('[data-test-subj="searchAutocompleteTextArea"]')
.trigger('mouseover')
.click({ force: true })
.wait(delay * 5)
.focus()
.type(PPL_FILTER);
cy.get('button[data-test-subj="superDatePickerApplyTimeButton"]').click({ force: true });
Expand Down Expand Up @@ -553,9 +555,8 @@ describe('Panels testing with Sample Data', () => {
cy.get('button[data-test-subj="createNewVizContextMenuItem"]').click();

cy.url().should('match', new RegExp('(.*)#/explorer'));
cy.get('a[data-test-subj="eventExplorer__addNewTab"]').click({ force: true });
cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[0]);
cy.get('button[data-test-subj="superDatePickerApplyTimeButton"]').click({ force: true });
cy.get('.euiButton__text').contains('Run').trigger('mouseover').click();

cy.get('button[id="main-content-vis"]')
.contains('Visualizations')
Expand Down
8 changes: 7 additions & 1 deletion common/query_manager/query_parser/ppl_query_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export class PPLQueryParser {

getStats() {
this.visitor = new StatsAstBuilder();
return this.visitor.visitRoot(this.parser!.root()).getTokens();
let inter = null;
try {
inter = this.visitor.visitRoot(this.parser!.root()).getTokens();
} catch (e) {
console.error(e);
}
return inter;
}
}
Loading

0 comments on commit 0f4fb09

Please sign in to comment.