[8.x] [Upgrade] Fix security solution tests (#136431) (#136753)

* Fix case test

* Revert "Fix case test"

This reverts commit c2d5e600e5.

* Fix cases test

* Fix for custom query test

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 2678740da3)

Co-authored-by: liza-mae <liza-mae@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-07-20 14:11:17 -04:00 committed by GitHub
parent d9c3e820f5
commit c9d73280e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -82,6 +82,20 @@ describe('After an upgrade, the custom query rule', () => {
waitForRulesTableToBeLoaded();
goToTheRuleDetailsOf(rule.name);
waitForPageToBeLoaded();
// Possible bug on first attempt sometimes redirects page back to alerts
// Going to retry the block once
cy.url().then((url) => {
const currentUrl = url;
cy.log(`Current URL is : ${currentUrl}`);
if (!currentUrl.includes(DETECTIONS_RULE_MANAGEMENT_URL)) {
cy.log('Retrying not on correct page!');
visit(DETECTIONS_RULE_MANAGEMENT_URL);
waitForRulesTableToBeLoaded();
goToTheRuleDetailsOf(rule.name);
waitForPageToBeLoaded();
}
});
cy.url().should('include', DETECTIONS_RULE_MANAGEMENT_URL);
});
it('Has the expected alerts number', () => {

View file

@ -43,6 +43,7 @@ const CASE_NDJSON = '7_16_case.ndjson';
const importedCase = {
title: '7.16 case to export',
user: 'glo',
initial: 'g',
reporter: 'glo@test.co',
tags: 'export case',
numberOfAlerts: '1',
@ -107,7 +108,7 @@ describe('Import case after upgrade', () => {
it('Displays the correct case details on the cases page', () => {
cy.get(ALL_CASES_NAME).should('have.text', importedCase.title);
cy.get(ALL_CASES_REPORTER).should('have.text', importedCase.user);
cy.get(ALL_CASES_REPORTER).should('have.text', importedCase.initial);
cy.get(ALL_CASES_NUMBER_OF_ALERTS).should('have.text', importedCase.numberOfAlerts);
cy.get(ALL_CASES_COMMENTS_COUNT).should('have.text', importedCase.numberOfComments);
cy.get(ALL_CASES_NOT_PUSHED).should('be.visible');