forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SIEM] Toggle Column / Code Coverage and Cypress (elastic#42766)
## Features - A `Toggle column` checkbox for adding / removing fields in the timeline offers an alternative to drag and drop in an expanded event: ![toggle-field](https://user-images.githubusercontent.com/4459398/62572146-4d94c280-b850-11e9-8ff9-5feaca3f305d.gif) The behavior of the `Toggle field` checkbox in the expanded event is the same as the checkboxes that appear in the timeline _Fields Browser_. ## Fixes - Pinned timeline events now use a "filled" styling when pinned instead of rotation, and unpinned events have a higher contrast in dark mode: Before: ![unpinned-before](https://user-images.githubusercontent.com/4459398/62572175-5b4a4800-b850-11e9-9d4f-317d5abad002.png) After (unpinned): ![after-unpinned](https://user-images.githubusercontent.com/4459398/62908225-28aebc80-bd34-11e9-9237-8a98c88a6da1.png) After (pinned): ![after-pinned](https://user-images.githubusercontent.com/4459398/62908230-306e6100-bd34-11e9-9830-45d725bac5b1.png) - Fixed an issue where the `Copy to Clipboard` icon rendered incorrectly (too small, and not the right color): Before: ![copy-to-clipboard-before](https://user-images.githubusercontent.com/4459398/62572224-7452f900-b850-11e9-962c-eef0b96202ff.png) After: ![copy-to-clipboard-after](https://user-images.githubusercontent.com/4459398/62572240-7f0d8e00-b850-11e9-8b89-7c14bf92e705.png) - Fixed an issue where a previously invisible control became visible and occupied additonal row space in the timeline: Before: ![row-height-before](https://user-images.githubusercontent.com/4459398/62572265-8e8cd700-b850-11e9-9c36-1d74ba0ba6f5.png) After: ![row-height-after](https://user-images.githubusercontent.com/4459398/62572285-977da880-b850-11e9-8448-7085bbac8da4.png) - Fixed an issue where the timeline Fields Browser Overlaps Column Headers Before: ![field-browser-position-before](https://user-images.githubusercontent.com/4459398/62572309-a5332e00-b850-11e9-9b6f-38700d2f48a0.png) After: ![field-browser-position-after](https://user-images.githubusercontent.com/4459398/62572335-b845fe00-b850-11e9-84f8-4b273f7ef163.png) ## Code Coverage and Cypress Tests - This PR increases the `jest` unit test coverage for the _Fields Browser_, and introduces `Cypress` tests for it - Added new `Cypress` test helpers, configuration, and test refactorings to support running smoke tests against remote Kibana instances, including [Elastic Cloud](https://www.elastic.co/cloud) - Refactored some `Cypress` tests to speed them up and reduce flakyness elastic/siem-team#380 elastic/siem-team#431 elastic/siem-team#432 elastic/siem-team#433 elastic/siem-team#434 elastic/siem-team#435
- Loading branch information
1 parent
8a24422
commit 3c6fbf1
Showing
77 changed files
with
3,939 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{} | ||
{ | ||
"baseUrl": "http://localhost:5601" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_FILTER_INPUT, FIELDS_BUTTON } from './selectors'; | ||
import { | ||
assertAtLeastOneEventMatchesSearch, | ||
executeKQL, | ||
hostExistsQuery, | ||
toggleTimelineVisibility, | ||
} from '../timeline/helpers'; | ||
import { TIMELINE_DATA_PROVIDERS } from '../timeline/selectors'; | ||
|
||
/** Opens the timeline's Field Browser */ | ||
export const openFieldsBrowser = () => { | ||
cy.get(FIELDS_BUTTON).click(); | ||
|
||
cy.get(FIELDS_BROWSER_CONTAINER).should('exist'); | ||
}; | ||
|
||
/** Populates the timeline with a host from the hosts page */ | ||
export const populateTimeline = () => { | ||
toggleTimelineVisibility(); | ||
|
||
executeKQL(hostExistsQuery); | ||
|
||
assertAtLeastOneEventMatchesSearch(); | ||
}; | ||
|
||
/** Clicks an arbitrary UI element that's not part of the fields browser (to dismiss it) */ | ||
export const clickOutsideFieldsBrowser = () => { | ||
cy.get(TIMELINE_DATA_PROVIDERS).click(); | ||
}; | ||
|
||
/** Filters the Field Browser by typing `fieldName` in the input */ | ||
export const filterFieldsBrowser = (fieldName: string) => { | ||
cy.get(FIELDS_BROWSER_FILTER_INPUT).type(fieldName); | ||
}; |
35 changes: 35 additions & 0 deletions
35
x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/selectors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
/** Clicking this button in the timeline opens the Fields browser */ | ||
export const FIELDS_BUTTON = '[data-test-subj="show-field-browser"]'; | ||
|
||
/** The title displayed in the fields browser (i.e. Customize Columns) */ | ||
export const FIELDS_BROWSER_TITLE = '[data-test-subj="field-browser-title"]'; | ||
|
||
/** Contains the body of the fields browser */ | ||
export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; | ||
|
||
/** The title of the selected category in the right-hand side of the fields browser */ | ||
export const FIELDS_BROWSER_SELECTED_CATEGORY_TITLE = '[data-test-subj="selected-category-title"]'; | ||
|
||
/** A count of the fields in the selected category in the right-hand side of the fields browser */ | ||
export const FIELDS_BROWSER_SELECTED_CATEGORY_COUNT = | ||
'[data-test-subj="selected-category-count-badge"]'; | ||
|
||
/** Typing in this input filters the Field Browser */ | ||
export const FIELDS_BROWSER_FILTER_INPUT = '[data-test-subj="field-search"]'; | ||
|
||
/** | ||
* This label displays a count of the categories containing (one or more) | ||
* fields that match the filter criteria | ||
*/ | ||
export const FIELDS_BROWSER_CATEGORIES_COUNT = '[data-test-subj="categories-count"]'; | ||
|
||
/** | ||
* This label displays a count of the fields that match the filter criteria | ||
*/ | ||
export const FIELDS_BROWSER_FIELDS_COUNT = '[data-test-subj="fields-count"]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.