Adrian Lang has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/191552

Change subject: Ignore HEADLESS and KEEP_BROWSER_OPEN for phantomjs
......................................................................

Ignore HEADLESS and KEEP_BROWSER_OPEN for phantomjs

The former will make tests fail, the latter will spawn a lot of phantomjs 
processes
killing your machine. That's probably a bug in the phantomjs driver, since it 
should
kill the phantomjs processes itself if it does not intend to reuse them.

Change-Id: I9861a29525684ba9a984a15dd1c14643c7a41e67
---
M lib/mediawiki_selenium/environment.rb
M lib/mediawiki_selenium/support/hooks.rb
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/52/191552/1

diff --git a/lib/mediawiki_selenium/environment.rb 
b/lib/mediawiki_selenium/environment.rb
index 38cbd31..a0ae067 100644
--- a/lib/mediawiki_selenium/environment.rb
+++ b/lib/mediawiki_selenium/environment.rb
@@ -334,10 +334,10 @@
     # @yieldparam browser [Watir::Browser] Browser object, before it's closed.
     #
     def teardown(status = :passed)
-      @_factory_cache.each do |_, factory|
+      @_factory_cache.each do |browser_name, factory|
         factory.each do |browser|
           yield browser if block_given?
-          browser.close unless keep_browser_open?
+          browser.close unless keep_browser_open? && browser_name != 
'phantomjs'
         end
 
         factory.teardown(self, status)
diff --git a/lib/mediawiki_selenium/support/hooks.rb 
b/lib/mediawiki_selenium/support/hooks.rb
index ea7edda..42e4487 100644
--- a/lib/mediawiki_selenium/support/hooks.rb
+++ b/lib/mediawiki_selenium/support/hooks.rb
@@ -19,7 +19,7 @@
   config.formats << ["MediawikiSelenium::WarningsFormatter", io] if 
pretty_format
 
   # Initiate headless mode
-  if ENV["HEADLESS"] == "true"
+  if ENV["HEADLESS"] == "true" && ENV["BROWSER"] != "phantomjs"
     require "headless"
 
     headless_options = {}.tap do |options|

-- 
To view, visit https://gerrit.wikimedia.org/r/191552
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9861a29525684ba9a984a15dd1c14643c7a41e67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to