Skip to content

Commit

Permalink
[7.x] [SECURITY SOLUTION] Upgrades cypress to v5 (#76002) (#76748)
Browse files Browse the repository at this point in the history
* [SECURITY SOLUTION] Upgrades cypress to v5 (#76002)

* upgrades cypress to v5

* fix failing test

* removes unnecessary line

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	yarn.lock

* fixes failure
  • Loading branch information
MadameSheema authored Sep 5, 2020
1 parent 9593902 commit 306fd13
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 146 deletions.
2 changes: 1 addition & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"copy-to-clipboard": "^3.0.8",
"copy-webpack-plugin": "^6.0.2",
"cronstrue": "^1.51.0",
"cypress": "4.11.0",
"cypress": "5.0.0",
"cypress-multi-reporters": "^1.2.3",
"d3": "3.5.17",
"d3-scale": "1.0.7",
Expand Down
17 changes: 8 additions & 9 deletions x-pack/plugins/security_solution/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ Cypress.Commands.add(
prevSubject: 'element',
},
(input, fileName, fileType = 'text/plain') => {
cy.fixture(fileName)
.then((content) => Cypress.Blob.base64StringToBlob(content, fileType))
.then((blob) => {
const testFile = new File([blob], fileName, { type: fileType });
const dataTransfer = new DataTransfer();
cy.fixture(fileName).then((content) => {
const blob = Cypress.Blob.base64StringToBlob(content, fileType);
const testFile = new File([blob], fileName, { type: fileType });
const dataTransfer = new DataTransfer();

dataTransfer.items.add(testFile);
input[0].files = dataTransfer.files;
return input;
});
dataTransfer.items.add(testFile);
input[0].files = dataTransfer.files;
return input;
});
}
);
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import './commands';

Cypress.Cookies.defaults({
whitelist: 'sid',
preserve: 'sid',
});

Cypress.on('uncaught:exception', (err) => {
Expand Down
Loading

0 comments on commit 306fd13

Please sign in to comment.