summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-11-17 11:16:22 +0100
committeranonym <anonym@riseup.net>2016-11-17 11:37:35 +0100
commit349a5a89df4788017182057efa1fddb27bd9a7a4 (patch)
treef228e18ec38146492ee1947f34188b2cb1520a73 /features
parent30d07ea9f8fcde460d0df847c8851bcba4e82519 (diff)
Replace --pause-on-fail with --interactive-debugging.
It does the same thing, but also offers an interactive Ruby shell via pry in the Cucumber world context.
Diffstat (limited to 'features')
-rw-r--r--features/config/defaults.yml2
-rw-r--r--features/support/helpers/misc_helpers.rb15
-rw-r--r--features/support/hooks.rb2
3 files changed, 14 insertions, 5 deletions
diff --git a/features/config/defaults.yml b/features/config/defaults.yml
index 993dfe3..1e7f8ea 100644
--- a/features/config/defaults.yml
+++ b/features/config/defaults.yml
@@ -1,7 +1,7 @@
CAPTURE: false
CAPTURE_ALL: false
+INTERACTIVE_DEBUGGING: false
MAX_NEW_TOR_CIRCUIT_RETRIES: 10
-PAUSE_ON_FAIL: false
SIKULI_RETRY_FINDFAILED: false
TMPDIR: "/tmp/TailsToaster"
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index 8f4bcd8..67957c1 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -1,4 +1,6 @@
require 'date'
+require 'io/console'
+require 'pry'
require 'timeout'
require 'test/unit'
@@ -265,7 +267,14 @@ def info_log_artifact_location(type, path)
end
def pause(message = "Paused")
- STDERR.puts
- STDERR.puts "#{message} (Press ENTER to continue!)"
- STDIN.gets
+ loop do
+ STDERR.puts "Return: Continue; d: Debugging REPL"
+ c = STDIN.getch
+ case c
+ when "\r"
+ return
+ when "d"
+ binding.pry(quiet: true)
+ end
+ end
end
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 3e2d7e1..6693120 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -253,7 +253,7 @@ After('@product') do |scenario|
info_log
info_log_artifact_location(type, artifact_path)
end
- pause("Scenario failed") if $config["PAUSE_ON_FAIL"]
+ pause("Scenario failed") if $config["INTERACTIVE_DEBUGGING"]
else
if @video_path && File.exist?(@video_path) && not($config['CAPTURE_ALL'])
FileUtils.rm(@video_path)