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

fix formatting for skipped tests #180779

Merged
merged 1 commit into from
Apr 15, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,156 +70,160 @@ const handleIntercepts = () => {
};

// Failing: See https://github.com/elastic/kibana/issues/180755
describe.skip('Discover Timeline State Integration', {
tags: ['@ess', '@skipInServerless'],
}, () => {
beforeEach(() => {
login();
visitWithTimeRange(ALERTS_URL);
createTimelineFromBottomBar();
goToEsqlTab();
updateDateRangeInLocalDatePickers(DISCOVER_CONTAINER, INITIAL_START_DATE, INITIAL_END_DATE);
handleIntercepts();
});

describe('ESQL tab state', () => {
it('should be able create an empty timeline with default esql tab state', () => {
addNameToTimelineAndSave('Timerange timeline');
createNewTimeline();
describe.skip(
'Discover Timeline State Integration',
{
tags: ['@ess', '@skipInServerless'],
},
() => {
beforeEach(() => {
login();
visitWithTimeRange(ALERTS_URL);
createTimelineFromBottomBar();
goToEsqlTab();
cy.get(GET_LOCAL_SHOW_DATES_BUTTON(DISCOVER_CONTAINER)).should(
'contain.text',
`Last 15 minutes`
);
updateDateRangeInLocalDatePickers(DISCOVER_CONTAINER, INITIAL_START_DATE, INITIAL_END_DATE);
handleIntercepts();
});
it('should save/restore esql tab dataview/timerange/filter/query/columns when saving/resoring timeline', () => {
const timelineSuffix = Date.now();
const timelineName = `DataView timeline-${timelineSuffix}`;
const column1 = 'event.category';
const column2 = 'ecs.version';
addDiscoverEsqlQuery(esqlQuery);
addFieldToTable(column1);
addFieldToTable(column2);

// create a custom timeline
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// create an empty timeline
createNewTimeline();
// switch to old timeline
openTimelineFromSettings();
openTimelineById(timelineId);
goToEsqlTab();
cy.get(LOADING_INDICATOR).should('not.exist');
verifyDiscoverEsqlQuery(esqlQuery);
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist');
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist');
cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should(
'have.text',
INITIAL_START_DATE
);
});
});
it('should save/restore esql tab dataview/timerange/filter/query/columns when timeline is opened via url', () => {
const timelineSuffix = Date.now();
const timelineName = `DataView timeline-${timelineSuffix}`;
const column1 = 'event.category';
const column2 = 'ecs.version';
addDiscoverEsqlQuery(esqlQuery);
addFieldToTable(column1);
addFieldToTable(column2);
describe('ESQL tab state', () => {
it('should be able create an empty timeline with default esql tab state', () => {
addNameToTimelineAndSave('Timerange timeline');
createNewTimeline();
goToEsqlTab();
cy.get(GET_LOCAL_SHOW_DATES_BUTTON(DISCOVER_CONTAINER)).should(
'contain.text',
`Last 15 minutes`
);
});
it('should save/restore esql tab dataview/timerange/filter/query/columns when saving/resoring timeline', () => {
const timelineSuffix = Date.now();
const timelineName = `DataView timeline-${timelineSuffix}`;
const column1 = 'event.category';
const column2 = 'ecs.version';
addDiscoverEsqlQuery(esqlQuery);
addFieldToTable(column1);
addFieldToTable(column2);

// create a custom timeline
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// reload the page with the exact url
cy.reload();
verifyDiscoverEsqlQuery(esqlQuery);
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist');
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist');
cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should(
'have.text',
INITIAL_START_DATE
);
});
});
it('should save/restore esql tab ES|QL when saving timeline', () => {
const timelineSuffix = Date.now();
const timelineName = `ES|QL timeline-${timelineSuffix}`;
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// create an empty timeline
createNewTimeline();
// switch to old timeline
openTimelineFromSettings();
openTimelineById(timelineId).then(() => {
cy.get(LOADING_INDICATOR).should('not.exist');
// create a custom timeline
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// create an empty timeline
createNewTimeline();
// switch to old timeline
openTimelineFromSettings();
openTimelineById(timelineId);
goToEsqlTab();
cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('not.exist');
cy.get(LOADING_INDICATOR).should('not.exist');
verifyDiscoverEsqlQuery(esqlQuery);
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist');
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist');
cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should(
'have.text',
INITIAL_START_DATE
);
});
});
});
});
});
it('should save/restore esql tab dataview/timerange/filter/query/columns when timeline is opened via url', () => {
const timelineSuffix = Date.now();
const timelineName = `DataView timeline-${timelineSuffix}`;
const column1 = 'event.category';
const column2 = 'ecs.version';
addDiscoverEsqlQuery(esqlQuery);
addFieldToTable(column1);
addFieldToTable(column2);

describe('Discover saved search state for ESQL tab', () => {
it('should save esql tab saved search with `Security Solution` tag', () => {
const timelineSuffix = Date.now();
const timelineName = `SavedObject timeline-${timelineSuffix}`;
addDiscoverEsqlQuery(esqlQuery);
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
cy.get(LOADING_INDICATOR).should('not.exist');
openKibanaNavigation();
navigateFromKibanaCollapsibleTo(STACK_MANAGEMENT_PAGE);
cy.get(LOADING_INDICATOR).should('not.exist');
goToSavedObjectSettings();
cy.get(LOADING_INDICATOR).should('not.exist');
clickSavedObjectTagsFilter();
cy.get(GET_SAVED_OBJECTS_TAGS_OPTION('Security_Solution')).trigger('click');
cy.get(BASIC_TABLE_LOADING).should('not.exist');
cy.get(SAVED_OBJECTS_ROW_TITLES).should(
'contain.text',
`Saved search for timeline - ${timelineName}`
);
// create a custom timeline
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// reload the page with the exact url
cy.reload();
verifyDiscoverEsqlQuery(esqlQuery);
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist');
cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist');
cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should(
'have.text',
INITIAL_START_DATE
);
});
});
it('should save/restore esql tab ES|QL when saving timeline', () => {
const timelineSuffix = Date.now();
const timelineName = `ES|QL timeline-${timelineSuffix}`;
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_PATCH_REQ}`)
.its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH)
.then((timelineId) => {
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
// create an empty timeline
createNewTimeline();
// switch to old timeline
openTimelineFromSettings();
openTimelineById(timelineId).then(() => {
cy.get(LOADING_INDICATOR).should('not.exist');
goToEsqlTab();
cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('not.exist');
});
});
});
});

it('should rename the saved search on timeline rename', () => {
const initialTimelineSuffix = Date.now();
const initialTimelineName = `Timeline-${initialTimelineSuffix}`;
addDiscoverEsqlQuery(esqlQuery);
addNameToTimelineAndSave(initialTimelineName);
cy.get(LOADING_INDICATOR).should('not.exist');
const timelineSuffix = Date.now();
const renamedTimelineName = `Rename timeline-${timelineSuffix}`;
addNameToTimelineAndSave(renamedTimelineName);
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
openKibanaNavigation();
navigateFromKibanaCollapsibleTo(STACK_MANAGEMENT_PAGE);
cy.get(LOADING_INDICATOR).should('not.exist');
goToSavedObjectSettings();
cy.get(LOADING_INDICATOR).should('not.exist');
clickSavedObjectTagsFilter();
cy.get(GET_SAVED_OBJECTS_TAGS_OPTION('Security_Solution')).trigger('click');
cy.get(BASIC_TABLE_LOADING).should('not.exist');
cy.get(SAVED_OBJECTS_ROW_TITLES).should(
'contain.text',
`Saved search for timeline - ${renamedTimelineName}`
);
describe('Discover saved search state for ESQL tab', () => {
it('should save esql tab saved search with `Security Solution` tag', () => {
const timelineSuffix = Date.now();
const timelineName = `SavedObject timeline-${timelineSuffix}`;
addDiscoverEsqlQuery(esqlQuery);
addNameToTimelineAndSave(timelineName);
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
cy.get(LOADING_INDICATOR).should('not.exist');
openKibanaNavigation();
navigateFromKibanaCollapsibleTo(STACK_MANAGEMENT_PAGE);
cy.get(LOADING_INDICATOR).should('not.exist');
goToSavedObjectSettings();
cy.get(LOADING_INDICATOR).should('not.exist');
clickSavedObjectTagsFilter();
cy.get(GET_SAVED_OBJECTS_TAGS_OPTION('Security_Solution')).trigger('click');
cy.get(BASIC_TABLE_LOADING).should('not.exist');
cy.get(SAVED_OBJECTS_ROW_TITLES).should(
'contain.text',
`Saved search for timeline - ${timelineName}`
);
});

it('should rename the saved search on timeline rename', () => {
const initialTimelineSuffix = Date.now();
const initialTimelineName = `Timeline-${initialTimelineSuffix}`;
addDiscoverEsqlQuery(esqlQuery);
addNameToTimelineAndSave(initialTimelineName);
cy.get(LOADING_INDICATOR).should('not.exist');
const timelineSuffix = Date.now();
const renamedTimelineName = `Rename timeline-${timelineSuffix}`;
addNameToTimelineAndSave(renamedTimelineName);
cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`);
openKibanaNavigation();
navigateFromKibanaCollapsibleTo(STACK_MANAGEMENT_PAGE);
cy.get(LOADING_INDICATOR).should('not.exist');
goToSavedObjectSettings();
cy.get(LOADING_INDICATOR).should('not.exist');
clickSavedObjectTagsFilter();
cy.get(GET_SAVED_OBJECTS_TAGS_OPTION('Security_Solution')).trigger('click');
cy.get(BASIC_TABLE_LOADING).should('not.exist');
cy.get(SAVED_OBJECTS_ROW_TITLES).should(
'contain.text',
`Saved search for timeline - ${renamedTimelineName}`
);
});
});
});

// Issue for enabling below tests: https://github.com/elastic/kibana/issues/165913
context.skip('Advanced Settings', () => {
it('rows per page in saved search should be according to the user selected number of pages', () => {});
it('rows per page in new search should be according to the value selected in advanced settings', () => {});
});
});
// Issue for enabling below tests: https://github.com/elastic/kibana/issues/165913
context.skip('Advanced Settings', () => {
it('rows per page in saved search should be according to the user selected number of pages', () => {});
it('rows per page in new search should be according to the value selected in advanced settings', () => {});
});
}
);