appium_lib 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Appium
3
3
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
4
- VERSION = '0.13.0' unless defined? ::Appium::VERSION
4
+ VERSION = '0.14.0' unless defined? ::Appium::VERSION
5
5
  DATE = '2013-11-22' unless defined? ::Appium::DATE
6
6
  end
@@ -260,6 +260,7 @@ module Appium
260
260
  @export_session = opts.fetch :export_session, false
261
261
 
262
262
  @default_wait = opts.fetch :wait, 30
263
+ @last_waits = [@default_wait]
263
264
 
264
265
  # Path to the .apk, .app or .app.zip.
265
266
  # The path can be local or remote for Sauce.
@@ -498,15 +499,36 @@ module Appium
498
499
 
499
500
  # Set implicit wait and default_wait to zero.
500
501
  def no_wait
502
+ @last_waits = [@default_wait, 0]
501
503
  @default_wait = 0
502
504
  @driver.manage.timeouts.implicit_wait = 0
503
505
  end
504
506
 
505
507
  # Set implicit wait and default_wait to timeout, defaults to 30.
508
+ # if set_wait is called without a param then the second to last
509
+ # wait will be used.
510
+ #
511
+ # ```ruby`
512
+ # set_wait 2
513
+ # set_wait 3
514
+ # set_wait # 2
515
+ #
516
+ # ````
517
+ #
506
518
  # @param timeout [Integer] the timeout in seconds
507
519
  # @return [void]
508
- def set_wait timeout=@default_wait
509
- @default_wait = timeout
520
+ def set_wait timeout=nil
521
+ if timeout.nil?
522
+ # puts "timeout = @default_wait = @last_wait"
523
+ # puts "timeout = @default_wait = #{@last_waits}"
524
+ timeout = @default_wait = @last_waits.first
525
+ else
526
+ @default_wait = timeout
527
+ # puts "last waits before: #{@last_waits}"
528
+ @last_waits = [@last_waits.last, @default_wait]
529
+ # puts "last waits after: #{@last_waits}"
530
+ end
531
+
510
532
  @driver.manage.timeouts.implicit_wait = timeout
511
533
  end
512
534
 
@@ -1,5 +1,7 @@
1
1
  #### v0.13.0 2013-11-22
2
2
 
3
+ - [e1632bc](https://github.com/appium/ruby_lib/commit/e1632bc88116996a5ed3983a0a9f3ec864d229d9) Release 0.13.0
4
+ - [87c5e12](https://github.com/appium/ruby_lib/commit/87c5e120c51e3344241ca48ccb4ba4990dc76cbd) Release 0.13.0
3
5
  - [647cb94](https://github.com/appium/ruby_lib/commit/647cb942f344c635e067f2ae563f4fae12685148) Release 0.13.0
4
6
  - [a235a2c](https://github.com/appium/ruby_lib/commit/a235a2c70d2c7dc1934c9fb403fb95cc3ae56e04) Update name_exact
5
7
  - [f1d2701](https://github.com/appium/ruby_lib/commit/f1d270120ae248beb6746a0149ebcbe4e34ebcca) names on Android will return the text values when no arg is passed
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com