<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 11:26 PM, S Page <span dir="ltr"><<a href="mailto:spage@wikimedia.org" target="_blank">spage@wikimedia.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>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.<br>
<br></div>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?</div>
</div></div></blockquote><div><br></div><div>And here is the sophisticated answer. Watir in particular (even before Selenium existed) was always intended to be used interactively as well as batch-wise. The key is to use irb, interactive Ruby</div>
<div><br></div><div>$ irb</div><div>2.0.0p247 :001 > require 'watir-webdriver'</div><div> => true </div><div>2.0.0p247 :002 > browser = Watir::Browser.new :firefox</div><div> => #<Watir::Browser:0x..fac3245de232edb40 url="about:blank" title=""> </div>
<div>2.0.0p247 :003 > browser.goto('<a href="http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA">http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA</a>')</div><div> => "<a href="http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA">http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA</a>"</div>
<div><br></div><div>at this point your browser has the Flow page open and you can zoom around in it in some really spectacular ways. A place to start looking is <a href="https://github.com/watir/watir/wiki/Using-IRB">https://github.com/watir/watir/wiki/Using-IRB</a>, but there is a lot more available. </div>
<div><br></div><div> </div></div><br></div></div>