<div dir="ltr"><br><div>The problem has to do with abusing "After" clauses. </div><div><br></div><div>Read this over: <a href="https://github.com/cucumber/cucumber/wiki/Hooks">https://github.com/cucumber/cucumber/wiki/Hooks</a></div>
<div><br></div><div>Look at the @reset-preferences-after in ULS <a href="https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FUniversalLanguageSelector/ec532d63471a2285341d05d85c488ccadf645376/tests%2Fbrowser%2Ffeatures%2Fsupport%2Fhooks.rb">https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FUniversalLanguageSelector/ec532d63471a2285341d05d85c488ccadf645376/tests%2Fbrowser%2Ffeatures%2Fsupport%2Fhooks.rb</a></div>
<div><br></div><div>then look at the After clause the shared code in <a href="https://git.wikimedia.org/blob/mediawiki%2Fselenium/b39c18dae17791558ca77461b435d52bc1b0540b/lib%2Fmediawiki%2Fselenium%2Fhooks.rb">https://git.wikimedia.org/blob/mediawiki%2Fselenium/b39c18dae17791558ca77461b435d52bc1b0540b/lib%2Fmediawiki%2Fselenium%2Fhooks.rb</a><br>
</div><div><br></div><div>What's happening is that we try to execute the @reset-preferences-after hook once before we close the browser and then again after the browser is closed.  This is why the failure has no error message.</div>
<div><br></div><div>If you run 'bundle exec cucumber features/font_selection.feature:17' with either KEEP_BROWSER_OPEN or REUSE_BROWSER set to 'true', you can see the test do a global reset of preferences two times.  </div>
<div><br></div><div>If neither of these is set, then the test attempts to reset preferences a second time but with no browser open. </div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Mon, Oct 21, 2013 at 5:20 AM, Željko Filipin <span dir="ltr"><<a href="mailto:zfilipin@wikimedia.org" target="_blank">zfilipin@wikimedia.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Niklas and I have been pairing on this today, but we did not find the cause of the problem.<div><br></div><div>If you run font_selection.feature file[1], all scenarios pass if KEEP_BROWSER_OPEN is set to true:</div>


<div><br></div><div><br></div><div><br></div><div>$ export KEEP_BROWSER_OPEN=true<br></div><div><div>$ bundle exec cucumber features/font_selection.feature </div><div>Using the default profile...</div><div>................................</div>


<div><br></div><div>4 scenarios (4 passed)</div><div>29 steps (29 passed)</div><div>3m44.560s</div></div><div><br></div><div><br></div><div><br></div><div>If the environment variable is not set to true, all tests fail:</div>


<div><br></div><div><br></div><div><br></div><div><div>$ export KEEP_BROWSER_OPEN=nein</div><div>$ bundle exec cucumber features/font_selection.feature </div><div>Using the default profile...</div><div>.........F........F........F.......F</div>


<div><br></div><div>Failing Scenarios:</div><div>cucumber features/font_selection.feature:17 # Scenario: Font selector appears</div><div>cucumber features/font_selection.feature:22 # Scenario: Discarding live preview of content font</div>


<div>cucumber features/font_selection.feature:30 # Scenario: Discarding live preview of interface font</div><div>cucumber features/font_selection.feature:38 # Scenario: Applying the live preview of interface font</div><div>


<br></div><div>4 scenarios (4 failed)</div><div>29 steps (29 passed)</div><div>3m13.416s</div></div><div><br></div><div><br></div><div>If a scenario is executed with more verbose output:</div><div><br></div><div><br></div>


<div><br></div><div><div>$ bundle exec cucumber --verbose --format pretty features/font_selection.feature:17 </div><div>(...)</div><div>(...)/UniversalLanguageSelector/tests/browser/features/support/hooks.rb:19:in `After'<br>


</div><div><br></div><div>Failing Scenarios:</div><div>cucumber features/font_selection.feature:17 # Scenario: Font selector appears</div><div><br></div><div>1 scenario (1 failed)</div><div>6 steps (6 passed)</div><div>1m3.306s</div>


</div><div><br></div><div><br></div><div><br></div><div>It fails at hooks.rb, line 19[2], but that makes no sense, since the page opens just fine, and everything works fine if the browser stays open.</div><div><br></div>

<div>
I will further investigate the problem this week, but help is appreciated.</div><div><br></div><div>Željko</div><div>--</div><div>1: <a href="https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector/blob/master/tests/browser/features/font_selection.feature" target="_blank">https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector/blob/master/tests/browser/features/font_selection.feature</a></div>


<div>2: <a href="https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector/blob/master/tests/browser/features/support/hooks.rb#L19" target="_blank">https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector/blob/master/tests/browser/features/support/hooks.rb#L19</a></div>


</div>
<br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br></div>