[QA] suggestions for browser test debugging

Željko Filipin zfilipin at wikimedia.org
Thu Dec 12 14:48:16 UTC 2013


Hi S,

apologies for the late reply, I wanted to comment on so many things in your
e-mail that I never had the time to write such a long message. :)

I will do my best now in the limited time that I have a the moment.
Comments are inline.


On Wed, Nov 27, 2013 at 7:26 AM, S Page <spage at wikimedia.org> wrote:

> The Flow extension's features/flow_logged_in.feature fails for me
> asserting "Then links to talk and contrib should be visible" after "When I
> hover over the author link". I know exactly where it's failing, but not why.
>
> Whenever a test fails and it's not simply due to a page element changed
> its name or text, I have little idea how to debug it. SInce the cycle time
> for a test requiring login is over a minute, it's painful to try
> line-by-line changes. I'm used to interactively debugging jQuery selectors
> in a browser console, what's the equivalent for browser tests?
>

I usually use irb[1][2], but there are alternatives, like pry[3].


* Is there a way to break into the Ruby debugger when running a cucumber
> test?
>

Of course! In fact, there are several options[4][5][6][7]. I do not have a
lot of experience with any of the, because most of the problems are solved
using irb.


> * Is there a flash() function to flicker the page element that I'm trying
> to select, or a dump() function?
>

It is even called flash[8]! I am not sure what you expect from dump(), but
you can get element's html[9], if that is what you need.


>  * Should I see a mouseover effect in Firefox WebDriver while I'm watching
> a test that calls some_element.fire_event('onmouseover') ?
>

hover[10] should fire onmouseover event, and yes, you should see something
happening.


> Thanks for any suggestions or pointers.
>
> (Chris,
> the Flow code changed to do a CSS animations on hover to fade in the the
> links, so I tried adding a sleep. The hover effect is on the parent element
> of the element that the test does a mouseover on, so I tried changing the
> mouseover element. Neither helped.)
>

Code or it did not happen! :) Can you push the code you have so far to
gerrit and add me as a reviewer.

Let me know if you need help using any of the tools, or if anything is
still unclear.

Željko
--
1: https://en.wikipedia.org/wiki/Interactive_Ruby_Shell
2: https://www.ruby-lang.org/en/documentation/quickstart/
3: http://pryrepl.org/
4: https://www.ruby-toolbox.com/projects/debugger
5: https://www.ruby-toolbox.com/projects/ruby-debug
6: https://www.ruby-toolbox.com/projects/pry-debugger
7: https://www.ruby-toolbox.com/projects/ruby-debug-ide
8: http://rdoc.info/gems/watir-webdriver/Watir/Element#flash-instance_method
9: http://rdoc.info/gems/watir-webdriver/Watir/Element#html-instance_method
10:
http://rdoc.info/gems/watir-webdriver/Watir/Element#hover-instance_method
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20131212/bb8c776b/attachment.html>


More information about the QA mailing list