What I have is:
<a href="/test-guinea-pig2.html" id="i am a link">i am a link</a>
How would I go about clicking that using nightwatch.js? click() isn't working out.
What I have is:
<a href="/test-guinea-pig2.html" id="i am a link">i am a link</a>
How would I go about clicking that using nightwatch.js? click() isn't working out.
You click the same way you would do with a CSS selector:
browser.click('#my-id')
. That said the id in your example is invalid (link to what is a valid id) so you better rewrite it like i-am-a-link
or something better.
if we use browser.click('#my-id') it will look in the entire dom to identify the element.
The better and faster way to do will be
.click('a[id="i-am-a-link"]')
by filtering using 'a' only the anchor tags in the dom will be searched for .