appium_connect 1.1.1 → 1.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b316d9bb56d7a0565fa57483ba95cd22b69a4d77
4
- data.tar.gz: 2fcc77265659a86929b1445f02f4abe68e75f3d9
3
+ metadata.gz: d2a5f9c5a5a5d27ce721efffc2c6fd09bf3634d8
4
+ data.tar.gz: 29337ccca15d19298f16149a809ba257c5fcde3f
5
5
  SHA512:
6
- metadata.gz: 0f2ff892b7685cf6fc2d1bb00211272383b001b1aca00b15173346fc10cd947258a33dd5dc54b43a02b1697b7ad2c1767c3161a94e9d91e5b62c0fc37a331315
7
- data.tar.gz: 1f0cd78db530ec78bc4aa8faa333bdd6ccdb3f62ed2d8dcdd034da64083bb1a0817ccdf751937b958fc8ec383d2e951e8dc7de138bf7b95ffe9171fd695212ee
6
+ metadata.gz: e1d82dae6cd811883bd9f4e8645f0bde65ff82ee11a3ca4b1b7ba9de236becaff173bc811a2071dd8097d47954994dc53db42e4a779f75ff269c06235333908a
7
+ data.tar.gz: 377b93bfbe764064b48d52163a76741d0a98235ba2bac5683c27e74b9a3690d9592d8f23cce17dbf66624d660df376899d415f6ed37ed6be228d64bd5e4bc39f
data/lib/Android.rb CHANGED
@@ -6,3 +6,10 @@ def get_device_osv udid
6
6
  command = "adb -s #{udid} shell getprop ro.build.version.sdk"
7
7
  `#{command}`
8
8
  end
9
+
10
+ def restart_devices
11
+ get_android_devices
12
+ ENV["DEVICES"].each do |device|
13
+ `adb -s #{device['udid']} reboot}`
14
+ end
15
+ end
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
- if File.exist?(nodeConfigDir + '/config.json')
27
- config = JSON.parse(File.read(nodeConfigDir +'/config.json'))
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 gets.chomp() != ''
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
@@ -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: [{ udid: udid, browserName: udid, maxInstances: 1, platform: platform, deviceName: udid },{ browserName: browser, maxInstances: 1, deviceName: udid, udid: udid, seleniumProtocol: 'WebDriver', platform: platform , applicationName: udid}],
16
- configuration: { cleanUpCycle: 2000, timeout: 180000, registerCycle: 5000, proxy: "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", url: "http://#{ip}:#{appium_port}/wd/hub",
17
- host: ip, port: appium_port, maxSession: 1, register: true, hubPort: 4444, hubHost: hubIp } } ) )
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Watson