-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] Unskip timeline creation Cypress test #85871
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,13 @@ import { timeline } from '../objects/timeline'; | |
import { | ||
FAVORITE_TIMELINE, | ||
LOCKED_ICON, | ||
NOTES, | ||
NOTES_TAB_BUTTON, | ||
// NOTES_COUNT, | ||
NOTES_TEXT_AREA, | ||
NOTE_BY_NOTE_ID, | ||
PIN_EVENT, | ||
TIMELINE_DESCRIPTION, | ||
TIMELINE_FILTER, | ||
// TIMELINE_FILTER, | ||
TIMELINE_QUERY, | ||
TIMELINE_TITLE, | ||
|
@@ -24,7 +25,7 @@ import { | |
TIMELINES_NOTES_COUNT, | ||
TIMELINES_FAVORITE, | ||
} from '../screens/timelines'; | ||
import { deleteTimeline } from '../tasks/api_calls/timelines'; | ||
import { deleteTimeline, getTimelineById } from '../tasks/api_calls/timelines'; | ||
|
||
import { loginAndWaitForPage } from '../tasks/login'; | ||
import { openTimelineUsingToggle } from '../tasks/security_main'; | ||
|
@@ -46,11 +47,11 @@ import { openTimeline } from '../tasks/timelines'; | |
import { OVERVIEW_URL } from '../urls/navigation'; | ||
|
||
// FLAKY: https://github.com/elastic/kibana/issues/79389 | ||
describe.skip('Timelines', () => { | ||
describe('Timelines', () => { | ||
let timelineId: string; | ||
|
||
after(() => { | ||
deleteTimeline(timelineId); | ||
if (timelineId) deleteTimeline(timelineId); | ||
}); | ||
|
||
it('Creates a timeline', () => { | ||
|
@@ -90,13 +91,16 @@ describe.skip('Timelines', () => { | |
cy.get(TIMELINE_TITLE).should('have.text', timeline.title); | ||
cy.get(TIMELINE_DESCRIPTION).should('have.text', timeline.description); | ||
cy.get(TIMELINE_QUERY).should('have.text', `${timeline.query} `); | ||
// Comments this assertion until we agreed what to do with the filters. | ||
// cy.get(TIMELINE_FILTER(timeline.filter)).should('exist'); | ||
// cy.get(NOTES_COUNT).should('have.text', '1'); | ||
cy.get(TIMELINE_FILTER(timeline.filter)).should('exist'); | ||
cy.get(PIN_EVENT).should('have.attr', 'aria-label', 'Pinned event'); | ||
cy.get(NOTES_TAB_BUTTON).click(); | ||
cy.get(NOTES_TEXT_AREA).should('exist'); | ||
cy.get(NOTES).should('have.text', timeline.notes); | ||
|
||
getTimelineById(timelineId).then((singleTimeline) => { | ||
const noteId = singleTimeline!.body.data.getOneTimeline.notes[0].noteId; | ||
|
||
cy.get(`${NOTE_BY_NOTE_ID(noteId)} p`).should('have.text', timeline.notes); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please extract this to our screens folder? |
||
}); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,8 @@ export const LOCKED_ICON = '[data-test-subj="timeline-date-picker-lock-button"]' | |
|
||
export const NOTES = '[data-test-subj="note-card-body"]'; | ||
|
||
export const NOTE_BY_NOTE_ID = (noteId: string) => `[data-test-subj="note-preview-${noteId}"]`; | ||
|
||
export const NOTES_TEXT_AREA = '[data-test-subj="add-a-note"] textarea'; | ||
|
||
export const NOTES_TAB_BUTTON = '[data-test-subj="timelineTabs-notes"]'; | ||
|
@@ -103,7 +105,8 @@ export const TIMELINE_FIELDS_BUTTON = | |
'[data-test-subj="timeline"] [data-test-subj="show-field-browser"]'; | ||
|
||
export const TIMELINE_FILTER = (filter: TimelineFilter) => { | ||
return `[data-test-subj="filter filter-enabled filter-key-${filter.field} filter-value-${filter.value} filter-unpinned"]`; | ||
// The space at the end of the line is required. We want to keep it until it is updated. | ||
return `[data-test-subj="filter filter-enabled filter-key-${filter.field} filter-value-${filter.value} filter-unpinned "]`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this extra space on the end here meaningful in some way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it is how it looks atm, and the component is not made by us. Update it here to fit current case and get the right element. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. Could you add a comment to that effect? Someone's editor may accidentally fix that on save or something and recreate the error. Might be worth contacting the code owners of the component too, to just remove the space in their code as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @michaelolo24, we should fix the code and see if break anything else |
||
}; | ||
|
||
export const TIMELINE_FILTER_FIELD = '[data-test-subj="filterFieldSuggestionList"]'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove this line and close the related ticket if is still opened?