yi_appium_caps_util 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/yi_appium_caps_util +16 -6
- data/lib/yi_appium_caps_util.rb +37 -12
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c28bbcfc62227846b11eee48b0590ed94ba29b
|
4
|
+
data.tar.gz: 71fe978783b00f7d6b55499b97825346c3fb3647
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f38e1bfad5f45aa6f6505098a3e135745bdcfbdb3b5fd7a477eba1c39982a5ad946d84c09b58769d198ef53b1fb997a42e1251c458dac050935e01d551ecab9
|
7
|
+
data.tar.gz: 6b3dfd61bc0a2f86bec5e75ed0a10073db45504e0135b5969b596265cb5b165facce11e4e539fd8da146f5388662ca1d7602b5084f54efa918f37b02bf373ed6
|
data/bin/yi_appium_caps_util
CHANGED
@@ -11,23 +11,29 @@ OptionParser.new do |opts|
|
|
11
11
|
opts.banner = "You.i Utility for appium.txt capabilities"
|
12
12
|
puts opts.banner
|
13
13
|
|
14
|
-
opts.on("-u", "--update [PLATFORM]", "update device ID and IP address") do |p|
|
15
|
-
options[:update] = true
|
16
|
-
options[:platform] = p
|
17
|
-
end
|
18
14
|
opts.on("-cPLATFORM", "--create PLATFORM", "creates the appium.txt file for specified platform") do |c|
|
19
15
|
options[:create_caps] = c
|
20
16
|
end
|
21
17
|
opts.on("-fFILE", "--file FILE", "capabilities path and file name (default: ./appium.txt)") do |f|
|
22
18
|
options[:file] = f
|
23
19
|
end
|
20
|
+
opts.on("-u", "--update [PLATFORM]", "update device ID and IP address") do |p|
|
21
|
+
options[:update] = true
|
22
|
+
options[:platform] = p
|
23
|
+
end
|
24
|
+
opts.on("-xFORMFACTOR", "--formfactor FORMFACTOR", "update the form factor") do |x|
|
25
|
+
options[:form_factor] = x
|
26
|
+
end
|
24
27
|
opts.on("-h", "--help", "Prints this help") do
|
25
28
|
puts opts
|
26
29
|
exit
|
27
30
|
end
|
28
31
|
end.parse!
|
29
32
|
|
30
|
-
|
33
|
+
if options[:update] == nil and options[:create_caps] == nil
|
34
|
+
puts "You should pass -u or -c PLATFORM as an input argument. Type -h for help"
|
35
|
+
exit
|
36
|
+
end
|
31
37
|
|
32
38
|
if options[:update]
|
33
39
|
if options[:file] && options[:platform]
|
@@ -42,5 +48,9 @@ if options[:update]
|
|
42
48
|
end
|
43
49
|
|
44
50
|
if options[:create_caps]
|
45
|
-
|
51
|
+
if options[:create_caps] && options[:form_factor]
|
52
|
+
YiAppiumCapsUtil.create(options[:create_caps].downcase, options[:form_factor].downcase)
|
53
|
+
elsif options[:create_caps]
|
54
|
+
YiAppiumCapsUtil.create(options[:create_caps].downcase, "handheld")
|
55
|
+
end
|
46
56
|
end
|
data/lib/yi_appium_caps_util.rb
CHANGED
@@ -24,12 +24,27 @@ class YiAppiumCapsUtil
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def create (platform_name)
|
27
|
+
def create (platform_name, form_factor)
|
28
|
+
form_factors = ["handheld", "tablet", "10foot"]
|
29
|
+
|
30
|
+
found = false
|
31
|
+
form_factors.each do |i|
|
32
|
+
if i == form_factor
|
33
|
+
found = true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
if found == false
|
38
|
+
puts "ERROR: formFactor: '#{form_factor}' is not supported (#{form_factors})"
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
28
42
|
template = {"caps"=>{"app"=>"",
|
29
43
|
"automationName"=>"YouiEngine",
|
30
44
|
"deviceName"=>"DeviceName",
|
31
45
|
"platformName"=>"#{platform_name}",
|
32
|
-
"youiEngineAppAddress"=>""}
|
46
|
+
"youiEngineAppAddress"=>""},
|
47
|
+
"parameters"=>{"formFactor"=>"#{form_factor}"}}
|
33
48
|
|
34
49
|
File.open("./appium.txt","w") do |f|
|
35
50
|
f.puts(TOML::Generator.new(template).body)
|
@@ -77,8 +92,13 @@ class YiAppiumCapsUtil
|
|
77
92
|
update_android_caps (output_data)
|
78
93
|
when 'ios'
|
79
94
|
update_ios_caps (output_data)
|
95
|
+
when 'mac'
|
96
|
+
update_mac_caps (output_data)
|
97
|
+
when 'yimac'
|
98
|
+
update_mac_caps (output_data)
|
80
99
|
else
|
81
|
-
|
100
|
+
puts "ERROR: platformName '#{platformName_value}' is not supported"
|
101
|
+
exit
|
82
102
|
end
|
83
103
|
return output_data
|
84
104
|
end
|
@@ -102,12 +122,10 @@ class YiAppiumCapsUtil
|
|
102
122
|
#Replace value of youiEngineAppAddress
|
103
123
|
output_data['caps']['youiEngineAppAddress'] = new_address[0]
|
104
124
|
puts 'IP address: ' + new_address[0]
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
puts "An error of type #{ex.class} happened, message is #{ex.message}"
|
110
|
-
raise
|
125
|
+
#Add fullReset to have app reinstalled between runs
|
126
|
+
output_data['caps']['fullReset'] = true
|
127
|
+
rescue Exception, RuntimeError => ex
|
128
|
+
raise "An error of type #{ex.class} happened, message is #{ex.message}"
|
111
129
|
end
|
112
130
|
|
113
131
|
def update_ios_caps (output_data)
|
@@ -181,11 +199,18 @@ class YiAppiumCapsUtil
|
|
181
199
|
elsif (xcodeBuildVersion.to_f>8) then
|
182
200
|
puts "Change to xcode version to xcode 7! Current version is: "+xcodeBuildVersion
|
183
201
|
end
|
202
|
+
end
|
203
|
+
rescue Exception, RuntimeError => ex
|
204
|
+
raise "An error of type #{ex.class} happened, message is #{ex.message}"
|
184
205
|
end
|
185
206
|
|
186
|
-
|
187
|
-
|
188
|
-
|
207
|
+
def update_mac_caps (output_data)
|
208
|
+
#Replace value of deviceName
|
209
|
+
output_data['caps']['deviceName'] = "macOS device"
|
210
|
+
#Replace value of youiEngineAppAddress
|
211
|
+
output_data['caps']['youiEngineAppAddress'] = "localhost"
|
212
|
+
rescue Exception, RuntimeError => ex
|
213
|
+
raise "An error of type #{ex.class} happened, message is #{ex.message}"
|
189
214
|
end
|
190
215
|
|
191
216
|
def write_caps(caps_file_name, output_data)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yi_appium_caps_util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Granger
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ipaddress
|
@@ -32,16 +32,16 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.2.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
43
|
-
description: This utility updates the caps for iOS and
|
44
|
-
to homepage for ruther details on usage
|
42
|
+
version: 0.2.0
|
43
|
+
description: This utility updates the caps for iOS, Android and macOS devices. Please
|
44
|
+
refer to homepage for ruther details on usage
|
45
45
|
email: simon.granger@youi.tv
|
46
46
|
executables:
|
47
47
|
- yi_appium_caps_util
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.6.13
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Updates your appium.txt capabilities for iOS and Android
|