Amire80 has uploaded a new change for review.

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


Change subject: Add the environment variable KEEP_BROWSER_OPEN
......................................................................

Add the environment variable KEEP_BROWSER_OPEN

If set to 'true' this keeps the browser open after running
a scenario.

Added documentation, too.

Change-Id: If4167386fac15d7b39d81ded5593c65a85d46abb
---
M README.md
M features/support/env.rb
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/68/75568/1

diff --git a/README.md b/README.md
index 6f05ae8..f922489 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,14 @@
 
 The test run creates an HTML report in `reports/` and an XML report (for 
Jenkins) in `reports/junit`.
 
-To run a single test enter `bundle exec cucumber 
features/FEATURE_NAME.feature`.
+To run a single test file enter `bundle exec cucumber 
features/FEATURE_NAME.feature`.
+
+To run a single test scenario, put a colon and the line number (NN) on which 
the scenario begins after the file name: `bundle exec cucumber 
features/FEATURE_NAME.feature:NN`.
+
+By default, the browser will close itself at the end of every scenario. If you 
want the browser to stay open, define set the environment variable 
KEEP_BROWSER_OPEN to 'true':
+
+    export KEEP_BROWSER_OPEN=true # Linux/Unix
+    set KEEP_BROWSER_OPEN=true # Windows
 
 ## Sites
 
diff --git a/features/support/env.rb b/features/support/env.rb
index 26e8562..a6b4292 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -132,5 +132,8 @@
     sauce_api(%Q{{"passed": #{scenario.passed?}}}, saucelabs_username, 
saucelabs_key)
     sauce_api(%Q{{"public": true}}, saucelabs_username, saucelabs_key)
   end
-  @browser.close
+
+  if ENV['KEEP_BROWSER_OPEN'] != 'true'
+    @browser.close
+  end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4167386fac15d7b39d81ded5593c65a85d46abb
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to