Skip to content

[US-15-4] Give the user the ability to specify an attribute that shouldn't be used for locators generation (Black / Ignore list) #191

@AlexeyGirin

Description

@AlexeyGirin

It makes sense to complete #950 beforehand

Give user a possibility to specify attributes which shouldn't be used for locators generation

As a user
AND some additional attributes are used in my project, which data has no meaning or is useless in locators generation
I want to not generate code on it
So that allows me to get the correct code

DESCRIPTION:
User starts the locators generation and they see that in one of the locators undesired attribute is used. It is required to give user ability to exclude this attribute from locators generation so after locators recalculation new locators wouldn't contain that undesired attribute.

DEPENDENCIES:
#950 - Filter refactoring
#1285 - data-attributes
#1359 - data-ved

ACCEPTANCE CRITERIA

  • Updated filter with Attributes
    • Add headers
    • Add possibility to collapse list of blocks types
    • In the Block type search input change label to Search by type
  • Identification of locators containing undesired attributes. Recalculation only for those locators.
  • Add new item Ignore attribute to the context menu
  • Ability to Deny data-* attributes for filters (may be decomposed to another task)
  • New tags for filters
  • Robula update so it could accept ignored attributes as an argument

DESIGN:
figma

  • Add a new item to the context menu with options for locator and PO.
  • If In locator is selected, the menu closes and the attribute is changed in the selected locator.
  • If the locator does not have the attribute, do not show this item in the context menu.

image


  • If In Page Object is selected, a filter opens (scrolled to the attributes section) and the attribute is added.
  • Add a tag or a number to it (if it is not the first one).
  • Add new tags separated by a divider from the tag with highlighted locators.
  • Deny data-* attributes adds a separate tag with the text data-* (this checkbox should also increase the count of applied filters).

image
image


Additionally, we can separately open the filter and manually specify the attributes that should not be used.
Validation:

  1. Only Latin characters
  2. Convert to lower case automatically
  3. No spaces; when entering text into the input, if Enter or Spacebar is pressed, the entered text is saved as a tag and input continues.
  4. If text is entered into the input and ClickOut is performed, the entered text is also saved as a tag.

image

COMMENTS:
Changes will be needed on both the front-end and back-end. Currently, the list of attributes is not being transmitted. Because of this, Robula considers all possible combinations.

  1. Global settings
  2. Settings during creation
  3. Filter
  4. From the locators panel or coverage, select a locator and indicate that this locator is not suitable

The fourth option was chosen (the third is also possible), as attribute settings should be made when working with locators, i.e., within an open PO.

Changing an attribute is not a modification, but rather an edit, similar to changing the locator type or switching from xpath to css.

List of attributes: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes


@AlexeyGirin deletion of an attribute from filters will require recalculation of all locators

Metadata

Metadata

Assignees

Labels

PizzaFeedbacktasks related to user's feedbackready for devtask is estimated, described and ready for dev

Type

No type

Projects

Status

XL (13)

Status

To do

Relationships

None yet

Development

No branches or pull requests

Issue actions