Issue with WebDriverJS sendKeys
See original GitHub issueI’m currently working on the TodoMVC Angular 2 implementation, you can see the work in progress via this pull request: https://github.com/tastejs/todomvc/pull/1558
The TodoMVC project uses WebDriverJS in order to automate the testing of each implementation. Unfortunately Angular 2.0 is failing due to some very strange issue. Here’s a very simple automated test that illustrates the issue:
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://colineberhardt.github.io/angular2-todo/');
driver.sleep(1000); // sleep to give the app time to bootstrap
var input = driver.findElement(webdriver.By.className('new-todo'));
input.sendKeys('buy some eggs', webdriver.Key.ENTER);
input.sendKeys('do the shopping', webdriver.Key.ENTER);
input.sendKeys('test all things', webdriver.Key.ENTER);
driver.sleep(10000); // sleep so that we can see the results
driver.quit();
(The above test is executed against a simplified version of the TodoMVC app, which can be found here).
Unfortunately the text input become completely mangled after the first addition of ‘buy some eggs’:
I have tried all sorts of changes to the TodoMVC app itself, however, the only way I can make the tests work is to add a pause in-between each keystroke:
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://todomvc.com/examples/angular2/');
driver.sleep(1000); // sleep so that we can eliminate startup issues
var input = driver.findElement(webdriver.By.className('new-todo'));
function sendSlowly(text) {
for (var i = 0, len = text.length; i < len; i++) {
input.sendKeys(text[i]);
driver.sleep(1);
}
input.sendKeys(webdriver.Key.ENTER);
driver.sleep(1);
}
sendSlowly('buy some eggs');
sendSlowly('do the shopping');
sendSlowly('test all things');
driver.sleep(10000); // sleep so that we can see the results
driver.quit();
This gives the expected result, with three items added to the todo list.
Does anyone have any ideas? I’d love to get the TodoMVC Angular2 app updated!
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (4 by maintainers)
I am now unable to reproduce this with RC2/RC3. I think the issues has been fixed. Please open a new bug if you can show us a reproducible test case. Thanks!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.