wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Add identifiers to items to improve automated test performance - Rule Page

Open Mayons95 opened this issue 2 years ago • 0 comments

With the automated test, we detected that there are a lot of components in our app that does not have a unique identification that could be usable in our automated test cases. This can be very hard to manage by using XPath and a long CSS selector. So we create this issue to handle the first id refactor.

The idea is to add or replace the "data-test" attribute in all the elements in the DOM that could be useful for the automated test.

Analyzed feature: Create a new custom rule

image Any of the modules on this component has not data-test attributes or usable ids. Today we are using very long CSS selectors to execute our test.

We need to create data-test attributes for the next components:

rulesButtonSelector: '[class="euiSideNavItem euiSideNavItem--trunk"]',
 titleSelector: '[class="euiTitle euiTitle--medium"]',
 tableSelector: '[class="euiTableRow customRowClass euiTableRow-isClickable"]',
 dropdownPaginationSelector: '[data-test-subj="tablePaginationPopoverButton"]',
 listPagesSelector: 'nav[class="euiPagination"]',
 customRulesButtonSelector: '.euiButtonGroupButton.euiButtonGroupButton--text'
 XMLFileSelector

Mayons95 avatar Jun 28 '22 11:06 Mayons95