parallel_appium 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +3 -1
- data/Gemfile.lock +1 -1
- data/README.md +64 -5
- data/Rakefile +31 -17
- data/build.sh +1 -0
- data/lib/parallel_appium/ios.rb +3 -2
- data/lib/parallel_appium/version.rb +1 -1
- data/lib/parallel_appium.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +2 -3
- metadata.gz.sig +0 -0
- data/apps/.gitignore +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcfc289c2b24a3fb4ee3e8be46e9b9c9a4479754
|
4
|
+
data.tar.gz: 7af36ebcd29622f33fd4dddeccc4b60a40bd1d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6f21359696283cfe95dee022803464eb6e61e0348282ef2545fef2c0a5c31af229f9ad3e76d75dae69c21395cc7a62bb8855a40c79a8ca1e4785386d1379ff
|
7
|
+
data.tar.gz: f06af407504f7304577c1eed08bcf4d536867bad468ed4ef4c05f3c9b57f2b670543c06d902ce102f5984e844eae31ed7981239a8368838b65e92ebba89f58df
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,26 +1,85 @@
|
|
1
1
|
# parallel_appium
|
2
2
|
|
3
|
-
Distributed mobile testing in Appium
|
3
|
+
Single and Distributed Parallel mobile testing in Appium and RSpec fro Android and iOS
|
4
|
+
|
5
|
+
## Quick check
|
6
|
+
|
7
|
+
If you'd like to check if you're good to go for this project simply execute
|
8
|
+
|
9
|
+
```rake parallel_appium:validate_android``` for Android
|
10
|
+
|
11
|
+
```rake parallel_appium:validate_ios``` for iOS
|
12
|
+
|
13
|
+
|
14
|
+
The messages will indicate if there's any component necessary for the platform that's still not set up as yet.
|
15
|
+
|
4
16
|
|
5
17
|
## Installation
|
6
18
|
|
7
19
|
Add this line to your application's Gemfile:
|
8
20
|
|
9
|
-
```
|
21
|
+
```
|
10
22
|
gem 'parallel_appium'
|
11
23
|
```
|
12
24
|
|
13
25
|
And then execute:
|
14
26
|
|
15
|
-
$ bundle
|
27
|
+
$ bundle install
|
16
28
|
|
17
29
|
Or install it yourself as:
|
18
30
|
|
19
31
|
$ gem install parallel_appium
|
20
32
|
|
21
|
-
##
|
33
|
+
## Getting started and ssage
|
34
|
+
|
35
|
+
To get started with this gem there's 3 lines of code you'll need to know to include within your project.
|
36
|
+
These lines handle the following.
|
37
|
+
|
38
|
+
### Starting the servers
|
39
|
+
|
40
|
+
The library at the moment doesn't offer the ability to connect to existing appium processes and instead
|
41
|
+
starts appium servers and the selenium grid server as needed. The following line of code is what you'll need to include
|
42
|
+
for the library to handle this,
|
43
|
+
|
44
|
+
```ParallelAppium::ParallelAppium.new.start platform: platform, file_path: file_path```
|
45
|
+
|
46
|
+
where platform is either android, ios or all and file_path is the absolute path to the folder or spec file
|
47
|
+
to be executed.
|
48
|
+
|
49
|
+
### Initializing the appium instance(s)
|
50
|
+
|
51
|
+
As expected each appium instance will need to be loaded with capabilities defining all kinds of important things
|
52
|
+
about how the tests executing on that instance will work, hence this will need to be done before the tests begin
|
53
|
+
it's best to put this in some form of 'before all' block that will execute it prior to all the tests executing.
|
54
|
+
|
55
|
+
The following line of code is an example of what you'll need to use
|
56
|
+
|
57
|
+
```ParallelAppium::ParallelAppium.new.initialize_appium platform: ENV['platform']```
|
58
|
+
|
59
|
+
The initialize_appium function can take two parameters
|
60
|
+
|
61
|
+
1. platform - If provided it will look for a appium-{platform}.txt file in the root of the project and load capabilities
|
62
|
+
from that location.
|
63
|
+
2. caps - The capabilities as a map to be loaded.
|
64
|
+
|
65
|
+
### Setting UDID for the test
|
66
|
+
|
67
|
+
When distributing tests across multiple devices the library spreads the specs across multiple threads and depends on the
|
68
|
+
UDID environment variable to know which device it's working with for the specific test file, as such this will need to
|
69
|
+
be setup in each test file, simply include the following line of code at the top of the test file after any dependencies
|
70
|
+
and the library will set this up as needed,
|
71
|
+
|
72
|
+
```ParallelAppium::Server.new.set_udid_environment_variable```
|
73
|
+
|
74
|
+
This is all you need to get started with this library. There's a number of environment variables set by the library
|
75
|
+
for the purpose of writing easier cross platform tests. These are described in more detail below.
|
76
|
+
|
77
|
+
### Environment variables
|
78
|
+
|
79
|
+
|
80
|
+
### Tags
|
81
|
+
|
22
82
|
|
23
|
-
TODO: Write usage instructions here
|
24
83
|
|
25
84
|
## Development
|
26
85
|
|
data/Rakefile
CHANGED
@@ -5,24 +5,38 @@ RSpec::Core::RakeTask.new(:spec)
|
|
5
5
|
|
6
6
|
task default: :spec
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
desc 'Validate Android'
|
11
|
-
task :validate_android do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
# TODO: Move checks into gem
|
9
|
+
namespace :parallel_appium do
|
10
|
+
desc 'Validate Android'
|
11
|
+
task :validate_android do
|
12
|
+
%x(which emulator 2>&1)
|
13
|
+
puts '==========================================='
|
14
|
+
can_do_android = true
|
15
|
+
can_do_android = can_do_android && ($? == 0)
|
16
|
+
if can_do_android
|
17
|
+
puts "emulator command configured properly"
|
18
|
+
else
|
19
|
+
puts "emulator command not configured properly"
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
puts '==========================================='
|
23
|
+
puts 'Android good to go'
|
17
24
|
end
|
18
|
-
end
|
19
25
|
|
20
|
-
desc 'Validate iOS'
|
21
|
-
task :validate_ios do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
desc 'Validate iOS'
|
27
|
+
task :validate_ios do
|
28
|
+
%x(which instruments 2>&1)
|
29
|
+
puts '==========================================='
|
30
|
+
can_do_ios = true
|
31
|
+
can_do_ios = can_do_ios && ($? == 0)
|
32
|
+
if can_do_ios
|
33
|
+
puts "instruments command configured properly"
|
34
|
+
else
|
35
|
+
puts "instruments command not configured properly"
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
|
39
|
+
puts '==========================================='
|
40
|
+
puts 'iOS good to go'
|
27
41
|
end
|
28
42
|
end
|
data/build.sh
CHANGED
data/lib/parallel_appium/ios.rb
CHANGED
@@ -9,11 +9,11 @@ module ParallelAppium
|
|
9
9
|
|
10
10
|
# Filter simulator data
|
11
11
|
def simulator_information
|
12
|
-
re = /\([0-9]+\.[0-9]
|
12
|
+
re = /\([0-9]+\.[0-9](\.[0-9])?\) \[[0-9A-Z-]+\]/m
|
13
13
|
|
14
14
|
# Filter out simulator info for iPhone platform version and udid
|
15
15
|
@simulators.select { |simulator_data| simulator_data.include?('iPhone') && !simulator_data.include?('Apple Watch') }
|
16
|
-
.map { |simulator_data| simulator_data.
|
16
|
+
.map { |simulator_data| simulator_data.match(re).to_s.tr('()[]', '').split }[0, ENV['THREADS'].to_i]
|
17
17
|
end
|
18
18
|
|
19
19
|
# Devices after cleanup and supplemental data included
|
@@ -28,3 +28,4 @@ module ParallelAppium
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
data/lib/parallel_appium.rb
CHANGED
@@ -93,9 +93,9 @@ module ParallelAppium
|
|
93
93
|
# @param [boolean] parallel
|
94
94
|
def execute_specs(platform, threads, spec_path, parallel = false)
|
95
95
|
command = if parallel
|
96
|
-
"platform=#{platform} parallel_rspec -n #{threads} #{spec_path}
|
96
|
+
"platform=#{platform} parallel_rspec -n #{threads} #{spec_path} --out output/#{platform}.log"
|
97
97
|
else
|
98
|
-
"platform=#{platform} rspec #{spec_path} --tag #{platform}
|
98
|
+
"platform=#{platform} rspec #{spec_path} --tag #{platform} --out output/#{platform}.log"
|
99
99
|
end
|
100
100
|
|
101
101
|
puts "Executing #{command}"
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_appium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javon Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
pjBkMT4ow4ZhVgBKPDT2jh74b8g2rIDSbkJIj0lf35WXqJqZzseabGPpTbtzJEap
|
37
37
|
HIrd7mPILLe3
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2018-07-
|
39
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appium_lib
|
@@ -159,7 +159,6 @@ files:
|
|
159
159
|
- LICENSE
|
160
160
|
- README.md
|
161
161
|
- Rakefile
|
162
|
-
- apps/.gitignore
|
163
162
|
- bin/console
|
164
163
|
- bin/setup
|
165
164
|
- build.sh
|
metadata.gz.sig
CHANGED
Binary file
|
data/apps/.gitignore
DELETED