Skip to content

Commit

Permalink
[FEATURE] Update selection panel component for the "Create detection …
Browse files Browse the repository at this point in the history
…rule" page #587

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
  • Loading branch information
jovancacvetkovic committed May 22, 2023
1 parent 7d3cb05 commit 93c5238
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cypress/integration/2_rules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ const SAMPLE_RULE = {
name: `Cypress test rule ${uniqueId}`,
logType: 'windows',
description: 'This is a rule used to test the rule creation workflow.',
detection:
"condition: selection\nselection:\nProvider_Name|contains:\n- Service Control Manager\nEventID|contains:\n- '7045'\nServiceName|contains:\n- ZzNetSvc",
detectionLine: [
'condition: selection',
'selection:',
'condition: Selection_1',
'Selection_1:',
'Provider_Name|contains:',
'- Service Control Manager',
'EventID|contains:',
Expand Down Expand Up @@ -48,7 +46,7 @@ const YAML_RULE_LINES = [
`- '${SAMPLE_RULE.references}'`,
`author: ${SAMPLE_RULE.author}`,
`detection:`,
...SAMPLE_RULE.detection.replaceAll(' ', '').replaceAll('{backspace}', '').split('\n'),
...SAMPLE_RULE.detectionLine,
];

const checkRulesFlyout = () => {
Expand Down Expand Up @@ -184,7 +182,6 @@ describe('Rules', () => {
cy.get('[data-test-subj="rule_author_field"]').type(`${SAMPLE_RULE.author}{enter}`);

cy.get('[data-test-subj="detection-visual-editor-0"]').within(() => {
cy.getFieldByLabel('Name').type('selection');
cy.getFieldByLabel('Key').type('Provider_Name');
cy.getInputByPlaceholder('Value').type('Service Control Manager');

Expand All @@ -200,7 +197,7 @@ describe('Rules', () => {
cy.getInputByPlaceholder('Value').type('ZzNetSvc');
});
});
cy.get('[data-test-subj="rule_detection_field"] textarea').type('selection', {
cy.get('[data-test-subj="rule_detection_field"] textarea').type('Selection_1', {
force: true,
});

Expand Down

0 comments on commit 93c5238

Please sign in to comment.