[SIEM] Improves data providers Cypress tests execution (#54462)

* refactor

* replaces 'clearTimeline' for 'createNewTimeline'

* removes unused data-test-subj

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
MadameSheema 2020-01-16 11:10:49 +01:00 committed by GitHub
parent 8458e47614
commit ea9351aaaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,11 @@ import {
TIMELINE_DROPPED_DATA_PROVIDERS,
TIMELINE_DATA_PROVIDERS_EMPTY,
} from '../../lib/timeline/selectors';
import { dragFromAllHostsToTimeline, toggleTimelineVisibility } from '../../lib/timeline/helpers';
import {
createNewTimeline,
dragFromAllHostsToTimeline,
toggleTimelineVisibility,
} from '../../lib/timeline/helpers';
import { ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS } from '../../lib/hosts/selectors';
import { HOSTS_PAGE } from '../../lib/urls';
import { waitForAllHostsWidget } from '../../lib/hosts/helpers';
@ -17,15 +21,20 @@ import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../lib/util/helpers';
import { drag, dragWithoutDrop } from '../../lib/drag_n_drop/helpers';
describe('timeline data providers', () => {
beforeEach(() => {
before(() => {
loginAndWaitForPage(HOSTS_PAGE);
waitForAllHostsWidget();
});
beforeEach(() => {
toggleTimelineVisibility();
});
afterEach(() => {
createNewTimeline();
});
it('renders the data provider of a host dragged from the All Hosts widget on the hosts page', () => {
waitForAllHostsWidget();
toggleTimelineVisibility();
dragFromAllHostsToTimeline();
cy.get(TIMELINE_DROPPED_DATA_PROVIDERS, {
@ -45,10 +54,6 @@ describe('timeline data providers', () => {
});
it('sets the background to euiColorSuccess with a 10% alpha channel when the user starts dragging a host, but is not hovering over the data providers', () => {
waitForAllHostsWidget();
toggleTimelineVisibility();
cy.get(ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS)
.first()
.then(host => drag(host));
@ -61,10 +66,6 @@ describe('timeline data providers', () => {
});
it('sets the background to euiColorSuccess with a 20% alpha channel when the user starts dragging a host AND is hovering over the data providers', () => {
waitForAllHostsWidget();
toggleTimelineVisibility();
cy.get(ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS)
.first()
.then(host => drag(host));
@ -81,10 +82,6 @@ describe('timeline data providers', () => {
});
it('renders the dashed border color as euiColorSuccess when hovering over the data providers', () => {
waitForAllHostsWidget();
toggleTimelineVisibility();
cy.get(ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS)
.first()
.then(host => drag(host));