My goal is to use Nightwatch for testing the login process by clicking on a log in text link. I came across this helpful article: How to click a link using link text in nightwatch.js. The article suggested using the following code:
.useXpath() // every selector now must be XPath
.click("//a[text()='Two']")
.useCss() // we're back to CSS now
Unfortunately, that solution didn't work for me.
The link I want to click on is:
<li>
<a href="/user/login">
<strong>Sign in</strong>
</a>
</li>
I have tried the following code:
.useXpath()
.click("a[text()='Sign in')]")
.useCss()
Any suggestions or ideas on how to proceed?