appium_connect 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Android.rb +7 -0
- data/lib/AppiumConnect.rb +46 -37
- data/lib/FileSystemHelpers.rb +26 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a5f9c5a5a5d27ce721efffc2c6fd09bf3634d8
|
4
|
+
data.tar.gz: 29337ccca15d19298f16149a809ba257c5fcde3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1d82dae6cd811883bd9f4e8645f0bde65ff82ee11a3ca4b1b7ba9de236becaff173bc811a2071dd8097d47954994dc53db42e4a779f75ff269c06235333908a
|
7
|
+
data.tar.gz: 377b93bfbe764064b48d52163a76741d0a98235ba2bac5683c27e74b9a3690d9592d8f23cce17dbf66624d660df376899d415f6ed37ed6be228d64bd5e4bc39f
|
data/lib/Android.rb
CHANGED
data/lib/AppiumConnect.rb
CHANGED
@@ -8,29 +8,55 @@ require_relative 'Android'
|
|
8
8
|
require_relative 'Appium'
|
9
9
|
require_relative 'iOS.rb'
|
10
10
|
|
11
|
+
input_array = ARGV
|
12
|
+
if '--restart'.in? input_array
|
13
|
+
|
14
|
+
|
15
|
+
else
|
11
16
|
|
12
|
-
platform = get_platform()
|
13
|
-
if platform == :linux
|
14
|
-
nodeConfigDir = File.expand_path('~/AppiumConnect/')
|
15
|
-
elsif platform == :mac
|
16
|
-
nodeConfigDir = File.expand_path('~/AppiumConnect/')
|
17
|
-
elsif platform == :windows
|
18
|
-
nodeConfigDir = Dir.home() + '/AppiumConnect'
|
19
|
-
end
|
20
17
|
|
21
|
-
create_dir nodeConfigDir
|
22
|
-
create_dir nodeConfigDir + '/node_configs'
|
23
|
-
create_dir nodeConfigDir + '/output'
|
24
18
|
|
25
19
|
|
26
|
-
|
27
|
-
|
20
|
+
platform = get_platform()
|
21
|
+
if platform == :linux
|
22
|
+
nodeConfigDir = File.expand_path('~/AppiumConnect/')
|
23
|
+
elsif platform == :mac
|
24
|
+
nodeConfigDir = File.expand_path('~/AppiumConnect/')
|
25
|
+
elsif platform == :windows
|
26
|
+
nodeConfigDir = Dir.home() + '/AppiumConnect'
|
27
|
+
end
|
28
|
+
|
29
|
+
create_dir nodeConfigDir
|
30
|
+
create_dir nodeConfigDir + '/node_configs'
|
31
|
+
create_dir nodeConfigDir + '/output'
|
28
32
|
|
29
|
-
puts ''
|
30
|
-
puts 'Config file detected. Press enter to use last setting or any other key to edit:'
|
31
|
-
puts "Hub: #{config['hubIp']} Node: #{config['nodeIp']}"
|
32
33
|
|
33
|
-
if
|
34
|
+
if File.exist?(nodeConfigDir + '/config.json')
|
35
|
+
config = JSON.parse(File.read(nodeConfigDir +'/config.json'))
|
36
|
+
|
37
|
+
puts ''
|
38
|
+
puts 'Config file detected. Press enter to use last setting or any other key to edit:'
|
39
|
+
puts "Hub: #{config['hubIp']} Node: #{config['nodeIp']}"
|
40
|
+
|
41
|
+
if gets.chomp() != ''
|
42
|
+
|
43
|
+
puts ''
|
44
|
+
puts 'Please Enter IP address of Hub:'
|
45
|
+
hubIp = gets.chomp()
|
46
|
+
|
47
|
+
puts ''
|
48
|
+
puts ''
|
49
|
+
puts 'Please Enter IP address of Node:'
|
50
|
+
|
51
|
+
ip = gets.chomp()
|
52
|
+
|
53
|
+
config = {hubIp: hubIp, nodeIp: ip}
|
54
|
+
File.open(nodeConfigDir + '/config.json', 'w') do |f|
|
55
|
+
f.write(config.to_json)
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
else
|
34
60
|
|
35
61
|
puts ''
|
36
62
|
puts 'Please Enter IP address of Hub:'
|
@@ -39,33 +65,16 @@ if File.exist?(nodeConfigDir + '/config.json')
|
|
39
65
|
puts ''
|
40
66
|
puts ''
|
41
67
|
puts 'Please Enter IP address of Node:'
|
42
|
-
|
43
68
|
ip = gets.chomp()
|
44
69
|
|
45
70
|
config = {hubIp: hubIp, nodeIp: ip}
|
71
|
+
|
46
72
|
File.open(nodeConfigDir + '/config.json', 'w') do |f|
|
47
73
|
f.write(config.to_json)
|
48
74
|
end
|
49
75
|
|
50
76
|
end
|
51
|
-
else
|
52
|
-
|
53
|
-
puts ''
|
54
|
-
puts 'Please Enter IP address of Hub:'
|
55
|
-
hubIp = gets.chomp()
|
56
|
-
|
57
|
-
puts ''
|
58
|
-
puts ''
|
59
|
-
puts 'Please Enter IP address of Node:'
|
60
|
-
ip = gets.chomp()
|
61
|
-
|
62
|
-
config = {hubIp: hubIp, nodeIp: ip}
|
63
|
-
|
64
|
-
File.open(nodeConfigDir + '/config.json', 'w') do |f|
|
65
|
-
f.write(config.to_json)
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
77
|
|
70
78
|
|
71
|
-
launch_hub_and_nodes config['nodeIp'], config['hubIp'], nodeConfigDir
|
79
|
+
launch_hub_and_nodes config['nodeIp'], config['hubIp'], nodeConfigDir
|
80
|
+
end
|
data/lib/FileSystemHelpers.rb
CHANGED
@@ -12,9 +12,32 @@ end
|
|
12
12
|
def generate_node_config(nodeDir, file_name, udid, appium_port, ip, hubIp, platform, browser)
|
13
13
|
f = File.new(nodeDir + "/node_configs/#{file_name}", "w")
|
14
14
|
|
15
|
-
f.write( JSON.generate({ capabilities: [
|
16
|
-
|
17
|
-
|
15
|
+
f.write( JSON.generate({ capabilities: [
|
16
|
+
{ udid: udid,
|
17
|
+
browserName: udid,
|
18
|
+
maxInstances: 1,
|
19
|
+
platform: platform,
|
20
|
+
deviceName: udid },
|
21
|
+
|
22
|
+
{ browserName: browser,
|
23
|
+
maxInstances: 1,
|
24
|
+
deviceName: udid,
|
25
|
+
udid: udid,
|
26
|
+
seleniumProtocol: 'WebDriver',
|
27
|
+
platform: platform ,
|
28
|
+
applicationName: udid}],
|
29
|
+
|
30
|
+
configuration: { cleanUpCycle: 2000,
|
31
|
+
timeout: 299000,
|
32
|
+
registerCycle: 5000,
|
33
|
+
proxy: "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
|
34
|
+
url: "http://#{ip}:#{appium_port}/wd/hub",
|
35
|
+
host: ip,
|
36
|
+
port: appium_port,
|
37
|
+
maxSession: 1,
|
38
|
+
register: true,
|
39
|
+
hubPort: 4444,
|
40
|
+
hubHost: hubIp } } ) )
|
18
41
|
f.close
|
19
42
|
end
|
20
43
|
|