Skip to content

Commit 89bf20e

Browse files
[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>
1 parent 74499c4 commit 89bf20e

File tree

4 files changed

+197
-146
lines changed

4 files changed

+197
-146
lines changed

x-pack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"copy-to-clipboard": "^3.0.8",
160160
"copy-webpack-plugin": "^6.0.2",
161161
"cronstrue": "^1.51.0",
162-
"cypress": "4.11.0",
162+
"cypress": "5.0.0",
163163
"cypress-multi-reporters": "^1.2.3",
164164
"d3": "3.5.17",
165165
"d3-scale": "1.0.7",

x-pack/plugins/security_solution/cypress/support/commands.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ Cypress.Commands.add(
4545
prevSubject: 'element',
4646
},
4747
(input, fileName, fileType = 'text/plain') => {
48-
cy.fixture(fileName)
49-
.then((content) => Cypress.Blob.base64StringToBlob(content, fileType))
50-
.then((blob) => {
51-
const testFile = new File([blob], fileName, { type: fileType });
52-
const dataTransfer = new DataTransfer();
48+
cy.fixture(fileName).then((content) => {
49+
const blob = Cypress.Blob.base64StringToBlob(content, fileType);
50+
const testFile = new File([blob], fileName, { type: fileType });
51+
const dataTransfer = new DataTransfer();
5352

54-
dataTransfer.items.add(testFile);
55-
input[0].files = dataTransfer.files;
56-
return input;
57-
});
53+
dataTransfer.items.add(testFile);
54+
input[0].files = dataTransfer.files;
55+
return input;
56+
});
5857
}
5958
);

x-pack/plugins/security_solution/cypress/support/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import './commands';
2424

2525
Cypress.Cookies.defaults({
26-
whitelist: 'sid',
26+
preserve: 'sid',
2727
});
2828

2929
Cypress.on('uncaught:exception', (err) => {

0 commit comments

Comments
 (0)