-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 4.4-1.2-wzd] Test Fixed, change decoder/rule tittle for cor…
…rect execution (#4498) Test Fixed, change decoder/rule tittle for correct execution (#4496) * Test Fixed, change decoder tittle for correct execution * Adding random name based on timestamp * Add new writing behaviour, same as decoder (cherry picked from commit ec3e4f6) Co-authored-by: Mayons95 <[email protected]>
- Loading branch information
1 parent
2268d64
commit 023274c
Showing
3 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
...s/integration/step-definitions/management/decoders/the-user-creates-a-new-decoder-when.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { When } from 'cypress-cucumber-preprocessor/steps'; | ||
import { fillField, elementIsVisible, getSelector } from '../../../utils/driver'; | ||
import { fillField, elementIsVisible, getSelector, generateRandomName } from '../../../utils/driver'; | ||
import { DECODERS_PAGE as pageName} from '../../../utils/pages-constants'; | ||
const decoderTitleSelector = getSelector('decoderTitleSelector', pageName); | ||
const codeEditorSelector = getSelector('codeEditorSelector', pageName); | ||
const testXmlText = '<decoder name="json"><prematch>^{\s*"</prematch><plugin_decoder>JSON_Decoder</plugin_decoder></decoder>'; | ||
const testXmlText = '<decoder name="wazuh"><prematch>^wazuh2: </prematch></decoder>'; | ||
|
||
When('The user writes a new decoder', () => { | ||
elementIsVisible(decoderTitleSelector); | ||
fillField(decoderTitleSelector,'Test'); | ||
fillField(decoderTitleSelector,generateRandomName()); | ||
fillField(codeEditorSelector,testXmlText); | ||
}) | ||
}); |
7 changes: 4 additions & 3 deletions
7
.../cypress/integration/step-definitions/management/rules/the-user-writes-a-new-rule-when.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { When } from 'cypress-cucumber-preprocessor/steps'; | ||
import { elementIsVisible, getSelector, fillField } from '../../../utils/driver'; | ||
import { elementIsVisible, getSelector, fillField, generateRandomName } from '../../../utils/driver'; | ||
import { RULES_PAGE as pageName} from '../../../utils/pages-constants'; | ||
const codeEditorSelector = getSelector('codeEditorSelector', pageName); | ||
const rulesTitleSelector = getSelector('rulesTitleSelector', pageName); | ||
const testXmlText = '<group name="windows,"><rule id="6" level="0" noalert="1"> <category>windows</category> <description>Generic template for all windows rules.</description></rule></group>'; | ||
|
||
When('The user writes a new rule', () => { | ||
elementIsVisible(rulesTitleSelector); | ||
fillField(rulesTitleSelector,'Test') | ||
fillField(rulesTitleSelector,generateRandomName()) | ||
elementIsVisible(codeEditorSelector); | ||
fillField(codeEditorSelector,'Test'); | ||
fillField(codeEditorSelector,testXmlText); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters