Inconsistently, the partial text is being sent when using SendKeys
and causes a particular spec to fail. Below is the test that needs to happen for the other tests to past successfully
it('should select a template report', function() {
reports.createTemplateBtn.click();
reports.selectTemplate.click();
browser.switchTo().activeElement().sendKeys('Guest RSVP Status' + protractor.Key.ENTER);
browser.sleep(1000);
reports.startBtn.click();
});
The test is clicking a field (Select Template) which then shows a drop-down to type in the type of template to be used. The issue is with sending 'Guest RSVP Status'. Inconsistently, only portions of the phrase will be sent and cause the rest to error out. Is there a better way to implement Send Keys and/or should sleeps be added? 1/5 times the full text is sent successfully.
Update: slowType
errors out below. Sleep is not a function.
function slowType(elm, keys, delay){
var action = browser.actions().mouseMove(elm).click();
for (var i = 0; i < keys.length; i++) {
action = action.sendKeys(keys[i]).sleep(delay);
}
return action.perform();
}
action.sendKeys(...)sleep is not a function
Original post updated with code.reports.selectTemplate.click().sendKeys('Guest RSVP Status' + protractor.Key.ENTER);
? Because it seems the element you click is the same element you want the text to be passed on.