appium_lib 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.19.0' unless defined? ::Appium::VERSION
5
- DATE = '2014-02-20' unless defined? ::Appium::DATE
4
+ VERSION = '0.19.1' unless defined? ::Appium::VERSION
5
+ DATE = '2014-02-25' unless defined? ::Appium::DATE
6
6
  end
@@ -68,6 +68,9 @@ def load_appium_txt opts
68
68
  'APP_ACTIVITY', 'APP_WAIT_ACTIVITY',
69
69
  'DEVICE'
70
70
 
71
+ # ensure app path is resolved correctly from the context of the .txt file
72
+ ENV['APP_PATH'] = Appium::Driver.absolute_app_path ENV['APP_PATH']
73
+
71
74
  # device is not case sensitive
72
75
  ENV['DEVICE'] = ENV['DEVICE'].strip.downcase if !ENV['DEVICE'].nil?
73
76
  if ! %w(ios android selendroid).include? ENV['DEVICE']
@@ -280,6 +283,10 @@ module Appium
280
283
  # Android app waiting activity
281
284
  @app_wait_activity = opts.fetch :app_wait_activity, ENV['APP_WAIT_ACTIVITY']
282
285
 
286
+ @android_coverage = opts.fetch :android_coverage, ENV['ANDROID_COVERAGE']
287
+ # init to empty hash because it's merged later as an optional desired cap.
288
+ @android_coverage = @android_coverage ? { androidCoverage: @android_coverage} : {}
289
+
283
290
  # Sauce Username
284
291
  @sauce_username = opts.fetch :sauce_username, ENV['SAUCE_USERNAME']
285
292
 
@@ -396,7 +403,7 @@ module Appium
396
403
  :'app-activity' => @app_activity,
397
404
  :'app-wait-activity' => @app_wait_activity || @app_activity,
398
405
  fastClear: @fast_clear
399
- }
406
+ }.merge(@android_coverage)
400
407
  end
401
408
 
402
409
  # @private
@@ -414,28 +421,32 @@ module Appium
414
421
  # @private
415
422
  def capabilities
416
423
  caps = ['iPhone Simulator', 'iPad Simulator'].include?(@device) ? ios_capabilities : android_capabilities
417
- caps[:app] = absolute_app_path unless @app_path.nil? || @app_path.empty?
424
+ caps[:app] = self.class.absolute_app_path(@app_path) unless @app_path.nil? || @app_path.empty?
418
425
  caps
419
426
  end
420
427
 
421
428
  # Converts environment variable APP_PATH to an absolute path.
422
429
  # @return [String] APP_PATH as an absolute path
423
- def absolute_app_path
424
- raise 'APP_PATH not set!' if @app_path.nil? || @app_path.empty?
430
+ def self.absolute_app_path app_path
431
+ raise 'APP_PATH not set!' if app_path.nil? || app_path.empty?
425
432
  # Sauce storage API. http://saucelabs.com/docs/rest#storage
426
- return @app_path if @app_path.start_with? 'sauce-storage:'
427
- return @app_path if @app_path.match(/^http/) # public URL for Sauce
428
- if @app_path.match(/^(\/|[a-zA-Z]:)/) # absolute file path
429
- raise "App doesn't exist. #{@app_path}" unless File.exist? @app_path
430
- return @app_path
433
+ return app_path if app_path.start_with? 'sauce-storage:'
434
+ return app_path if app_path.match(/^http/) # public URL for Sauce
435
+ if app_path.match(/^(\/|[a-zA-Z]:)/) # absolute file path
436
+ app_path = File.expand_path app_path unless File.exist? app_path
437
+ raise "App doesn't exist. #{app_path}" unless File.exist? app_path
438
+ return app_path
431
439
  end
432
440
 
433
441
  # if it doesn't contain a slash then it's a bundle id
434
- return @app_path unless @app_path.match(/[\/\\]/)
435
-
436
- file = File.join(File.dirname(__FILE__), @app_path)
437
- raise "App doesn't exist #{file}" unless File.exist? file
438
- file
442
+ return app_path unless app_path.match(/[\/\\]/)
443
+
444
+ # relative path that must be expanded.
445
+ # absolute_app_path is called from load_appium_txt
446
+ # and the txt file path is the base of the app path in that case.
447
+ app_path = File.expand_path app_path
448
+ raise "App doesn't exist #{app_path}" unless File.exist? app_path
449
+ app_path
439
450
  end
440
451
 
441
452
  # Get the server url for sauce or local based on env vars.
@@ -1,3 +1,19 @@
1
+ #### v0.19.0 2014-02-20
2
+
3
+ - [6fd332b](https://github.com/appium/ruby_lib/commit/6fd332b1715d7b8f4b3b3c99e7ca58e5d4d01b52) Release 0.19.0
4
+ - [69f2058](https://github.com/appium/ruby_lib/commit/69f2058c3dffb60bb5040f920481da5fed571a6a) Merge pull request #119 from misttar/feature/appium_ruby_console_on_windows
5
+ - [55ab536](https://github.com/appium/ruby_lib/commit/55ab536c8dfeafed43797675c82cc4c5d73d8454) Fix to enable appium ruby console (arc) on windows; Removed unnecessary ruby based absolute path conversion in load_appium_txt, as it is done later in Driver::initialize; Simplified absolute_app_path method for resolving windows paths;
6
+ - [f529113](https://github.com/appium/ruby_lib/commit/f529113c3f54c351d668da9695b8a5a7e2377169) Merge pull request #118 from justingrammens/master
7
+ - [297cdfc](https://github.com/appium/ruby_lib/commit/297cdfc8685c1752dbf9f6b2e07a9c4ac3f1ab87) Need to add the missing commas for the Android example in readme for it to work for me.
8
+ - [d55a2f5](https://github.com/appium/ruby_lib/commit/d55a2f5beefb0b6e3068470769da64c8c47551ec) Fix webview
9
+ - [da987f6](https://github.com/appium/ruby_lib/commit/da987f6b11b191ace34ea63764eb121c8ddae42e) Merge pull request #114 from misttar/app_path_on_windows
10
+ - [488236e](https://github.com/appium/ruby_lib/commit/488236e8856e984f7d9285f33d7660d33fbd835d) Adding a small patch to fix loading the app with absolute windows paths;
11
+ - [6e789d5](https://github.com/appium/ruby_lib/commit/6e789d54341979c412c9a6f3b956cf9b777c87ad) Fix tag_name
12
+ - [af4517f](https://github.com/appium/ruby_lib/commit/af4517fa10a060e92c12bd49a93289ece709c0ac) Update MiniTest Expectations link
13
+ - [8810bbe](https://github.com/appium/ruby_lib/commit/8810bbe640546f962325358d9ab763a0dc038057) Update name doc for iOS
14
+ - [f08854a](https://github.com/appium/ruby_lib/commit/f08854a3cb498c12a00bdca8d0a3f9ffedf06bad) Escape single quotes for iOS JS selectors
15
+
16
+
1
17
  #### v0.18.2 2014-01-28
2
18
 
3
19
  - [f7a2e26](https://github.com/appium/ruby_lib/commit/f7a2e26b623404b83b2bbd9065aa7b57ab0fd62d) Release 0.18.2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver