I am trying to press ENTER using nightwatch using below code in my test
module.exports = {
'Enter Text'(client) {
client
.url(url)
.waitForElementVisible('element', 1000)
.setValue('input[id="new-todo"]', ['abcdefgh', client.Keys.ENTER])
.pause(10000)
.end();
it opens chrome browser, sets the value but does not press ENTER. My application needs this to be done as pressing enter is the only option.
Below is the HTML code for the part I am trying to automate
<header id="header">
<h1>todos</h1>
<input id="new-todo" disabled placeholder="What needs to be done?" autofocus data-weave="troopjs-todos/widget/create">
</header>