-
Notifications
You must be signed in to change notification settings - Fork 198
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] add feature for row dropdown on the rule page …
…- WZD - 4676 (#4679) add feature for row dropdown on the rule page - WZD - 4676 (#4677) add feature for row dropdown on the rule page (cherry picked from commit 114610f) Co-authored-by: mauceballos <76791841+mauceballos@users.noreply.github.com>
- Loading branch information
1 parent
cf5ce54
commit 87ba151
Showing
8 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
test/cypress/cypress/integration/features/management/rules/validator-rows-dropdow.feature
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Feature: Validate row dropdown on Rule page | ||
|
||
As a wazuh user | ||
I want to see the Rules pages | ||
in order to manage them | ||
|
||
Background: the user navigate to the Rules page | ||
Given The wazuh admin user is logged | ||
When The user navigates to rules | ||
And The user see that the rule list is displayed with a limit per rows | ||
|
||
Scenario: Rules are displayed - Select 10 rows | ||
When The user click the limit selector for 10 rows | ||
Then a maximum of 10 rows of rules are displayed per page | ||
|
||
|
||
Scenario: Rules are displayed - Select 15 rows | ||
When The user click the limit selector for 15 rows | ||
Then a maximum of 15 rows of rules are displayed per page | ||
|
||
|
||
Scenario: Rules are displayed - Select 25 rows | ||
When The user click the limit selector for 25 rows | ||
Then a maximum of 25 rows of rules are displayed per page | ||
|
||
|
||
Scenario: Rules are displayed - Select 50 rows | ||
When The user click the limit selector for 50 rows | ||
Then a maximum of 50 rows of rules are displayed per page | ||
|
||
|
||
Scenario: Rules are displayed - Select 100 rows | ||
When The user click the limit selector for 100 rows | ||
Then a maximum of 100 rows of rules are displayed per page |
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
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
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
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
13 changes: 13 additions & 0 deletions
13
...press/integration/step-definitions/management/rules/a-maximum-rules-are-displayed-then.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { getSelector, elementIsVisible } from "../../../utils/driver"; | ||
import { RULES_PAGE as pageName } from '../../../utils/pages-constants'; | ||
const dropdownPaginationSelector = getSelector('dropdownPaginationSelector', pageName); | ||
const rulesRowTableSelector = getSelector('rulesRowTableSelector', pageName); | ||
|
||
Then('a maximum of {} rows of rules are displayed per page', (countRulesPerPage) => { | ||
elementIsVisible(dropdownPaginationSelector); | ||
elementIsVisible(rulesRowTableSelector); | ||
cy.get(rulesRowTableSelector).then(($list) => { | ||
expect($list.length).to.equal(parseInt(countRulesPerPage)); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
...ss/cypress/integration/step-definitions/management/rules/the-user-click-limit-row-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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { When } from 'cypress-cucumber-preprocessor/steps'; | ||
import { getSelector, elementIsVisible, clickElement } from "../../../utils/driver"; | ||
import { RULES_PAGE as pageName } from '../../../utils/pages-constants'; | ||
const dropdownPaginationSelector = getSelector('dropdownPaginationSelector', pageName); | ||
|
||
When('The user click the limit selector for {} rows', (countRulesPerPage) => { | ||
clickElement(dropdownPaginationSelector); | ||
let locator = '.euiContextMenuPanel [data-test-subj="tablePagination-'+countRulesPerPage+'-rows"]'; | ||
elementIsVisible(locator); | ||
clickElement(locator); | ||
cy.wait(2000); | ||
cy.get(dropdownPaginationSelector).find('.euiButtonEmpty__text').then(($list) => { | ||
cy.wrap($list).contains('Rows per page: ' + countRulesPerPage); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...ress/integration/step-definitions/management/rules/the-user-see-rule-list-per-row-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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { When } from "cypress-cucumber-preprocessor/steps"; | ||
import { getSelector, elementIsVisible } from "../../../utils/driver"; | ||
import { RULES_PAGE as pageName } from '../../../utils/pages-constants'; | ||
const dropdownPaginationSelector = getSelector('dropdownPaginationSelector', pageName); | ||
const rulesRowTableSelector = getSelector('rulesRowTableSelector', pageName); | ||
|
||
When('The user see that the rule list is displayed with a limit per rows', () => { | ||
elementIsVisible(dropdownPaginationSelector); | ||
elementIsVisible(rulesRowTableSelector); | ||
}) |