parallel_calabash 0.0.4 → 0.0.5

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: e12a0efd9b281f2bbe7c74af79a2a8e7a2bd9c59
4
- data.tar.gz: a437a645b653017572a96b95308aef696b11f1ca
3
+ metadata.gz: bbfcdf254dae2ce04a16ac134e29380063893b60
4
+ data.tar.gz: cba4c0855b92d9c3edb2b95a108ee69a8bb0faaa
5
5
  SHA512:
6
- metadata.gz: 70c0107dd2be2f79a138b99f4fc58465d5d1626ca854212e1402ef38e3589030b26dee25a16a8d77c0181c6505567b118cb021e739d53ce12efdcfa42e303221
7
- data.tar.gz: da3bbb993ff63c6ea6b2bf3475965e319cf4eb9e76a105c6391f615e387ce6759872d8bce1dbdda866a3ff186b1d70f8221f7a74a2df1022fe319f1df3ffe664
6
+ metadata.gz: e76605cc0a097f870b93966deefacfa52809047c09e3a07462a9da11a2baf4ab0ef69edaf802dad26bc48774daebc763ec7042934d2373b8a218ee50e18b5af3
7
+ data.tar.gz: d5065c95805a678c532d008c72cb37c169dc447113c8348b254b8eae948d4f493c551174301205cff9df958289f212282412cdf82f116007c8ed73b98fe2b43a
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # calabash parallel execution
2
2
 
3
+ # Now Supported on Windows
4
+
3
5
  ## Watch a quick demo here:
4
6
 
5
7
  https://www.youtube.com/watch?v=sK3s0txeJvc
@@ -43,11 +45,13 @@ Example: parallel_calabash -a my.apk -o 'cucumber_opts_like_tags_profile_etc_her
43
45
 
44
46
  ## REPROTING
45
47
 
46
- use ENV['TEST_PROCESS_NUMBER'] environment variable in your ruby scripts to find out the process number. you can use this for reporting purpose.
48
+ use ENV['TEST_PROCESS_NUMBER'] environment variable in your ruby scripts to find out the process number. you can use this for reporting purpose OR process specific action.
49
+
50
+ To get device model info, use ENV['DEVICE_INFO'] env variable.
47
51
 
48
52
  eg. modify default profile in cucumber.yml as below to get different report from different process
49
53
 
50
- default: --format html --out reports/Automation_report_<%= ENV['TEST_PROCESS_NUMBER'] %>.html --format pretty
54
+ default: --format html --out reports/Report_<%=ENV['DEVICE_INFO']%>_<%= ENV['TEST_PROCESS_NUMBER']%>.html --format pretty
51
55
 
52
56
  ## Contributing
53
57
 
@@ -2,20 +2,26 @@ module ParallelCalabash
2
2
  module AdbHelper
3
3
  class << self
4
4
 
5
- def connected_devices
5
+ def device_for_process process_num
6
+ connected_devices_with_model_info[process_num]
7
+ end
8
+
9
+ def number_of_connected_devices
10
+ connected_devices_with_model_info.size
11
+ end
12
+
13
+ def connected_devices_with_model_info
6
14
  begin
7
- `adb devices`.scan(/\n(.*)\t/).flatten
15
+ `adb devices -l`.split("\n").collect{|line| device_id_and_model(line)}.compact
8
16
  rescue
9
17
  []
10
18
  end
11
19
  end
12
20
 
13
- def device_for_process process_num
14
- connected_devices[process_num]
15
- end
16
-
17
- def number_of_connected_devices
18
- connected_devices.size
21
+ def device_id_and_model line
22
+ if line.include?("device ")
23
+ [line.split(" ").first,line.scan(/model:(.*) device/).flatten.first]
24
+ end
19
25
  end
20
26
 
21
27
  end
@@ -25,8 +25,8 @@ module ParallelCalabash
25
25
 
26
26
  def command_for_process process_number, cmd
27
27
  env = {}
28
- device_for_current_process = ParallelCalabash::AdbHelper.device_for_process process_number
29
- env = env.merge({'AUTOTEST' => '1', 'ADB_DEVICE_ARG' => device_for_current_process, "TEST_PROCESS_NUMBER" => (process_number+1).to_s})
28
+ device_id, device_info = ParallelCalabash::AdbHelper.device_for_process process_number
29
+ env = env.merge({'AUTOTEST' => '1', 'ADB_DEVICE_ARG' => device_id, 'DEVICE_INFO' => device_info, "TEST_PROCESS_NUMBER" => (process_number+1).to_s})
30
30
  separator = (WINDOWS ? ' & ' : ';')
31
31
  exports = env.map { |k, v| WINDOWS ? "(SET \"#{k}=#{v}\")" : "#{k}=#{v};export #{k}" }.join(separator)
32
32
  exports + separator + cmd
@@ -1,3 +1,3 @@
1
1
  module ParallelCalabash
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,9 +4,9 @@ require 'parallel_calabash'
4
4
  describe ParallelCalabash::Runner do
5
5
  describe :command_for_process do
6
6
  it 'should return command with env variables' do
7
- ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(0).and_return("5555")
7
+ ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(0).and_return(["4d00fa3cb814c03f", "GT_N7100"])
8
8
  expect(ParallelCalabash::Runner.command_for_process(0, 'base_command')).to eq \
9
- "AUTOTEST=1;export AUTOTEST ADB_DEVICE_ARG=5555;export ADB_DEVICE_ARG TEST_PROCESS_NUMBER=1;export TEST_PROCESS_NUMBER;base_command"
9
+ "AUTOTEST=1;export AUTOTEST;ADB_DEVICE_ARG=4d00fa3cb814c03f;export ADB_DEVICE_ARG;DEVICE_INFO=GT_N7100;export DEVICE_INFO;TEST_PROCESS_NUMBER=1;export TEST_PROCESS_NUMBER;base_command"
10
10
  end
11
11
  end
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_calabash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajdeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-01 00:00:00.000000000 Z
11
+ date: 2015-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler