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

Select some text and press tab will check for the presence in the page #181

Closed dolfje closed 1 year ago

dolfje commented 2 years ago

Description

In test you want to check if some text is included in the page. That wasn't possible yet with the current recoder. I made it possible by selecting the text and then press the tab (so the key code). Then it will add a code block that will check if the selected text is present.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

ianaya89 commented 2 years ago

Related to https://github.com/checkly/headless-recorder/issues/87

ianaya89 commented 2 years ago

I think this is really useful, but I am not sure if pressing tab will be the best approach (especially because tab is commonly used for page navigation). What do you think about a contextual menu? Pressing right click on the page could show up some options related to assertions.

I will add a PoC under this branch, so we can review it and compare

dolfje commented 2 years ago

I agree with contextual menu. But because "tab" is already used in the context of "marking input" from the user.

  1. you typed text inside an input, then tab => the input of the text is confirmed and added to the scenario
  2. you select some text, then tab => the selected text is confirmed and added to the scenario
ianaya89 commented 1 year ago

https://github.com/checkly/headless-recorder/issues/232