From 79a73c0ab6103ac78e57296b92c6be87ba476688 Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Tue, 10 Jan 2023 17:14:57 +0530 Subject: [PATCH] Cypress windows tests fix (#296) (#305) * [FEATURE] Detector must have at least one alert set #288 Signed-off-by: Jovan Cvetkovic * [TASK] Investigate and fix cypress windows tests #295 Signed-off-by: Jovan Cvetkovic * [TASK] Investigate and fix cypress windows tests #295 Signed-off-by: Jovan Cvetkovic Signed-off-by: Jovan Cvetkovic Signed-off-by: Jovan Cvetkovic Co-authored-by: Jovan Cvetkovic --- cypress/support/commands.js | 2 +- cypress/support/index.js | 2 ++ package.json | 3 ++- tsconfig.json | 3 ++- yarn.lock | 5 +++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index cb5c8824d..7ab68f3da 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -95,7 +95,7 @@ Cypress.Commands.add('getTableFirstRow', (selector) => { }); Cypress.Commands.add('triggerSearchField', (placeholder, text) => { - cy.get(`[placeholder="${placeholder}"]`).type(`{selectall}${text}`).trigger('search'); + cy.get(`[placeholder="${placeholder}"]`).type(`{selectall}${text}`).realPress('Enter'); }); Cypress.Commands.add('waitForPageLoad', (url, { timeout = 10000, contains = null }) => { diff --git a/cypress/support/index.js b/cypress/support/index.js index cf15f85bb..42a9f28c8 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -13,6 +13,8 @@ // Import commands.js using ES2015 syntax: import './commands'; +import 'cypress-real-events'; + // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/package.json b/package.json index 585b85ce0..8f4acfd86 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "jest-cli": "^27.5.1", "jest-environment-jsdom": "^27.5.1", "lint-staged": "^9.2.0", - "ts-loader": "^6.2.1" + "ts-loader": "^6.2.1", + "cypress-real-events": "1.7.6" }, "engines": { "yarn": "^1.21.1" diff --git a/tsconfig.json b/tsconfig.json index 4f79bdc75..3115915e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "compilerOptions": { "skipLibCheck": true, "esModuleInterop": true, - "outDir": "./target" + "outDir": "./target", + "types": ["cypress", "node", "cypress-real-events"] } } diff --git a/yarn.lock b/yarn.lock index 29a171b75..a05088312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2041,6 +2041,11 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== +cypress-real-events@1.7.6: + version "1.7.6" + resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.6.tgz#6f17e0b2ceea1d6dc60f6737d8f84cc517bbbb4c" + integrity sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw== + cypress@^6.0.0: version "6.9.1" resolved "https://registry.yarnpkg.com/cypress/-/cypress-6.9.1.tgz#ce1106bfdc47f8d76381dba63f943447883f864c"