kraken-mobile 1.0.3 → 1.0.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
  SHA256:
3
- metadata.gz: 5aaa19353d8bb3a3a76fc6b30281e9662f335c35aec94c2ac04b7648504b6220
4
- data.tar.gz: 3b8671fa49837132d30981c9d364f097f41b9e11bf1883f3be02f1aad77cd261
3
+ metadata.gz: a48ddcdc40dc988342ab4cd94ffa1e34abb22a93587c9c6f2f8ef31e6e85a757
4
+ data.tar.gz: c5a11c855e05688d304f3e2c79b2a95c928fd92cfedf035c8891b0d1c746ab6f
5
5
  SHA512:
6
- metadata.gz: 5d06280cfa3053359b85f224650443141608c4a2f916599bd037e2175b47028ea7b40b0e9680b9d4fba115a85c3ef0a70057709fbc9b621924283d61497bb4ff
7
- data.tar.gz: ded4ee246bc31de44feba0699f5d72c6a7e7e56e441bc9f2bc90e04d5763b519c4b584382ae43d6229e6cedef894fde94f940f3693bb1e16b73d12c55715ae0a
6
+ metadata.gz: d86f8f4bb10ebcd523afbfbd567922159596ec67765d2ed17b6b55203013ac88e680c123b4bab68561aca682cedd1c634eee75088aa114d1b077a1b153c0bef5
7
+ data.tar.gz: d8e5fb18604ab6778b1c79d0eab28686196b4eb4b86311a3d0682ebb6ab62d3c833d9be964d1ccf4c631cf762c99ac7b108dd74f1d6b0e4053d104c6db63fb31
data/README.md CHANGED
@@ -1,128 +1,139 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/ravelinx22/KrakenMobile/master/reporter/assets/images/kraken.png" alt="kraken logo" width="140" height="193">
3
- </p>
2
+ <img src="./reporter/assets/images/kraken.png" alt="kraken logo" width="140" height="193">
4
3
 
5
- <h3 align="center">Kraken Mobile</h3>
6
4
 
7
- <p align="center">Kraken is an open source automated android E2E testing tool that supports and validates scenarios that involve the inter-communication between two or more users. It works in a Black Box manner meaning that it’s not required to have access to the source code of the application but instead it can be run with the APK (Android package file format). Kraken uses signaling for coordinating the communication between the devices using a file based protocol.</p>
5
+ <h1 align="center">Kraken Mobile</h1>
8
6
 
9
- ## Table of contents
7
+ Kraken is an open source automated android E2E testing tool that supports and validates scenarios that involve the inter-communication between two or more users. It works in a Black Box manner meaning that it is not required to have access to the source code of the application but instead it can be run with the APK (Android package file format). Kraken uses signaling for coordinating the communication between the devices using a file based protocol.
10
8
 
11
- - [Technologies](#technologies)
12
- - [Installation](#installation)
13
- - [Signaling](#signaling)
14
- - [Writing your first test](#writing-your-first-test)
15
- - [Kraken steps](#kraken-steps)
16
- - [Running your tests](#running-your-tests)
17
- - [Kraken Settings](#kraken-settings)
18
- - [Properties file](#properties-file)
9
+ **Kraken is partially supported by a Google Latin America Research Award (LARA) 2018**
19
10
 
20
- ## Technologies
11
+ # Video
12
+ [![krakenThumbnail](./reporter/assets/images/krakenThumbnail.jpg)](https://www.youtube.com/watch?v=hv5gFIpW3gM&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=1)
21
13
 
22
- Kraken uses [calabash-android](https://github.com/calabash/calabash-android) for running automated E2E tests in each device or emulator and [cucumber](https://github.com/cucumber/cucumber-ruby) for running your feature files written with Gherkin sintax.
14
+ # Publications
23
15
 
24
- ## Installation
16
+ - _"Kraken-Mobile: Cross-Device Interaction-based Testing of Android Apps"_, [William Ravelo-Méndez](https://ravelinx22.github.io/), [Camilo Escobar-Velásquez](https://caev03.github.io), and [Mario Linares-Vásquez](https://profesores.virtual.uniandes.edu.co/mlinaresv/en/inicio-en/), _Proceedings of the 35th IEEE International Conference on Software Maintenance and Evolution ([ICSME'19](https://icsme2019.github.io/))_, Tool Demo Track, Cleveland, OH, USA, September 30th - October 4th, 2019, to appear 4 pages (52% Acceptance Rate) [[pdf](https://thesoftwaredesignlab.github.io/KrakenMobile/assets/pdfs/icsme19.pdf)][[bibtex](https://thesoftwaredesignlab.github.io/KrakenMobile/assets/pdfs/icsme19.bib)]
25
17
 
26
- ### Prerequisites
18
+ # Technologies
19
+
20
+ Kraken uses [calabash-android](https://github.com/calabash/calabash-android) for running automated E2E tests in each device or emulator and [cucumber](https://github.com/cucumber/cucumber-ruby) for running your feature files written with Gherkin sintax.
27
21
 
28
- Kraken requires Ruby 2.20 or higher but we recommend using ~2.3 version. We use calabash-android as runner, you can check their prerequisites at this [link](https://github.com/calabash/calabash-android/blob/master/documentation/installation.md)
29
22
 
23
+ # Installation
30
24
 
31
- Installing and managing a Gem is done through the gem command. To install Kraken's gem run the following command
25
+ ### Prerequisites
32
26
 
33
- $ gem install kraken-mobile
27
+ Kraken requires Ruby 2.20 or higher but we recommend using ~2.3 version. We use calabash-android as runner, you can check their prerequisites at this [link](https://github.com/calabash/calabash-android/blob/master/documentation/installation.md). Installing and managing a Gem is done through the gem command. To install Kraken's gem run the following command.
34
28
 
29
+ ```shell
30
+ $ gem install kraken-mobile
31
+ ```
35
32
 
36
- ## Signaling
33
+ # Signaling
37
34
 
38
- Signaling is a protocol used for the communication of two or more devices running in parallel. It’s based in the idea that each emulator or real device has a communication channel where he can receive signals sent from other devices which contain information or actions that are supposed to be executed. This type of protocol is commonly used in automated mobile E2E testing tools that validate scenarios involving the inter-communication and collaboration of two or more applications.
35
+ Signaling is a protocol used for the communication of two or more devices running in parallel. It is based in the idea that each emulator or real device has a communication channel where he can receive signals sent from other devices which contain information or actions that are supposed to be executed. This type of protocol is commonly used in automated mobile E2E testing tools that validate scenarios involving the inter-communication and collaboration of two or more applications.
39
36
 
40
- ## Writing your first test
37
+ # Writing your first test
41
38
 
42
39
  ### Generate cucumber feature skeleton
43
40
 
44
41
  First you need to generate the cucumber feature skeleton where your tests are going to be saved. To achieve this you should run `kraken-mobile gen`. It will create the skeleton in your current folder like this:
45
42
 
46
- features
47
- |_support
48
- | |_app_installation_hooks.rb
49
- | |_app_life_cycle_hooks.rb
50
- | |_env.rb
51
- |_step_definitions
52
- | |_kraken_steps.rb
53
- |_my_first.feature
43
+ ```
44
+ features
45
+ |_support
46
+ | |_app_installation_hooks.rb
47
+ | |_app_life_cycle_hooks.rb
48
+ | |_env.rb
49
+ |_step_definitions
50
+ | |_kraken_steps.rb
51
+ |_my_first.feature
52
+ ```
54
53
 
55
54
  ### Write a test
56
55
 
57
- The features goes in the features foler and should have the ".feature" extension.
58
-
59
- You can start out by looking at features/my_first.feature. You should also check calabash [predefined steps](https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/canned_steps.md).
56
+ The features goes in the features foler and should have the ".feature" extension. You can start out by looking at `features/my_first.feature`. You should also check calabash [predefined steps](https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/canned_steps.md).
60
57
 
61
58
  ### Syntax
62
59
 
63
- In Kraken each feature is a test and each scenario within a feature is a test case that is run in a device. Each device is identified as an user and numbered from 1 to N. Ex: @user1, @user2, @user3. To check what is the number of a given device you should run `kraken-mobile devices`
60
+ In Kraken each feature is a test and each scenario within a feature is a test case that is run in a device. Each device is identified as an user and numbered from 1 to N. Ex: @user1, @user2, @user3. To check what is the number of a given device you should run `kraken-mobile devices`.
64
61
 
65
- List of devices attached
66
- user1 - emulator-5554 - Android_SDK_built_for_x86
67
- user2 - emulator-5556 - Android_SDK_built_for_x86
62
+ ```shell
63
+ List of devices attached
64
+ user1 - emulator-5554 - Android_SDK_built_for_x86
65
+ user2 - emulator-5556 - Android_SDK_built_for_x86
66
+ ```
68
67
 
69
68
  After identifying what number each device has, you can write your test case giving each scenario the tag of a given device like so:
70
69
 
71
- Feature: Example feature
72
-
73
- @user1
74
- Scenario: As a first user I say hi to a second user
75
- Given I wait
76
- Then I send a signal to user 2 containing "hi"
70
+ ```Gherkin
71
+ Feature: Example feature
72
+
73
+ @user1
74
+ Scenario: As a first user I say hi to a second user
75
+ Given I wait
76
+ Then I send a signal to user 2 containing "hi"
77
77
 
78
- @user2
79
- Scenario: As a second user I wait for user 1 to say hi
80
- Given I wait for a signal containing "hi"
81
- Then I wait
78
+ @user2
79
+ Scenario: As a second user I wait for user 1 to say hi
80
+ Given I wait for a signal containing "hi"
81
+ Then I wait
82
+ ```
82
83
 
83
- ## Kraken steps
84
+ # Kraken steps
84
85
 
85
86
  Kraken offers two main steps to help synchronizing your devices.
86
87
 
87
88
  ### Signaling steps
88
89
 
89
90
  To wait for a signal coming from another device for 10 seconds that is Kraken default timeout use the following step.
90
-
91
- Then /^I wait for a signal containing "([^\"]*)"$/
92
-
91
+ ```
92
+ Then /^I wait for a signal containing "([^\"]*)"$/
93
+ ```
93
94
  To wait for a signal coming from another device for an specified number of seconds use the following step
94
95
 
95
- Then /^I wait for a signal containing "([^\"]*)" for (\d+) seconds$/
96
+ ```
97
+ Then /^I wait for a signal containing "( [^\"]*)" for (\d+) seconds$/
98
+ ```
96
99
 
97
100
  To send a signal to another specified device use the following step
98
101
 
99
- Then /^I send a signal to user (\d+) containing "([^\"]*)"$/
102
+ ```
103
+ Then /^I send a signal to user (\d+) containing "([^\"]*)"$/
104
+ ```
100
105
 
101
106
  ### Signaling functions
102
107
 
103
108
  Kraken internal implementation of the signaling steps use the following functions.
104
109
 
105
- #### readSignal(channel, content, timeout)
110
+ ```ruby
111
+ readSignal(channel, content, timeout)
112
+ ```
106
113
 
107
114
  Waits for a signal with the specified content in the channel passed by parameter. This functions waits for the specified number of seconds in the timeout parameter before throwing an exception.
108
115
 
109
- **Note: The channel parameter has to be the number of a device such as @user1, @user2, @userN**
116
+ **Note: The channel parameter has to be the number of a device such as @user1, @user2, @userN**
110
117
 
111
- #### writeSignal(channel, content)
118
+ ```ruby
119
+ writeSignal(channel, content)
120
+ ```
112
121
 
113
122
  Writes content to a channel passed by parameter.
114
123
 
115
124
  **Note: The channel parameter has to be the number of a device such as @user1, @user2, @userN**
116
125
 
117
- ## Running your tests
126
+ # Running your tests
118
127
 
119
128
  To run your test:
120
129
 
121
- kraken-mobile run <apk>
130
+ ```shell
131
+ $ kraken-mobile run <apk>
132
+ ```
122
133
 
123
134
  Kraken with the help of Calabash-Android will install an instrumentation along with your app and will start your tests in all devices connected (Check Kraken Settings section in order to learn how to specify in what devices your tests should be run).
124
135
 
125
- ## Kraken Settings
136
+ # Kraken Settings
126
137
 
127
138
  Kraken uses kraken_mobile_settings.json to specify in what devices the tests should be run.
128
139
 
@@ -130,38 +141,63 @@ Kraken uses kraken_mobile_settings.json to specify in what devices the tests sho
130
141
 
131
142
  The following command will show you the available connected devices or emulators and let you choose which ones you want to use.
132
143
 
133
- kraken-mobile setup
144
+ ```shell
145
+ $ kraken-mobile setup
146
+ ```
134
147
 
135
148
  ### Run tests with settings file
136
149
 
137
- kraken-mobile run <apk> --configuration=<kraken_mobile_settings_path>
150
+ ``` shell
151
+ $ kraken-mobile run <apk> --configuration=<kraken_mobile_settings_path>
152
+ ```
138
153
 
139
- ## Properties file
154
+ # Properties file
140
155
 
141
156
  Kraken uses properties files to store sensitive data such as passwords or api keys that should be used in your test cases.
142
157
 
143
158
  ### Generate properties file
144
159
 
145
- The properties files should be a manually created json file with the following structure.
146
-
147
- {
148
- "@user1": {
149
- "PASSWORD": "test"
150
- },
151
- "@user2": {
152
- "PASSWORD": "test2"
153
- }
154
- }
160
+ The properties files should be a manually created JSON file with the following structure.
161
+
162
+ ```json
163
+ {
164
+ "@user1": {
165
+ "PASSWORD": "test"
166
+ },
167
+ "@user2": {
168
+ "PASSWORD": "test2"
169
+ }
170
+ }
171
+ ```
155
172
 
156
173
  ### Use properties file in your test
157
174
 
158
175
  You can use the specified properties using the following sintax.
159
176
 
160
- @user1
161
- Scenario: As a kjkhdkjds
162
- Given I wait
163
- Then I see the text "<PASSWORD>"
177
+ ```Gherkin
178
+ @user1
179
+ Scenario: As a kjkhdkjds
180
+ Given I wait
181
+ Then I see the text "<PASSWORD>"
182
+ ```
164
183
 
165
184
  ### Run tests with settings file
166
185
 
167
- kraken-mobile run <apk> --properties=<kraken_mobile_properties_path>
186
+ ```
187
+ kraken-mobile run <apk> --properties=<kraken_mobile_properties_path>
188
+ ```
189
+
190
+ # Examples
191
+
192
+ | Application | Video | Feature File | Properties file | Settings File | Report Link |
193
+ |:-------------|:-------------|:------------------|:-------|:-------|:-------|
194
+ | Infinite Words | [video](https://www.youtube.com/watch?v=4lX7mO80w-4&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=3&t=0s)|[.feature](/examples/infinite-words/infinite_words.feature) | --- | --- | [report](/examples/infinite-words/report/index.html) |
195
+ | QuizUp | [video](https://www.youtube.com/watch?v=2mhZVTK0r6k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=4&t=1s) | [.feature](/examples/quizup/quizup.feature) | --- | --- | [report](/examples/quizup/report/index.html) |
196
+ | Spotify/Shazam | [video](https://www.youtube.com/watch?v=7AKsfY1KFX0&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=5&t=0s) | [.feature](/examples/shazam/shazam.feature) | [.json](/examples/shazam/kraken_properties.json) | [.json](/examples/shazam/kraken_mobile_settings.json) | [report](/examples/shazam/report/index.html) |
197
+ | Spunky | [video](https://www.youtube.com/watch?v=WOhRWkdFaVk&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=6&t=25s) | [.feature](/examples/spunky/spunky.feature) | --- | --- | [report](/examples/spunky/report/index.html) |
198
+ | Picap | [video](https://www.youtube.com/watch?v=RozQrmH_Z5k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=7&t=3s) | [.feature](/examples/picap/picap.feature) | [.json](/examples/picap/kraken_properties.json) | --- | [report](/examples/picap/report/index.html) |
199
+ | AskFM | [video](https://www.youtube.com/watch?v=d9Gbdx8kFX8&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=8&t=0s) | [.feature](/examples/askfm/askfm.feature) | --- | --- | [report](/examples/askfm/report/index.html) |
200
+ | Stick Men Fight | [video](https://www.youtube.com/watch?v=36OJKNj0nSo&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=9&t=4s) | [.feature](/examples/stick/stick.feature) | --- | --- | [report](/examples/stick/report/index.html) |
201
+ | Tic Tac Toe | [video](https://www.youtube.com/watch?v=F9pDJDYsL_w&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=10&t=2s) | [.feature](/examples/tictactoe/tictactoe.feature) | --- | --- | [report](/examples/tictactoe/report/index.html) |
202
+ | Tumblr | [video](https://www.youtube.com/watch?v=eqFej2uJz4k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=11&t=3s) | [.feature](/examples/tumblr/tumblr.feature) | [.json](/examples/tumblr/kraken_properties.json) | --- | [report](/examples/tumblr/report/index.html) |
203
+ | F3 | [video](https://www.youtube.com/watch?v=vESh6Jyp-so&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=12&t=0s) | [.feature](/examples/f3/f3.feature) | [.json](/examples/f3/kraken_properties.json) | --- | [report](/examples/f3/report/index.html) |
@@ -5,8 +5,8 @@ module KrakenMobile
5
5
  module CalabashAndroid
6
6
  module MonkeyHelper
7
7
 
8
- # Runs inteligent monkey
9
- def run_intelligent_monkey channel, number_of_events
8
+ # Runs kraken monkey
9
+ def run_kraken_monkey channel, number_of_events
10
10
  device_id = channel_to_device_id channel
11
11
  logger = open("./#{device_id}.txt", 'w')
12
12
  number_of_events.times do |i|
@@ -46,9 +46,9 @@ Then /^I start a monkey with (\d+) events$/ do |int|
46
46
  run_monkey channel, int
47
47
  end
48
48
 
49
- Then /^I start a intelligent monkey with (\d+) events$/ do |int|
49
+ Then /^I start kraken monkey with (\d+) events$/ do |int|
50
50
  channel = @scenario_tags.grep(/@user/).first
51
- run_intelligent_monkey channel, int
51
+ run_kraken_monkey channel, int
52
52
  end
53
53
 
54
54
  Then /^I start a monkey with (\d+) events from height (\d+)% to (\d+)% and width (\d+)% to (\d+)%$/ do |int, from_x, to_x, from_y, to_y|
@@ -72,7 +72,7 @@ module KrakenMobile
72
72
  default_device = operations_module::Device.new(operations_module, ENV["ADB_DEVICE_ARG"], ENV["TEST_SERVER_PORT"], ENV["APP_PATH"], ENV["TEST_APP_PATH"])
73
73
  install_app_with_calabash
74
74
  default_device.start_test_server_in_background
75
- run_intelligent_monkey "#@user#{process_number}", 20
75
+ run_kraken_monkey "#@user#{process_number}", 20
76
76
  default_device.shutdown_test_server
77
77
  uninstall_app_with_calabash
78
78
  puts "\n****** PROCESS #{process_number} COMPLETED ******\n\n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # encoding: utf-8
3
3
  module KrakenMobile
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kraken-mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Ravelo M
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-17 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -126,6 +126,7 @@ files:
126
126
  - reporter/assets/fonts/glyphicons-halflings-regular.woff
127
127
  - reporter/assets/fonts/glyphicons-halflings-regular.woff2
128
128
  - reporter/assets/images/kraken.png
129
+ - reporter/assets/images/krakenThumbnail.jpg
129
130
  - reporter/assets/js/Chart.min.js
130
131
  - reporter/assets/js/bootstrap.min.js
131
132
  - reporter/assets/js/d3.chart.min.js
@@ -161,8 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
164
  requirements: []
164
- rubyforge_project:
165
- rubygems_version: 2.7.6
165
+ rubygems_version: 3.0.4
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Automated E2E mobile testing involving intercommunication scenarios.