Skip to content

Commit c59f7ce

Browse files
Improve debugging
1 parent 873bed9 commit c59f7ce

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/appium_lib/driver.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Driver
3636

3737
attr_reader :app_path, :app_name, :app_package, :app_activity,
3838
:app_wait_activity, :sauce_username, :sauce_access_key,
39-
:port, :os, :ios_js
39+
:port, :os, :ios_js, :debug
4040
def initialize options={}
4141
# quit last driver
4242
$driver.driver_quit if $driver
@@ -76,7 +76,6 @@ def initialize options={}
7676

7777
@os = :ios
7878
@os = :android if @app_path.end_with?('.apk') || @app_path.end_with?('.apk.zip')
79-
puts "OS is: #{@os}" if defined?(Pry)
8079

8180
# load common methods
8281
extend Appium::Common
@@ -95,7 +94,12 @@ def initialize options={}
9594
patch_webdriver_element
9695

9796
# enable debug patch
98-
patch_webdriver_bridge if opts.fetch :debug, defined?(Pry)
97+
@debug = opts.fetch :debug, defined?(Pry)
98+
99+
if @debug
100+
puts "OS is: #{@os}"
101+
patch_webdriver_bridge
102+
end
99103

100104
# Save global reference to last created Appium driver for top level methods.
101105
$driver = self

lib/appium_lib/ios/element/textfield.rb

-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def textfield_include text
5555
t.concat(s)[0];
5656
)
5757

58-
puts js if defined? Pry
59-
6058
execute_script js
6159
end
6260

@@ -71,8 +69,6 @@ def textfield_exact text
7169
t.concat(s)[0];
7270
)
7371

74-
puts js if defined? Pry
75-
7672
execute_script js
7773
end
7874

0 commit comments

Comments
 (0)