nightwatchjs / nightwatch-chrome-recorder

Generate Nightwatch Tests from Google Chrome DevTools Recorder
MIT License
22 stars 8 forks source link

Add support for text and xpath selector #6

Open jecfish opened 2 years ago

jecfish commented 2 years ago

DevTools Recorder support text and XPath selector from Chrome 108 onwards. I am wondering if there are similar selector in Nightwatch?

Here is the example step's json.

{
      "type": "click",
      "target": "main",
      "selectors": [
        [
          "aria/Proceed to checkout"
        ],
        [
          "[data-test=checkout]"
        ],
        [
          "xpath///*[@data-test=\"checkout\"]"
        ],
        [
          "text/Total: $0.00"
        ]
      ]
    }
Screen Shot 2022-10-16 at 9 35 19 AM
vaibhavsingh97 commented 2 years ago

That's awesome! We do have xPath, but I was wondering which selector should be given preference since we have four selectors and officially, w3c only support xPath and css selector, so what should be the order? Also, do users have options to only prefer the xPath or text selector?

Gahona47 commented 1 year ago

/

Gahona47 commented 1 year ago

``

DevTools Recorder support text and XPath selector from Chrome 108 onwards. I am wondering if there are similar selector in Nightwatch?

Here is the example step's json.

{
      "type": "click",
      "target": "main",
      "selectors": [
        [
          "aria/Proceed to chend
eckout"
        ],
        [
          "[data-test=checkout]"
        ],
        [
          "xpath///*[@data-test=\"checkout\"]"
        ],
        [
          "text/Total: $0.00"
        ]
      ]
    }

<img alt="Screen Shot 2022-10-16 at 9 35 19 AM" width="500" `src="https://user-images.githubusercontent.com/5917927/196023955-28e86ac8-fb1b-44ee-aa7a-006b7c4b9ec3.p


Deted

`` ng">de

Dkjdlete