theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 310 forks source link

Right click doesn't work in functional test #191

Closed draperd closed 10 years ago

draperd commented 10 years ago

It doesn't appear to be possible to issue a right mouse click... according the to the WD.js documentation (https://github.com/admc/wd/blob/master/doc/jsonwire-full-mapping.md) it should be possible to pass an integer value representing the desired mouse button when using the .click() function. However, this doesn't appear to work in my functional test... see this example:

.elementByCss("#LOGO") .moveTo() .click(2) .end()

In the output I see the following:

Warning: FAIL: main - AlfContextMenu Test - alfresco/menus/AlfContextMenu (30011ms) CancelError: Failed to execute click(2): Timeout reached on main - AlfContextMenu Test - alfresco/menus/AlfContextMenu at PromisedWebDriver.(anonymous function) as click at Test.registerSuite.alfresco/menus/AlfContextMenu as test at Test.run (/home/dave/Development/projects/HEAD/code/root/projects/slingshot/node_modules/intern/lib/Test.js:154:19) at /home/dave/Development/projects/HEAD/code/root/projects/slingshot/node_modules/intern/lib/Suite.js:211:13 at signalListener (/home/dave/Development/projects/HEAD/code/root/projects/slingshot/node_modules/intern/node_modules/dojo/Deferred.js:37:21) at Promise.then.promise.then (/home/dave/Development/projects/HEAD/code/root/projects/slingshot/node_modules/intern/node_modules/dojo/Deferred.js:258:5) at /home/dave/Development/projects/HEAD/code/root/projects/slingshot/node_modules/intern/lib/Suite.js:210:46 at process._tickCallback (node.js:415:13)

The target node is being found correctly, if I remove the 2 argument then the click occurs. This is on Intern 1.7 and testing against Firefox.

csnover commented 10 years ago

I think that some Selenium drivers are broken and don’t work if you try to right-click, for example https://code.google.com/p/selenium/issues/detail?id=5991. But, I’m not sure if that is the case here. You could try making sure that you have no element context (call end first), since that is the only thing I can think of that might be causing a problem on our end. The next version of Intern comes with a better client library that will 1. verify that it is not a problem on our end, 2. provide a way for us to try to make it work anyway.

csnover commented 10 years ago

Since we haven’t received any more information on this issue since it was reported, I am going to close it for now. When you are able to provide the additional requested information, please send it over and we will re-evaluate the ticket. Thanks!

draperd commented 10 years ago

My understanding is that Intern is going to be adopted for all Dojo unit tests (replacing DOH)... so at some stage this will need fixing (unless context menu tests have already been written and are passing?)

neonstalwart commented 10 years ago

@draperd the initial scope for converting Dojo unit tests to intern is just dojo (not dijit) and as @csnover said, intern 2 has a better client library that should either already work or be easier to fix