checkly / headless-recorder

Chrome extension that records your browser interactions and generates a Playwright or Puppeteer script.
https://checklyhq.com/headless-recorder
MIT License
15.03k stars 722 forks source link

Give precedence to data-* and trust in ID's uniqueness #130

Closed ianaya89 closed 3 years ago

ianaya89 commented 3 years ago

Give precedence to data-* and trust in ID's uniqueness

Description

Introducing small improvements in selectors logic:

Add a label to settings page in order to inform users about this behaviour

Screen Shot 2021-01-18 at 23 37 13

Fix https://github.com/checkly/headless-recorder/issues/60

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

New tests cases were created in attributes.spec.js

  1. Checks that data-* will be used even if id is present
  2. Checks that a target based on id selector will generate a shorter output based only on id

Checklist:

tnolet commented 3 years ago

@ianaya89 I think @maxigimenez is better at reviewing this...I get lost here quite quickly.