Skip to content

Commit

Permalink
adding missing tests and updating scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Nov 30, 2023
1 parent dd9051b commit a045fb2
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* 2.0.
*/

import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
import { deleteAlertsAndRules } from '../../../../../tasks/api_calls/common';
import {
expandFirstAlert,
goToClosedAlertsOnRuleDetailsPage,
openAddEndpointExceptionFromAlertActionButton,
openAddEndpointExceptionFromFirstAlert,
waitForAlerts,
} from '../../../tasks/alerts';
import { login } from '../../../tasks/login';
import { getEndpointRule } from '../../../objects/rule';
import { createRule } from '../../../tasks/api_calls/rules';
import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule';
} from '../../../../../tasks/alerts';
import { login } from '../../../../../tasks/login';
import { getEndpointRule } from '../../../../../objects/rule';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { waitForAlertsToPopulate } from '../../../../../tasks/create_new_rule';
import {
addExceptionEntryFieldValueAndSelectSuggestion,
addExceptionEntryFieldValueValue,
Expand All @@ -25,19 +25,19 @@ import {
selectCloseSingleAlerts,
submitNewExceptionItem,
validateExceptionConditionField,
} from '../../../tasks/exceptions';
import { ALERTS_COUNT } from '../../../screens/alerts';
} from '../../../../../tasks/exceptions';
import { ALERTS_COUNT } from '../../../../../screens/alerts';
import {
ADD_AND_BTN,
EXCEPTION_CARD_ITEM_CONDITIONS,
EXCEPTION_CARD_ITEM_NAME,
EXCEPTION_ITEM_VIEWER_CONTAINER,
} from '../../../screens/exceptions';
} from '../../../../../screens/exceptions';
import {
goToEndpointExceptionsTab,
visitRuleDetailsPage,
waitForTheRuleToBeExecuted,
} from '../../../tasks/rule_details';
} from '../../../../../tasks/rule_details';

// TODO: https://github.com/elastic/kibana/issues/161539
// See https://github.com/elastic/kibana/issues/163967
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { LOADING_INDICATOR } from '../../../../screens/security_header';
import { getEndpointRule } from '../../../../objects/rule';
import { createRule } from '../../../../tasks/api_calls/rules';
import { LOADING_INDICATOR } from '../../../../../../screens/security_header';
import { getEndpointRule } from '../../../../../../objects/rule';
import { createRule } from '../../../../../../tasks/api_calls/rules';
import {
addExceptionFromFirstAlert,
expandFirstAlert,
openAddRuleExceptionFromAlertActionButton,
} from '../../../../tasks/alerts';
} from '../../../../../../tasks/alerts';
import {
addExceptionEntryFieldValue,
addExceptionEntryFieldValueValue,
Expand All @@ -22,19 +22,19 @@ import {
editExceptionFlyoutItemName,
validateHighlightedFieldsPopulatedAsExceptionConditions,
validateEmptyExceptionConditionField,
} from '../../../../tasks/exceptions';
import { login } from '../../../../tasks/login';
import { goToExceptionsTab, visitRuleDetailsPage } from '../../../../tasks/rule_details';
} from '../../../../../../tasks/exceptions';
import { login } from '../../../../../../tasks/login';
import { goToExceptionsTab, visitRuleDetailsPage } from '../../../../../../tasks/rule_details';

import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common';
import { deleteAlertsAndRules } from '../../../../../../tasks/api_calls/common';
import {
ADD_AND_BTN,
ENTRY_DELETE_BTN,
EXCEPTION_CARD_ITEM_CONDITIONS,
EXCEPTION_CARD_ITEM_NAME,
EXCEPTION_ITEM_VIEWER_CONTAINER,
} from '../../../../screens/exceptions';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';
} from '../../../../../../screens/exceptions';
import { waitForAlertsToPopulate } from '../../../../../../tasks/create_new_rule';

// TODO: https://github.com/elastic/kibana/issues/161539
// See https://github.com/elastic/kibana/issues/163967
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';
import { waitForAlertsToPopulate } from '../../../../../../tasks/create_new_rule';
import {
addExceptionFromFirstAlert,
goToClosedAlertsOnRuleDetailsPage,
waitForAlerts,
} from '../../../../tasks/alerts';
import { deleteAlertsAndRules, postDataView } from '../../../../tasks/api_calls/common';
import { login } from '../../../../tasks/login';
import { visitRuleDetailsPage } from '../../../../tasks/rule_details';
import { createRule } from '../../../../tasks/api_calls/rules';
import { getNewRule } from '../../../../objects/rule';
import { LOADING_INDICATOR } from '../../../../screens/security_header';
import { ALERTS_COUNT } from '../../../../screens/alerts';
} from '../../../../../../tasks/alerts';
import { deleteAlertsAndRules, postDataView } from '../../../../../../tasks/api_calls/common';
import { login } from '../../../../../../tasks/login';
import { visitRuleDetailsPage } from '../../../../../../tasks/rule_details';
import { createRule } from '../../../../../../tasks/api_calls/rules';
import { getNewRule } from '../../../../../../objects/rule';
import { LOADING_INDICATOR } from '../../../../../../screens/security_header';
import { ALERTS_COUNT } from '../../../../../../screens/alerts';
import {
addExceptionEntryFieldValue,
addExceptionEntryOperatorValue,
addExceptionEntryFieldValueValue,
addExceptionFlyoutItemName,
selectBulkCloseAlerts,
submitNewExceptionItem,
} from '../../../../tasks/exceptions';
} from '../../../../../../tasks/exceptions';

// TODO: https://github.com/elastic/kibana/issues/161539
// See https://github.com/elastic/kibana/issues/163967
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* 2.0.
*/

import { getNewRule } from '../../../objects/rule';
import { getNewRule } from '../../../../../objects/rule';

import { RULE_STATUS } from '../../../screens/create_new_rule';
import { RULE_STATUS } from '../../../../../screens/create_new_rule';

import { createRule } from '../../../tasks/api_calls/rules';
import { login } from '../../../tasks/login';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { login } from '../../../../../tasks/login';
import {
openExceptionFlyoutFromEmptyViewerPrompt,
goToExceptionsTab,
openEditException,
visitRuleDetailsPage,
} from '../../../tasks/rule_details';
} from '../../../../../tasks/rule_details';
import {
addExceptionEntryFieldMatchAnyValue,
addExceptionEntryFieldValue,
Expand All @@ -29,7 +29,7 @@ import {
selectCurrentEntryField,
showFieldConflictsWarningTooltipWithMessage,
showMappingConflictsWarningMessage,
} from '../../../tasks/exceptions';
} from '../../../../../tasks/exceptions';
import {
ADD_AND_BTN,
ADD_OR_BTN,
Expand All @@ -45,17 +45,17 @@ import {
VALUES_INPUT,
EXCEPTION_FLYOUT_TITLE,
FIELD_INPUT_PARENT,
} from '../../../screens/exceptions';
} from '../../../../../screens/exceptions';

import { reload } from '../../../tasks/common';
import { reload } from '../../../../../tasks/common';
import {
createExceptionList,
createExceptionListItem,
updateExceptionListItem,
deleteExceptionList,
} from '../../../tasks/api_calls/exceptions';
import { getExceptionList } from '../../../objects/exception';
import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
} from '../../../../../tasks/api_calls/exceptions';
import { getExceptionList } from '../../../../../objects/exception';
import { deleteAlertsAndRules } from '../../../../../tasks/api_calls/common';

// TODO: https://github.com/elastic/kibana/issues/161539
// Test Skipped until we fix the Flyout rerendering issue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
* 2.0.
*/

import { getNewRule } from '../../../objects/rule';
import { getNewRule } from '../../../../../objects/rule';

import { RULE_STATUS } from '../../../screens/create_new_rule';
import { RULE_STATUS } from '../../../../../screens/create_new_rule';

import { createRule } from '../../../tasks/api_calls/rules';
import { login } from '../../../tasks/login';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { login } from '../../../../../tasks/login';
import {
openExceptionFlyoutFromEmptyViewerPrompt,
visitRuleDetailsPage,
enablesRule,
waitForTheRuleToBeExecuted,
goToAlertsTab,
} from '../../../tasks/rule_details';
} from '../../../../../tasks/rule_details';
import {
addExceptionEntryFieldMatchAnyValue,
addExceptionEntryFieldValue,
addExceptionEntryOperatorValue,
addExceptionFlyoutItemName,
submitNewExceptionItem,
} from '../../../tasks/exceptions';
import { CONFIRM_BTN } from '../../../screens/exceptions';
import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
import { ALERTS_COUNT } from '../../../screens/alerts';
import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule';
} from '../../../../../tasks/exceptions';
import { CONFIRM_BTN } from '../../../../../screens/exceptions';
import { deleteAlertsAndRules } from '../../../../../tasks/api_calls/common';
import { ALERTS_COUNT } from '../../../../../screens/alerts';
import { waitForAlertsToPopulate } from '../../../../../tasks/create_new_rule';

describe('Exceptions match_any', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
* 2.0.
*/

import { getNewRule } from '../../../objects/rule';
import { getNewRule } from '../../../../../objects/rule';

import { createRule } from '../../../tasks/api_calls/rules';
import { login } from '../../../tasks/login';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { login } from '../../../../../tasks/login';
import {
openExceptionFlyoutFromEmptyViewerPrompt,
visitRuleDetailsPage,
} from '../../../tasks/rule_details';
} from '../../../../../tasks/rule_details';
import {
addExceptionFlyoutItemName,
addTwoAndedConditions,
addTwoORedConditions,
submitNewExceptionItem,
} from '../../../tasks/exceptions';
} from '../../../../../tasks/exceptions';
import {
EXCEPTION_CARD_ITEM_NAME,
EXCEPTION_CARD_ITEM_CONDITIONS,
EXCEPTION_ITEM_VIEWER_CONTAINER,
} from '../../../screens/exceptions';
} from '../../../../../screens/exceptions';

import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
import { deleteAlertsAndRules } from '../../../../../tasks/api_calls/common';

describe(
'Add multiple conditions and validate the generated exceptions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import {
addExceptionEntryOperatorValue,
addExceptionFlyoutItemName,
submitNewExceptionItem,
} from '../../../tasks/exceptions';
} from '../../../../../tasks/exceptions';
import {
openExceptionFlyoutFromEmptyViewerPrompt,
visitRuleDetailsPage,
} from '../../../tasks/rule_details';
import { getNewRule } from '../../../objects/rule';
import { login } from '../../../tasks/login';
import { visit } from '../../../tasks/navigation';
import { RULES_MANAGEMENT_URL } from '../../../urls/rules_management';
} from '../../../../../tasks/rule_details';
import { getNewRule } from '../../../../../objects/rule';
import { login } from '../../../../../tasks/login';
import { visit } from '../../../../../tasks/navigation';
import { RULES_MANAGEMENT_URL } from '../../../../../urls/rules_management';
import {
createListsIndex,
waitForListsIndex,
Expand All @@ -29,16 +29,16 @@ import {
importValueList,
KNOWN_VALUE_LIST_FILES,
deleteValueLists,
} from '../../../tasks/lists';
import { createRule } from '../../../tasks/api_calls/rules';
} from '../../../../../tasks/lists';
import { createRule } from '../../../../../tasks/api_calls/rules';
import {
CLOSE_ALERTS_CHECKBOX,
EXCEPTIONS_TABLE_MODAL,
EXCEPTION_CARD_ITEM_CONDITIONS,
EXCEPTION_CARD_ITEM_NAME,
EXCEPTION_ITEM_VIEWER_CONTAINER,
NO_EXCEPTIONS_EXIST_PROMPT,
} from '../../../screens/exceptions';
} from '../../../../../screens/exceptions';

const goToRulesAndOpenValueListModal = () => {
visit(RULES_MANAGEMENT_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
* 2.0.
*/

import { getNewRule } from '../../../objects/rule';
import { getNewRule } from '../../../../../objects/rule';

import { createRule } from '../../../tasks/api_calls/rules';
import { login } from '../../../tasks/login';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { login } from '../../../../../tasks/login';
import {
openEditException,
openExceptionFlyoutFromEmptyViewerPrompt,
searchForExceptionItem,
visitRuleDetailsPage,
waitForPageToBeLoaded as waitForRuleDetailsPageToBeLoaded,
} from '../../../tasks/rule_details';
} from '../../../../../tasks/rule_details';
import {
addExceptionConditions,
addExceptionFlyoutItemName,
Expand All @@ -24,13 +24,13 @@ import {
selectOs,
submitEditedExceptionItem,
submitNewExceptionItem,
} from '../../../tasks/exceptions';
} from '../../../../../tasks/exceptions';

import {
deleteAlertsAndRules,
deleteEndpointExceptionList,
deleteExceptionLists,
} from '../../../tasks/api_calls/common';
} from '../../../../../tasks/api_calls/common';
import {
NO_EXCEPTIONS_EXIST_PROMPT,
EXCEPTION_ITEM_VIEWER_CONTAINER,
Expand All @@ -44,11 +44,11 @@ import {
EXCEPTION_CARD_ITEM_NAME,
EXCEPTION_CARD_ITEM_CONDITIONS,
FIELD_INPUT_PARENT,
} from '../../../screens/exceptions';
} from '../../../../../screens/exceptions';
import {
createEndpointExceptionList,
createEndpointExceptionListItem,
} from '../../../tasks/api_calls/exceptions';
} from '../../../../../tasks/api_calls/exceptions';

describe('Add endpoint exception from rule details', { tags: ['@ess', '@serverless'] }, () => {
const ITEM_NAME = 'Sample Exception List Item';
Expand Down
Loading

0 comments on commit a045fb2

Please sign in to comment.