Skip to content
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] Adds cypress-pipe #91550

Merged
merged 5 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
"content-disposition": "0.5.3",
"core-js": "^3.6.5",
"custom-event-polyfill": "^0.3.0",
"cypress-promise": "^1.1.0",
"cytoscape": "^3.10.0",
"cytoscape-dagre": "^2.2.2",
"d3-array": "1.2.4",
Expand Down Expand Up @@ -613,6 +612,8 @@
"cypress": "^6.2.1",
"cypress-cucumber-preprocessor": "^2.5.2",
"cypress-multi-reporters": "^1.4.0",
"cypress-pipe": "^2.0.0",
"cypress-promise": "^1.1.0",
"d3": "3.5.17",
"d3-cloud": "1.2.5",
"d3-scale": "1.0.7",
Expand Down Expand Up @@ -833,8 +834,8 @@
"val-loader": "^1.1.1",
"vega": "^5.19.1",
"vega-lite": "^4.17.0",
"vega-spec-injector": "^0.0.2",
"vega-schema-url-parser": "^2.1.0",
"vega-spec-injector": "^0.0.2",
"vega-tooltip": "^0.25.0",
"venn.js": "0.2.20",
"vinyl-fs": "^3.0.3",
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

// Import commands.js using ES2015 syntax:
import './commands';
import 'cypress-pipe';

Cypress.Cookies.defaults({
preserve: 'sid',
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/security_solution/cypress/tasks/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ export const openTimelineInspectButton = () => {
};

export const openTimelineFromSettings = () => {
cy.get(TIMELINE_SETTINGS_ICON).filter(':visible').click({ force: true });
cy.get(OPEN_TIMELINE_ICON).click({ force: true });
const click = ($el: Cypress.ObjectLike) => cy.wrap($el).click();
cy.get(TIMELINE_SETTINGS_ICON).filter(':visible').pipe(click);
cy.get(OPEN_TIMELINE_ICON).pipe(click);
};

export const openTimelineTemplateFromSettings = (id: string) => {
Expand Down
6 changes: 2 additions & 4 deletions x-pack/plugins/security_solution/cypress/tasks/timelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export const exportTimeline = (timelineId: string) => {
};

export const openTimeline = (id: string) => {
// This temporary wait here is to reduce flakeyness until we integrate cypress-pipe. Then please let us use cypress pipe.
// Ref: https://www.cypress.io/blog/2019/01/22/when-can-the-test-click/
// Ref: https://github.com/NicholasBoll/cypress-pipe#readme
cy.get(TIMELINE(id)).should('be.visible').wait(1500).click();
const click = ($el: Cypress.ObjectLike) => cy.wrap($el).click();
cy.get(TIMELINE(id)).should('be.visible').pipe(click);
};

export const waitForTimelinesPanelToBeLoaded = () => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"tsBuildInfoFile": "../../../../build/tsbuildinfo/security_solution/cypress",
"types": [
"cypress",
"cypress-pipe",
"node"
],
"resolveJsonModule": true,
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11680,6 +11680,11 @@ cypress-multi-reporters@^1.4.0:
debug "^4.1.1"
lodash "^4.17.15"

cypress-pipe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/cypress-pipe/-/cypress-pipe-2.0.0.tgz#577df7a70a8603d89a96dfe4092a605962181af8"
integrity sha512-KW9s+bz4tFLucH3rBGfjW+Q12n7S4QpUSSyxiGrgPOfoHlbYWzAGB3H26MO0VTojqf9NVvfd5Kt0MH5XMgbfyg==

cypress-promise@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/cypress-promise/-/cypress-promise-1.1.0.tgz#f2d66965945fe198431aaf692d5157cea9d47b25"
Expand Down