parallel_calabash 0.2.3 → 0.2.4

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: cd0310f0eceb97f606c062f75d86fe31a34e2ef8
4
- data.tar.gz: d2d5e1269d34ebb3888dc97da4ec38d3b6c9b107
3
+ metadata.gz: e879ca3647451388fb5429149327e3a78b2ea8b3
4
+ data.tar.gz: 84378d216b1ad7eac7bca413e54b0230612005a2
5
5
  SHA512:
6
- metadata.gz: 5f597394492d9a43b51271e7137711a18f067af855fa2577c9c99002e362d943e870909e8f83dd244410467c52b05236dd459b119e530bc7a96501dd322ccf78
7
- data.tar.gz: a303594e563948734facfbccbe86a423706d8e38516124ab5c3ce273db8bef29d39de2ec835b4859cd403f4c80e0bc7f778c3167a322b5c88b9bbf40d8c53e4a
6
+ metadata.gz: cbbe67b571e6eab5bee71e7efb4227ca090667d9b345199df947a7547de8a8cc96f9a23fe93ea3ec299e10ce2e4813ec05c4093099a4ae00c952c00e91ecdb83
7
+ data.tar.gz: 5a35b7b92c7efcdb0a620f0263b60feffec4f13083f00f47f22654e74b3bbc4c7a1b09616d3b5019b4c69e9a69e6ab2126bdd16575c0293c06fba6ff6a9eb980
data/README.md CHANGED
@@ -7,8 +7,8 @@ https://www.youtube.com/watch?v=sK3s0txeJvc
7
7
 
8
8
  Run calabash-android or calabash-ios tests in parallel on multiple connected devices. This is inspired by parallel_tests https://rubygems.org/gems/parallel_tests
9
9
 
10
- eg. bundle exec parallel_calabash --apk my.apk -o'--format pretty' features/ --serialize-stdout
11
- eg. bundle exec parallel_calabash --app my.app -o'--format pretty' features/ --serialize-stdout
10
+ eg. Android: bundle exec parallel_calabash --apk my.apk -o'--format pretty' features/ --serialize-stdout
11
+ eg. iOS: bundle exec parallel_calabash --app my.app -o'--format pretty' features/ --serialize-stdout
12
12
 
13
13
  ## Installation
14
14
 
@@ -18,19 +18,27 @@ module ParallelCalabash
18
18
  @filter = filter
19
19
  end
20
20
 
21
+ def adb_devices_l
22
+ `adb devices -l`
23
+ end
24
+
21
25
  def connected_devices_with_model_info
22
26
  begin
23
27
  list =
24
- `adb devices -l`.split("\n").collect do |line|
28
+ adb_devices_l.split("\n").collect do |line|
25
29
  device = device_id_and_model(line)
26
30
  filter_device(device)
27
31
  end
28
- list.compact
32
+ list.compact.each { |device_data| device_data << screenshot_prefix(device_data.first) }
29
33
  rescue
30
34
  []
31
35
  end
32
36
  end
33
37
 
38
+ def screenshot_prefix device_id
39
+ device_id.gsub('.', '_').gsub(/:(.*)/, '').to_s + '_'
40
+ end
41
+
34
42
  def device_id_and_model line
35
43
  if line.match(/device(?!s)/)
36
44
  [line.split(" ").first, line.scan(/model:(.*) device/).flatten.first]
@@ -60,13 +60,13 @@ module ParallelCalabash
60
60
 
61
61
  def command_for_test(process_number, base_command, apk_path, cucumber_options, test_files)
62
62
  cmd = [base_command, apk_path, cucumber_options, *test_files].compact*' '
63
- device_id, device_info = @device_helper.device_for_process process_number
63
+ device_id, device_info, screenshot_prefix = @device_helper.device_for_process process_number
64
64
  env = {
65
65
  AUTOTEST: '1',
66
66
  ADB_DEVICE_ARG: device_id,
67
67
  DEVICE_INFO: device_info,
68
68
  TEST_PROCESS_NUMBER: (process_number+1).to_s,
69
- SCREENSHOT_PATH: device_id.to_s + '_'
69
+ SCREENSHOT_PATH: screenshot_prefix
70
70
  }
71
71
  separator = (WINDOWS ? ' & ' : ';')
72
72
  exports = env.map { |k, v| WINDOWS ? "(SET \"#{k}=#{v}\")" : "#{k}=#{v};export #{k}" }.join(separator)
@@ -1,3 +1,3 @@
1
1
  module ParallelCalabash
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Rajdeep"]
10
10
  spec.email = ["mail.rajvarma@gmail.com"]
11
11
  spec.summary = %q{calabash android tests in parallel}
12
- spec.description = %q{Run different calabash android tests in parallel on different devices}
12
+ spec.description = %q{Run different calabash android and iOS tests in parallel on different devices and simulators}
13
13
  spec.homepage = "https://github.com/rajdeepv/parallel_calabash"
14
14
  spec.license = "MIT"
15
15
 
@@ -50,6 +50,18 @@ describe ParallelCalabash::AdbHelper do
50
50
  end
51
51
  end
52
52
 
53
+ describe :connected_devices_with_model_info do
54
+
55
+ it 'should return device_id, device_name and screenshot_prefix details' do
56
+ adb_helper = ParallelCalabash::AdbHelper.new([])
57
+ def adb_helper.adb_devices_l
58
+ "List of devices attached \n192.168.57.101:5555 device product:vbox86p model:device2 device:vbox86p\n192.168.57.102:5555 device product:vbox86p model:device3 device:vbox86p\n\n"
59
+ end
60
+ expect(adb_helper.connected_devices_with_model_info).to eq [["192.168.57.101:5555", "device2", "192_168_57_101_"], ["192.168.57.102:5555", "device3", "192_168_57_102_"]]
61
+ end
62
+
63
+ end
64
+
53
65
  end
54
66
 
55
67
  describe ParallelCalabash::IosHelper do
@@ -6,7 +6,7 @@ describe ParallelCalabash::Runner do
6
6
  describe :command_for_process do
7
7
  it 'should return command with env variables' do
8
8
  adb_helper = MiniTest::Mock.new
9
- adb_helper.expect(:device_for_process, ["4d00fa3cb814c03f", "GT_N7100"], [0])
9
+ adb_helper.expect(:device_for_process, ["4d00fa3cb814c03f", "GT_N7100", "4d00fa3cb814c03f_"], [0])
10
10
  expect(ParallelCalabash::AndroidRunner.new(adb_helper, true)
11
11
  .command_for_test(0, 'base_command', 'some.apk', '-some -options', %w(file1 file2)))
12
12
  .to eq 'AUTOTEST=1;export AUTOTEST;ADB_DEVICE_ARG=4d00fa3cb814c03f;export ADB_DEVICE_ARG;'\
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajdeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,8 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Run different calabash android tests in parallel on different devices
55
+ description: Run different calabash android and iOS tests in parallel on different
56
+ devices and simulators
56
57
  email:
57
58
  - mail.rajvarma@gmail.com
58
59
  executables: