Skip to content

Commit

Permalink
[SecuritySolution] Enable chartEmbeddablesEnabled feature flag (elast…
Browse files Browse the repository at this point in the history
…ic#150531)

## Summary

**Original Issue**
elastic#136409

**Preview**
https://kibana-pr-150531.kb.us-west2.gcp.elastic-cloud.com:9243/

https://p.elstc.co/paste/G+PhWdS0#WEyGBtMD9I4r74WPNIQFvgELZPOp-SZCG3yja1LOuwQ

**Migrated charts**
elastic#149123

**Known issues of the Embeddables after enabling the feature flag:** 
elastic#136409 (Feature request on
Lens’ side & Bugs section)

**Charts not supported by Lens Embeddable:**
elastic#149592

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and bmorelli25 committed Mar 10, 2023
1 parent c89a7ae commit a53c6d2
Show file tree
Hide file tree
Showing 52 changed files with 572 additions and 242 deletions.
Expand Up @@ -20,8 +20,9 @@ export const allowedExperimentalValues = Object.freeze({
pendingActionResponsesWithAck: true,
policyListEnabled: true,
policyResponseInFleetEnabled: true,
chartEmbeddablesEnabled: false,

chartEmbeddablesEnabled: true,
donutChartEmbeddablesEnabled: false, // Depends on https://github.com/elastic/kibana/issues/136409 item 2 - 6
alertsPreviewChartEmbeddablesEnabled: false, // Depends on https://github.com/elastic/kibana/issues/136409 item 9
/**
* This is used for enabling the end-to-end tests for the security_solution telemetry.
* We disable the telemetry since we don't have specific roles or permissions around it and
Expand Down
Expand Up @@ -127,7 +127,7 @@ describe('Sourcerer', () => {
isSourcererSelection(`auditbeat-*`);
isNotSourcererSelection('*beat*');
addIndexToDefault('*beat*');
isHostsStatValue('1 ');
isHostsStatValue('1');
openSourcerer();
openAdvancedSettings();
isSourcererSelection(`auditbeat-*`);
Expand Down
Expand Up @@ -6,8 +6,14 @@
*/

import { getNewRule } from '../../objects/rule';
import { ALERTS_HISTOGRAM_LEGEND, ALERTS_COUNT } from '../../screens/alerts';
import { selectAlertsHistogram } from '../../tasks/alerts';
import { ALERTS_COUNT } from '../../screens/alerts';
import {
clickAlertsHistogramLegend,
clickAlertsHistogramLegendAddToTimeline,
clickAlertsHistogramLegendFilterFor,
clickAlertsHistogramLegendFilterOut,
selectAlertsHistogram,
} from '../../tasks/alerts';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { login, visit } from '../../tasks/login';
Expand All @@ -16,34 +22,34 @@ import {
GLOBAL_SEARCH_BAR_FILTER_ITEM,
GLOBAL_SEARCH_BAR_FILTER_ITEM_DELETE,
} from '../../screens/search_bar';
import { HOVER_ACTIONS, TIMELINE_DATA_PROVIDERS_CONTAINER } from '../../screens/timeline';
import { TIMELINE_DATA_PROVIDERS_CONTAINER } from '../../screens/timeline';
import { closeTimelineUsingCloseButton } from '../../tasks/security_main';
import { openActiveTimeline } from '../../tasks/timeline';

describe('Histogram legend hover actions', { testIsolation: false }, () => {
const ruleConfigs = getNewRule();
before(() => {
cleanKibana();
login();
createCustomRuleEnabled(getNewRule(), 'new custom rule');
createCustomRuleEnabled(ruleConfigs, 'new custom rule');
visit(ALERTS_URL);
selectAlertsHistogram();
});

it('Filter in/out should add a filter to KQL bar', function () {
const expectedNumberOfAlerts = 2;
cy.get(ALERTS_HISTOGRAM_LEGEND).trigger('mouseover');
cy.get(HOVER_ACTIONS.FILTER_FOR).click();
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterFor(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`kibana.alert.rule.name: ${getNewRule().name}`
`kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('have.text', `${expectedNumberOfAlerts} alerts`);

cy.get(ALERTS_HISTOGRAM_LEGEND).trigger('mouseover');
cy.get(HOVER_ACTIONS.FILTER_OUT).click();
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterOut(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`NOT kibana.alert.rule.name: ${getNewRule().name}`
`NOT kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('not.exist');

Expand All @@ -52,9 +58,8 @@ describe('Histogram legend hover actions', { testIsolation: false }, () => {
});

it('Add To Timeline', function () {
cy.get(ALERTS_HISTOGRAM_LEGEND).trigger('mouseover');
cy.get(HOVER_ACTIONS.ADD_TO_TIMELINE).click();
openActiveTimeline();
clickAlertsHistogramLegend();
clickAlertsHistogramLegendAddToTimeline(ruleConfigs.name);
cy.get(TIMELINE_DATA_PROVIDERS_CONTAINER).should('be.visible');
cy.get(TIMELINE_DATA_PROVIDERS_CONTAINER).should('contain.text', getNewRule().name);
closeTimelineUsingCloseButton();
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/

import { getBuildingBlockRule } from '../../objects/rule';
import { OVERVIEW_ALERTS_HISTOGRAM } from '../../screens/overview';
import { OVERVIEW_ALERTS_HISTOGRAM_EMPTY } from '../../screens/overview';
import { OVERVIEW } from '../../screens/security_header';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
Expand Down Expand Up @@ -43,6 +43,6 @@ describe('Alerts generated by building block rules', () => {
navigateFromHeaderTo(OVERVIEW);

// Check that generated events are hidden on the Overview page
cy.get(OVERVIEW_ALERTS_HISTOGRAM).should('contain.text', 'No data to display');
cy.get(OVERVIEW_ALERTS_HISTOGRAM_EMPTY).should('contain.text', 'No results found');
});
});

0 comments on commit a53c6d2

Please sign in to comment.