mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* fix data providers cypress tests * add scrollToBottom to common tasks file Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/security_solution/cypress/integration/timelines/data_providers.spec.ts # x-pack/plugins/security_solution/cypress/integration/timelines/flyout_button.spec.ts
This commit is contained in:
parent
ed29587f5a
commit
31f71b0887
5 changed files with 41 additions and 26 deletions
|
@ -10,6 +10,7 @@ import {
|
|||
TIMELINE_DATA_PROVIDERS_EMPTY,
|
||||
TIMELINE_DROPPED_DATA_PROVIDERS,
|
||||
TIMELINE_DATA_PROVIDERS_ACTION_MENU,
|
||||
IS_DRAGGING_DATA_PROVIDERS,
|
||||
TIMELINE_FLYOUT_HEADER,
|
||||
} from '../../screens/timeline';
|
||||
import { HOSTS_NAMES_DRAGGABLE } from '../../screens/hosts/all_hosts';
|
||||
|
@ -17,6 +18,7 @@ import { HOSTS_NAMES_DRAGGABLE } from '../../screens/hosts/all_hosts';
|
|||
import {
|
||||
dragAndDropFirstHostToTimeline,
|
||||
dragFirstHostToEmptyTimelineDataProviders,
|
||||
unDragFirstHostToEmptyTimelineDataProviders,
|
||||
dragFirstHostToTimeline,
|
||||
waitForAllHostsToBeLoaded,
|
||||
} from '../../tasks/hosts/all_hosts';
|
||||
|
@ -26,13 +28,14 @@ import { openTimelineUsingToggle } from '../../tasks/security_main';
|
|||
import { addDataProvider, closeTimeline, createNewTimeline } from '../../tasks/timeline';
|
||||
|
||||
import { HOSTS_URL } from '../../urls/navigation';
|
||||
import { cleanKibana } from '../../tasks/common';
|
||||
import { cleanKibana, scrollToBottom } from '../../tasks/common';
|
||||
|
||||
describe('timeline data providers', () => {
|
||||
before(() => {
|
||||
cleanKibana();
|
||||
loginAndWaitForPage(HOSTS_URL);
|
||||
waitForAllHostsToBeLoaded();
|
||||
scrollToBottom();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -74,31 +77,24 @@ 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', () => {
|
||||
it('sets correct classes when the user starts dragging a host, but is not hovering over the data providers', () => {
|
||||
dragFirstHostToTimeline();
|
||||
|
||||
cy.get(TIMELINE_DATA_PROVIDERS)
|
||||
cy.get(IS_DRAGGING_DATA_PROVIDERS)
|
||||
.find(TIMELINE_DATA_PROVIDERS)
|
||||
.filter(':visible')
|
||||
.should(
|
||||
'have.css',
|
||||
'background',
|
||||
'rgba(1, 125, 115, 0.1) none repeat scroll 0% 0% / auto padding-box border-box'
|
||||
);
|
||||
.should('have.class', 'drop-target-data-providers');
|
||||
});
|
||||
|
||||
it.skip('sets the background to euiColorSuccess with a 20% alpha channel and renders the dashed border color as euiColorSuccess when the user starts dragging a host AND is hovering over the data providers', () => {
|
||||
it('render an extra highlighted area in dataProvider when the user starts dragging a host AND is hovering over the data providers', () => {
|
||||
dragFirstHostToEmptyTimelineDataProviders();
|
||||
|
||||
cy.get(TIMELINE_DATA_PROVIDERS_EMPTY)
|
||||
.filter(':visible')
|
||||
.should(
|
||||
'have.css',
|
||||
'background',
|
||||
'rgba(1, 125, 115, 0.2) none repeat scroll 0% 0% / auto padding-box border-box'
|
||||
);
|
||||
cy.get(IS_DRAGGING_DATA_PROVIDERS)
|
||||
.find(TIMELINE_DATA_PROVIDERS_EMPTY)
|
||||
.children()
|
||||
.should('exist');
|
||||
|
||||
cy.get(TIMELINE_DATA_PROVIDERS)
|
||||
.filter(':visible')
|
||||
.should('have.css', 'border', '3.1875px dashed rgb(1, 125, 115)');
|
||||
// Release the dragging item so the cursor can peform other action
|
||||
unDragFirstHostToEmptyTimelineDataProviders();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import { TIMELINE_BOTTOM_BAR_TOGGLE_BUTTON } from '../../screens/security_main';
|
||||
import {
|
||||
CREATE_NEW_TIMELINE,
|
||||
IS_DRAGGING_DATA_PROVIDERS,
|
||||
TIMELINE_DATA_PROVIDERS,
|
||||
TIMELINE_FLYOUT_HEADER,
|
||||
TIMELINE_SETTINGS_ICON,
|
||||
|
@ -76,15 +77,12 @@ describe('timeline flyout button', () => {
|
|||
closeTimelineUsingCloseButton();
|
||||
});
|
||||
|
||||
it('sets the data providers background to euiColorSuccess with a 10% alpha channel when the user starts dragging a host, but is not hovering over the data providers area', () => {
|
||||
it('sets correct classes when the user starts dragging a host, but is not hovering over the data providers', () => {
|
||||
dragFirstHostToTimeline();
|
||||
|
||||
cy.get(TIMELINE_DATA_PROVIDERS)
|
||||
cy.get(IS_DRAGGING_DATA_PROVIDERS)
|
||||
.find(TIMELINE_DATA_PROVIDERS)
|
||||
.filter(':visible')
|
||||
.should(
|
||||
'have.css',
|
||||
'background',
|
||||
'rgba(1, 125, 115, 0.1) none repeat scroll 0% 0% / auto padding-box border-box'
|
||||
);
|
||||
.should('have.class', 'drop-target-data-providers');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -114,6 +114,8 @@ export const TIMELINE_CHANGES_IN_PROGRESS = '[data-test-subj="timeline"] .euiPro
|
|||
|
||||
export const TIMELINE_COLUMN_SPINNER = '[data-test-subj="timeline-loading-spinner"]';
|
||||
|
||||
export const IS_DRAGGING_DATA_PROVIDERS = '.is-dragging';
|
||||
|
||||
export const TIMELINE_DATA_PROVIDERS = '[data-test-subj="dataProviders"]';
|
||||
|
||||
export const TIMELINE_DATA_PROVIDERS_ACTION_MENU = '[data-test-subj="providerActions"]';
|
||||
|
|
|
@ -148,3 +148,5 @@ export const cleanKibana = () => {
|
|||
|
||||
esArchiverResetKibana();
|
||||
};
|
||||
|
||||
export const scrollToBottom = () => cy.scrollTo('bottom');
|
||||
|
|
|
@ -29,6 +29,23 @@ export const dragFirstHostToEmptyTimelineDataProviders = () => {
|
|||
.then((dataProvidersDropArea) => dragWithoutDrop(dataProvidersDropArea));
|
||||
};
|
||||
|
||||
export const unDragFirstHostToEmptyTimelineDataProviders = () => {
|
||||
cy.get(HOSTS_NAMES_DRAGGABLE)
|
||||
.first()
|
||||
.then((host) => {
|
||||
cy.wrap(host)
|
||||
.trigger('mousemove', {
|
||||
button: 0,
|
||||
clientX: host[0].getBoundingClientRect().left,
|
||||
clientY: host[0].getBoundingClientRect().top,
|
||||
force: true,
|
||||
})
|
||||
.wait(300)
|
||||
.trigger('mouseup', { force: true })
|
||||
.wait(300);
|
||||
});
|
||||
};
|
||||
|
||||
export const dragFirstHostToTimeline = () => {
|
||||
cy.get(HOSTS_NAMES_DRAGGABLE)
|
||||
.first()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue