From b174bf0d14ffdec8602e23af560b99d1fc2288c2 Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Thu, 31 Oct 2024 13:05:05 +0100 Subject: [PATCH 1/4] test alerts --- x-pack/plugins/osquery/cypress/e2e/roles/alert_test.cy.ts | 6 +++--- x-pack/plugins/osquery/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/osquery/cypress/e2e/roles/alert_test.cy.ts b/x-pack/plugins/osquery/cypress/e2e/roles/alert_test.cy.ts index b332951b1a444..2eaf015f23220 100644 --- a/x-pack/plugins/osquery/cypress/e2e/roles/alert_test.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/roles/alert_test.cy.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { waitForAlertsToPopulate } from '@kbn/test-suites-xpack/security_solution_cypress/cypress/tasks/create_new_rule'; import { disableNewFeaturesTours } from '../../tasks/navigation'; import { initializeDataViews } from '../../tasks/login'; import { checkResults, clickRuleName, submitQuery } from '../../tasks/live_query'; @@ -31,9 +32,8 @@ describe('Alert Test', { tags: ['@ess'] }, () => { onBeforeLoad: (win) => disableNewFeaturesTours(win), }); clickRuleName(ruleName); - cy.getBySel('expand-event').first().click({ force: true }); - - cy.wait(500); + waitForAlertsToPopulate(); + cy.getBySel('expand-event').first().click(); cy.getBySel('securitySolutionFlyoutInvestigationGuideButton').click(); cy.contains('Get processes').click(); }); diff --git a/x-pack/plugins/osquery/package.json b/x-pack/plugins/osquery/package.json index f6dac0fd15c02..991f8a87a30eb 100644 --- a/x-pack/plugins/osquery/package.json +++ b/x-pack/plugins/osquery/package.json @@ -12,7 +12,7 @@ "cypress:run": "yarn cypress run", "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", - "cypress:serverless:run": "yarn cypress:serverless run", + "cypress:serverless:run": "yarn cypress:serverless run --spec ./cypress/e2e/roles/alert_test.cy.ts", "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel_serverless --config-file ../osquery/cypress/serverless_cypress_qa.config.ts --onBeforeHook ../../test/osquery_cypress/runner_qa.ts", "cypress:qa:serverless:run": "yarn cypress:qa:serverless run", "nyc": "../../../node_modules/.bin/nyc report --reporter=text-summary", From 1250b52c105a1fb1372ec655c4c6f41e82fe1587 Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Thu, 31 Oct 2024 13:05:56 +0100 Subject: [PATCH 2/4] fix spec --- x-pack/plugins/osquery/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/osquery/package.json b/x-pack/plugins/osquery/package.json index 991f8a87a30eb..0ebf79d1a89bb 100644 --- a/x-pack/plugins/osquery/package.json +++ b/x-pack/plugins/osquery/package.json @@ -9,10 +9,10 @@ "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", - "cypress:run": "yarn cypress run", + "cypress:run": "yarn cypress run --spec ./cypress/e2e/roles/alert_test.cy.ts", "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", - "cypress:serverless:run": "yarn cypress:serverless run --spec ./cypress/e2e/roles/alert_test.cy.ts", + "cypress:serverless:run": "yarn cypress:serverless run", "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel_serverless --config-file ../osquery/cypress/serverless_cypress_qa.config.ts --onBeforeHook ../../test/osquery_cypress/runner_qa.ts", "cypress:qa:serverless:run": "yarn cypress:qa:serverless run", "nyc": "../../../node_modules/.bin/nyc report --reporter=text-summary", From 6f726241cc02b1c58d0fde42f5a2674635bcb8bf Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Thu, 31 Oct 2024 14:02:07 +0100 Subject: [PATCH 3/4] remove spec --- x-pack/plugins/osquery/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/osquery/package.json b/x-pack/plugins/osquery/package.json index 0ebf79d1a89bb..da2ed27a1e043 100644 --- a/x-pack/plugins/osquery/package.json +++ b/x-pack/plugins/osquery/package.json @@ -9,7 +9,7 @@ "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", - "cypress:run": "yarn cypress run --spec ./cypress/e2e/roles/alert_test.cy.ts", + "cypress:run": "yarn cypress run --spec", "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", "cypress:serverless:run": "yarn cypress:serverless run", From d318c2b9fc6f0dbcf11a2059f2b877f44406f6a0 Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Thu, 31 Oct 2024 14:42:38 +0100 Subject: [PATCH 4/4] remove spec --- x-pack/plugins/osquery/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/osquery/package.json b/x-pack/plugins/osquery/package.json index da2ed27a1e043..f6dac0fd15c02 100644 --- a/x-pack/plugins/osquery/package.json +++ b/x-pack/plugins/osquery/package.json @@ -9,7 +9,7 @@ "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", - "cypress:run": "yarn cypress run --spec", + "cypress:run": "yarn cypress run", "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", "cypress:serverless:run": "yarn cypress:serverless run",