-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* adds 'pin event' cypress test * refactors code Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
a611abf
commit f28d967
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
x-pack/plugins/security_solution/cypress/integration/timeline_events.spec.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,39 @@ | ||
/* | ||
* 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 { PIN_EVENT } from '../screens/timeline'; | ||
|
||
import { loginAndWaitForPage } from '../tasks/login'; | ||
import { openTimeline } from '../tasks/security_main'; | ||
import { pinFirstEvent, populateTimeline, unpinFirstEvent } from '../tasks/timeline'; | ||
|
||
import { HOSTS_URL } from '../urls/navigation'; | ||
|
||
describe('timeline events', () => { | ||
before(() => { | ||
loginAndWaitForPage(HOSTS_URL); | ||
openTimeline(); | ||
populateTimeline(); | ||
}); | ||
|
||
after(() => { | ||
unpinFirstEvent(); | ||
}); | ||
|
||
it('pins the first event to the timeline', () => { | ||
cy.server(); | ||
cy.route('POST', '**/api/solutions/security/graphql').as('persistTimeline'); | ||
|
||
pinFirstEvent(); | ||
|
||
cy.wait('@persistTimeline', { timeout: 10000 }).then((response) => { | ||
cy.wrap(response.status).should('eql', 200); | ||
cy.wrap(response.xhr.responseText).should('include', 'persistPinnedEventOnTimeline'); | ||
}); | ||
|
||
cy.get(PIN_EVENT).should('have.attr', 'aria-label', 'Pinned event'); | ||
}); | ||
}); |
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