appium_lib_core 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c286b55d124a69df3ae3ef7316b37a12eea4785f
4
- data.tar.gz: 3b72edaa3f3ecd325e26449189d86210e5cd5b1a
3
+ metadata.gz: 97e009bff9dd6292e1a2628aede232c17410d775
4
+ data.tar.gz: 50c61ce75653198f2a07a1241771ac757b0d2aca
5
5
  SHA512:
6
- metadata.gz: d0b4d51f44dfe347017ffb1c344f8abf0afb4a47c46af3a6023aa0c480c160bfd4bf8a2f80b03aa9cd2f0ed5b950fae9a03bf7933608b125df5499528e8ac999
7
- data.tar.gz: 7a24e9a40a8a2a12b148cd5b2b3b15af70294ae61e5809f909ece54a76975c889a5f36910eb28a9539b89026c95d9ac949579e8af4de947422ef53c8058f51df
6
+ metadata.gz: c542eff950fb4ef3b69c018eb560a2b4aa06b26896f92bccd0f2c0d1f4409b7aba82f9f3f9d3f8abc84a7c0613929996a401bbb862f168c11d4586f3b98defef
7
+ data.tar.gz: ce4db6a5dfb62b3efe19fc639282a84c85acc38f68e9ad956a3407ed8f4a8f5c8704578efe304685a18e830f53d7198b53630be34b09495c9657849dc3091e12
data/CHANGELOG.md CHANGED
@@ -3,12 +3,15 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
  ### Enhancements
6
+ - Print warning messages to use camelCase if capability key names are snake_case
7
+ - For W3C adaption for Appium Server
6
8
 
7
9
  ### Bug fixes
10
+ - make `@driver.automation_name` downcase
8
11
 
9
12
  ### Deprecations
10
13
 
11
- ## [1.2.6]
14
+ ## [1.2.6] - 2018-01-21
12
15
  ### Enhancements
13
16
  - Add `window_rect`
14
17
 
@@ -120,12 +120,15 @@ module Appium
120
120
  w3c_capabilities = ::Selenium::WebDriver::Remote::W3C::Capabilities.new
121
121
 
122
122
  capabilities = capabilities.__send__(:capabilities) unless capabilities.is_a?(Hash)
123
+
124
+ warn_if_camel_case(capabilities)
125
+
123
126
  capabilities.each do |name, value|
124
127
  next if value.nil?
125
128
  next if value.is_a?(String) && value.empty?
126
129
 
127
130
  capability_name = name.to_s
128
- w3c_name = extension_prefix?(capability_name, w3c_capabilities) ? name : "#{APPIUM_PREFIX}#{capability_name}"
131
+ w3c_name = extension_prefix?(capability_name) ? name : "#{APPIUM_PREFIX}#{capability_name}"
129
132
 
130
133
  w3c_capabilities[w3c_name] = value
131
134
  end
@@ -135,9 +138,21 @@ module Appium
135
138
 
136
139
  private
137
140
 
138
- def extension_prefix?(capability_name, w3c_capabilities)
141
+ def warn_if_camel_case(caps)
142
+ warn_caps = caps.collect { |key, _value| key =~ /_([a-z])/ ? key : nil }.compact
143
+ return if warn_caps.empty?
144
+
145
+ warn_message = warn_caps.join(', ')
146
+ ::Appium::Logger.warn("Please define capability key names: #{warn_message} as camelCase for W3C Appium Server")
147
+ end
148
+
149
+ def camel_case(str)
150
+ str.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
151
+ end
152
+
153
+ def extension_prefix?(capability_name)
139
154
  snake_cased_capability_names = ::Selenium::WebDriver::Remote::W3C::Capabilities::KNOWN.map(&:to_s)
140
- camel_cased_capability_names = snake_cased_capability_names.map(&w3c_capabilities.method(:camel_case))
155
+ camel_cased_capability_names = snake_cased_capability_names.map { |v| camel_case(v) }
141
156
 
142
157
  snake_cased_capability_names.include?(capability_name) ||
143
158
  camel_cased_capability_names.include?(capability_name) ||
@@ -459,7 +459,7 @@ module Appium
459
459
  def set_automation_name_if_nil
460
460
  return unless @automation_name.nil?
461
461
  @automation_name = if @driver.capabilities['automationName']
462
- @driver.capabilities['automationName'].intern
462
+ @driver.capabilities['automationName'].downcase.strip.intern
463
463
  end
464
464
  end
465
465
 
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '1.2.6'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2018-01-21'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '1.2.7'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2018-01-25'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
data/release_notes.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### v1.2.7 2018-01-25
2
+
3
+ - [02b3845](https://github.com/appium/ruby_lib_core/commit/02b3845a58afb349f62e5d699cfcccee20810665) Release 1.2.7
4
+ - [45cf118](https://github.com/appium/ruby_lib_core/commit/45cf1188385339b30773e8e333f4a131b7b2364c) Merge branch 'master' of github.com:appium/ruby_lib_core
5
+ - [803cbbb](https://github.com/appium/ruby_lib_core/commit/803cbbb42ccd1cb193d90aa48d4240ada520633f) add downcase strip
6
+ - [31561db](https://github.com/appium/ruby_lib_core/commit/31561db31a07bec2cab36bb847fd8489ac9258ce) insert snake case checking (#56)
7
+ - [9e0f140](https://github.com/appium/ruby_lib_core/commit/9e0f1409d5ebb841b3daaf41345ae8862ad7dacf) add the date
8
+
9
+
1
10
  #### v1.2.6 2018-01-21
2
11
 
3
12
  - [5bca38e](https://github.com/appium/ruby_lib_core/commit/5bca38e9d11c7596f54c81f7b123a0e5dce59040) Release 1.2.6
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-21 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  requirements: []
256
256
  rubyforge_project:
257
- rubygems_version: 2.6.8
257
+ rubygems_version: 2.5.2
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: Minimal Ruby library for Appium.