ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

Problem on functional/on.js #413

Closed harbalk closed 9 years ago

harbalk commented 9 years ago

The functional test on.js added in https://github.com/ibm-js/delite/commit/cac5fadea9248a6e495a18b4986c9455964c6b20 is not passing in local with selenium.

The problem is on test "event.key shim - "keydown, keyup"" : AssertionError : expected 'Shift' to equal '5'

The debugger indicates line 107 but it does not make sense, it is probably line 95.

Maybe a difference Mac/Windows ?

wkeese commented 9 years ago

It's passing for me. What browser, browser version, and OS did you see the error on? Does the error reproduce when testing manually?

harbalk commented 9 years ago

On chrome version 43 on windows 7. When I do the same test manually, I can visually see a 5 when I press '5', if that's what you mean.

I have the same problem with a test in ListTests in deliteful with the modification done in this commit https://github.com/harbalk/deliteful/commit/c38e58f5091e83dda1cc912e1df8459d68420f12. (PR to fix https://github.com/ibm-js/deliteful/issues/574 not done yet).

In test "keyboard navigation with default renderers", when I do it manually the second item is well selected after pressing Arrow_down but automatically the test does not pass. But maybe the two problems are not related.

wkeese commented 9 years ago

OK, but it doesn't reproduce for me on Chrome 43 / Windows 7.

I guess I see what's happening. The test has this code:

.pressKeys("Z")
.execute("return keydown_log.value;").then(function (log) {
    assert.strictEqual(log, "Z");
})
.pressKeys("5")
.execute("return keyup_log.value;").then(function (log) {
    assert.strictEqual(log, "5");
});

I guess typing the capital "Z" implies holding down the shift key, and then pressing "5" [in some cases?] implies releasing the shift key. I guess on your machine the "shift" key is released after the "5" key is released, so keyup_log.value ends up saying "Shift" instead of "5".

It may be a race condition or dependent on the version of the chrome driver. My ChromeDriver is:

c:\Windows\System32>chromedriver.exe -version
ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf)

The latest one is 2.16. What version are you using?

If the problem still happens for you with the latest ChromeDriver than we can probably work around it by changing the test above to:

.pressKeys("Z")
.execute("return keydown_log.value;").then(function (log) {
    assert.strictEqual(log, "Z");
})
.pressKeys("z")    // to release the shift key, avoiding spurious test failure where value is "Shift"
.pressKeys("5")
.execute("return keyup_log.value;").then(function (log) {
    assert.strictEqual(log, "5");
});

You'll need to try it though, since the problem doesn't reproduce for me.

harbalk commented 9 years ago

It works fine for me with version 2.16. I was using the 2.9. Thanks a lot !

wkeese commented 9 years ago

OK cool, seems like this should be classified as a bug in the old ChromeDriver, so I'll close this ticket.