<div dir="ltr"><div><div><br></div><div>Available now for browser tests in all repositories is a way to check for ResourceLoader errors on any page at any time.  Using this feature requires only adding a single line at any step in any Cucumber Feature.   This check can be used on new page loads, for example: </div>
<div><br></div><div>Given I am on my page of interest</div><div>  And page has no ResourceLoader errors</div><div>...</div><div><br></div><div>It should also be useful after clicking on links: </div><div><br></div><div>When I click on a link that leads to a new page</div>
<div>  And page has no ResourceLoader errors</div><div><br></div><div>or</div><div><br></div><div><div>When I click on a link that leads to a new page</div><div>Then I see the stuff I should see on the new page</div><div>
  And page has no ResourceLoader errors</div></div><div>...</div><div><br></div><div>In order to use this feature, make sure your Gemfile.lock in your tests/browser folder shows a version of mediawiki_selenium (0.2.12) or higher, then insert "Given (or When or And) page has no ResourceLoader errors" in the features where you want to check for RL errors.  That's all. </div>
<div><br></div><div>History: </div><div><br></div><div>The code that checks for RL errors[1] has actually been part of the qa/browsertests repo for some time.  It was an experiment that in the past was only ever pointed to a single page, hard-coded into the create_account test.  </div>
<div><br></div><div>It is a useful check, and it does from time to time find bugs in the create_account test, most recently just a week ago[2] it pointed out a problem with CentralNotice and ResourceLoader.</div><div><br>
</div><div>This is something that the Flow team has asked for, so I made a start of using it in the Flow repo[3]. </div><div><br></div><div>Future: </div><div><br></div><div>At various times we have discussed doing this check automatically at least at the start of each test, and possibly upon each new page load, but there are some reasons why that might not be a good idea.  Being able to explicitly call for a RL error check in the course of any test in any repo seems like a good compromise.  Those who wish to use the feature may do so at will, but no one is required to use it. </div>
<div><br></div><div>I'm sure our ideas about how to use this feature will change over time, but for now, any test in any repo can check for ResourceLoader errors at any time by simply adding a line to a Feature. </div>
<div><br></div><div>[1] <a href="https://git.wikimedia.org/blob/mediawiki%2Fselenium/80e58ba38409a87145118d5dcccc384ee1aca441/lib%2Fmediawiki_selenium%2Fstep_definitions%2Fresource_loader_steps.rb">https://git.wikimedia.org/blob/mediawiki%2Fselenium/80e58ba38409a87145118d5dcccc384ee1aca441/lib%2Fmediawiki_selenium%2Fstep_definitions%2Fresource_loader_steps.rb</a></div>
<div>[2] <a href="https://bugzilla.wikimedia.org/show_bug.cgi?id=62552">https://bugzilla.wikimedia.org/show_bug.cgi?id=62552</a></div><div>[3] <a href="https://gerrit.wikimedia.org/r/#/c/119070/">https://gerrit.wikimedia.org/r/#/c/119070/</a></div>
</div><div><br></div></div>