2

I am struggling with keyup.enter event on input search in my protractor/cucumber test (angular 2)

I was trying:

input_search.sendKeys(protractor.Key.ENTER) // also with Key.RETURN
.then(() => { ...  });

and this:

browser.actions().sendKeys(protractor.Key.ENTER).perform() // also with Key.RETURN
.then(() => { ...  });

but still I can't execute keyup.enter event on my search_input.

<input type="text" class="form-control"
                    [(ngModel)]="phrase"  
                    (blur)="onBlur()" 
                    (focus)="onFocus()"
                    (keyup.enter)="search(phrase)"
                     id="search_input"
                    />

I can do it when I am clicking magnifier... and in normal browser using ENTER button.

I am using cucumberjs 0.10.3 with protractor 3.3.0 on node v4.3.1 and angular2-rc-1 .

Dariusz Filipiak
  • 2,858
  • 5
  • 28
  • 39
  • whats the error are you getting? – nilesh Jun 08 '16 at 18:37
  • First, I am sending some keys to search... then I am trying to send enter, but nothing's happening.. my keyup.enter event isn't fired.. Is it possible to get more info than console logs ? I warn that browser.pause() or browser.debugger() isn't working as well... – Dariusz Filipiak Jun 08 '16 at 20:08
  • 1
    I am having this problem too. keyup.enter is not triggered by sendKeys(protractor.Key.ENTER). For now added a superfluous button to invoke the action and I test on that. Ever found a solution? No error, it just does not trigger the keyup.enter event. – Tony B Oct 04 '16 at 19:09

0 Answers0