fixes toggle columns cypress tests (#51279) (#51428)

This commit is contained in:
MadameSheema 2019-11-25 11:30:50 +01:00 committed by GitHub
parent 1160904256
commit b904c4e8a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View file

@ -47,5 +47,5 @@ export const assertAtLeastOneEventMatchesSearch = () =>
export const toggleFirstTimelineEventDetails = () => {
cy.get(TOGGLE_TIMELINE_EXPAND_EVENT, { timeout: DEFAULT_TIMEOUT })
.first()
.click();
.click({ force: true });
};

View file

@ -32,8 +32,7 @@ export const SEARCH_OR_FILTER_CONTAINER =
export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]';
/** Expands or collapses an event in the timeline */
export const TOGGLE_TIMELINE_EXPAND_EVENT =
'[data-test-subj="timeline"] [data-test-subj="expand-event"]';
export const TOGGLE_TIMELINE_EXPAND_EVENT = '[data-test-subj="expand-event"]';
/** The body of the timeline flyout */
export const TIMELINE_FLYOUT_BODY = '[data-test-subj="eui-flyout-body"]';

View file

@ -23,7 +23,7 @@ describe('toggle column in timeline', () => {
const timestampField = '@timestamp';
const idField = '_id';
it.skip('displays a checked Toggle field checkbox for `@timestamp`, a default timeline column', () => {
it('displays a checked Toggle field checkbox for `@timestamp`, a default timeline column', () => {
populateTimeline();
toggleFirstTimelineEventDetails();
@ -39,7 +39,7 @@ describe('toggle column in timeline', () => {
);
});
it.skip('removes the @timestamp field from the timeline when the user un-checks the toggle', () => {
it('removes the @timestamp field from the timeline when the user un-checks the toggle', () => {
populateTimeline();
toggleFirstTimelineEventDetails();
@ -50,14 +50,14 @@ describe('toggle column in timeline', () => {
cy.get(
`[data-test-subj="timeline"] [data-test-subj="toggle-field-${timestampField}"]`
).uncheck();
).uncheck({ force: true });
cy.get(`[data-test-subj="timeline"] [data-test-subj="header-text-${timestampField}"]`).should(
'not.exist'
);
});
it.skip('adds the _id field to the timeline when the user checks the field', () => {
it('adds the _id field to the timeline when the user checks the field', () => {
populateTimeline();
toggleFirstTimelineEventDetails();
@ -66,7 +66,9 @@ describe('toggle column in timeline', () => {
'not.exist'
);
cy.get(`[data-test-subj="timeline"] [data-test-subj="toggle-field-${idField}"]`).check();
cy.get(`[data-test-subj="timeline"] [data-test-subj="toggle-field-${idField}"]`).check({
force: true,
});
cy.get(`[data-test-subj="timeline"] [data-test-subj="header-text-${idField}"]`).should('exist');
});