kraken-mobile 1.0.1 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +251 -77
- data/bin/kraken-mobile +64 -67
- data/bin/kraken_mobile_calabash_android.rb +39 -0
- data/bin/kraken_mobile_helpers.rb +107 -0
- data/bin/kraken_mobile_setup.rb +138 -0
- data/calabash-android-features-skeleton/step_definitions/mobile_steps.rb +1 -0
- data/calabash-android-features-skeleton/support/app_installation_hooks.rb +2 -0
- data/calabash-android-features-skeleton/support/app_life_cycle_hooks.rb +3 -4
- data/calabash-android-features-skeleton/support/env.rb +1 -1
- data/calabash-android-features-skeleton/web/step_definitions/web_steps.rb +3 -0
- data/calabash-android-features-skeleton/web/support/app_life_cycle_hooks.rb +15 -0
- data/lib/kraken-mobile/device_process.rb +130 -0
- data/lib/kraken-mobile/helpers/devices_helper/adb_helper.rb +100 -105
- data/lib/kraken-mobile/helpers/kraken_faker.rb +108 -0
- data/lib/kraken-mobile/helpers/reporter.rb +3 -0
- data/lib/kraken-mobile/hooks/mobile_kraken_hooks.rb +15 -0
- data/lib/kraken-mobile/hooks/mobile_operations.rb +36 -0
- data/lib/kraken-mobile/hooks/web_operations.rb +33 -0
- data/lib/kraken-mobile/mobile/adb.rb +66 -0
- data/lib/kraken-mobile/mobile/android_commands.rb +43 -0
- data/lib/kraken-mobile/mobile/mobile_process.rb +101 -0
- data/lib/kraken-mobile/models/android_device.rb +121 -0
- data/lib/kraken-mobile/models/device.rb +113 -31
- data/lib/kraken-mobile/models/feature_file.rb +135 -0
- data/lib/kraken-mobile/models/feature_scenario.rb +24 -0
- data/lib/kraken-mobile/models/web_device.rb +89 -0
- data/lib/kraken-mobile/monkeys/mobile/android_monkey.rb +30 -0
- data/lib/kraken-mobile/monkeys/mobile/kraken_android_monkey.rb +54 -0
- data/lib/kraken-mobile/monkeys/web/web_monkey.rb +63 -0
- data/lib/kraken-mobile/runners/calabash/android/monkey_helper.rb +2 -2
- data/lib/kraken-mobile/runners/calabash/android/steps/communication_steps.rb +18 -2
- data/lib/kraken-mobile/runners/calabash/monkey/monkey_runner.rb +2 -2
- data/lib/kraken-mobile/steps/general_steps.rb +83 -0
- data/lib/kraken-mobile/steps/mobile/kraken_steps.rb +72 -0
- data/lib/kraken-mobile/steps/web/kraken_steps.rb +91 -0
- data/lib/kraken-mobile/test_scenario.rb +227 -0
- data/lib/kraken-mobile/utils/feature_reader.rb +17 -0
- data/lib/kraken-mobile/utils/k.rb +68 -0
- data/lib/kraken-mobile/utils/mobile_cucumber.rb +2 -0
- data/lib/kraken-mobile/utils/reporter.rb +500 -0
- data/lib/kraken-mobile/version.rb +2 -2
- data/lib/kraken-mobile/web/web_process.rb +41 -0
- data/lib/kraken_mobile.rb +81 -0
- data/reporter/assets/css/scenario_index.css +20 -0
- data/reporter/assets/images/krakenThumbnail.jpg +0 -0
- data/reporter/assets/js/sankey.js +56 -24
- data/reporter/feature_report.html.erb +5 -1
- data/reporter/index.html.erb +15 -8
- data/reporter/scenario_report.html.erb +73 -31
- metadata +95 -14
- data/bin/kraken-mobile-calabash-android.rb +0 -85
- data/bin/kraken-mobile-generate.rb +0 -19
- data/bin/kraken-mobile-helpers.rb +0 -48
- data/bin/kraken-mobile-setup.rb +0 -50
- data/calabash-android-features-skeleton/step_definitions/kraken_steps.rb +0 -1
- data/lib/kraken-mobile.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1b00ad0b9cbfa1874a61ff9285fddf9616901c2e99db685b9fcfa05099bba3d6
|
4
|
+
data.tar.gz: 9370f8c54723f070282457dfca37a51bd4e4522fcc94ba14bb38f401b2db7fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f9f6c735b8cfc759b6f9b8dec02bf833b4abe3fe8f450647af3303e4e9c7e3d9634e49b524b9931d6f6ecba31b00e64453b6b1d0b0a9a97ce3057433225d567
|
7
|
+
data.tar.gz: cf4c0fc443b23308a2c226e9523c39a178144cae805a5751ef0256a31840002f15521361e930ff02d4144e0e5345b0b6139b2dbf1added31ec1bf61eb25d8731
|
data/README.md
CHANGED
@@ -1,88 +1,100 @@
|
|
1
1
|
<p align="center">
|
2
|
-
|
3
|
-
|
4
|
-
</a>
|
5
|
-
</p>
|
2
|
+
<img src="./reporter/assets/images/kraken.png" alt="kraken logo" width="140" height="193">
|
3
|
+
<h1 align="center">Kraken</h1>
|
6
4
|
|
7
|
-
|
5
|
+
Kraken is an open source automated android and web 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) and web page URL. Kraken uses signaling for coordinating the communication between the devices using a file based protocol.
|
8
6
|
|
9
|
-
|
7
|
+
**Kraken is partially supported by a Google Latin America Research Award (LARA) 2018**
|
10
8
|
|
11
|
-
|
9
|
+
# Video
|
10
|
+
[![krakenThumbnail](./reporter/assets/images/krakenThumbnail.jpg)](https://www.youtube.com/watch?v=hv5gFIpW3gM&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=1)
|
12
11
|
|
13
|
-
|
14
|
-
- [Installation](#installation)
|
15
|
-
- [Signaling](#signaling)
|
16
|
-
- [Writing your first test](#writing-your-first-test)
|
17
|
-
- [Kraken steps](#kraken-steps)
|
18
|
-
- [Running your tests](#running-your-tests)
|
19
|
-
- [Kraken Settings](#kraken-settings)
|
20
|
-
- [Properties file](#properties-file)
|
12
|
+
# Publications
|
21
13
|
|
22
|
-
|
14
|
+
- *“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)]
|
23
15
|
|
24
|
-
|
16
|
+
# Technologies
|
25
17
|
|
26
|
-
|
18
|
+
Kraken uses [calabash-android](https://github.com/calabash/calabash-android) and [selenium-webdriver](https://github.com/SeleniumHQ/selenium) 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.
|
19
|
+
|
20
|
+
# 🔨 Installation
|
27
21
|
|
28
22
|
### Prerequisites
|
29
23
|
|
30
|
-
Kraken requires Ruby 2.20 or higher but we recommend using ~2.3 version. We use calabash-android
|
24
|
+
Kraken requires Ruby 2.20 or higher but we recommend using ~2.3 version. We use calabash-android for mobile testing, you can check their prerequisites at this [link](https://github.com/calabash/calabash-android/blob/master/documentation/installation.md). For web testing we use selenium-webdriver, you can check their prerequisites as well at this [link](https://www.selenium.dev/selenium/docs/api/rb/).
|
25
|
+
|
26
|
+
- Ruby at least version 2.3.1
|
27
|
+
- Java JDK
|
28
|
+
- Android SDK
|
29
|
+
- Chromedriver (Version ~83 recommended) or Geckodriver (Only if you use Kraken web)
|
31
30
|
|
31
|
+
You need to have configured ANDROID_HOME, ANDROID_HOME/platform_tools and JAVA_HOME in your environment variables.
|
32
32
|
|
33
|
-
Installing and managing
|
33
|
+
Installing and managing Kraken Gem is done through the gem command. To install Kraken’s gem run the following command.
|
34
34
|
|
35
|
-
|
35
|
+
```
|
36
|
+
$ gem install kraken-mobile
|
37
|
+
```
|
36
38
|
|
39
|
+
NOTE: If you are having trouble running Kraken in your Windows operating system refer to the this [guide](https://github.com/TheSoftwareDesignLab/KrakenMobile/blob/master/docs/WINDOWS_GUIDE.md) specifying steps to solve this issues.
|
37
40
|
|
38
|
-
|
41
|
+
# Signaling
|
39
42
|
|
40
|
-
Signaling is a protocol used for the communication of two or more devices running in parallel. It
|
43
|
+
Signaling is a protocol used for the communication of two or more devices running in parallel. It is based in the idea that each browser, 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.
|
41
44
|
|
42
|
-
|
45
|
+
# Writing your first test
|
43
46
|
|
44
47
|
### Generate cucumber feature skeleton
|
45
48
|
|
46
49
|
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:
|
47
50
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
```
|
52
|
+
features
|
53
|
+
|_support
|
54
|
+
| |_app_installation_hooks.rb
|
55
|
+
| |_app_life_cycle_hooks.rb
|
56
|
+
| |_env.rb
|
57
|
+
|_step_definitions
|
58
|
+
| |_mobile_steps.rb
|
59
|
+
|_web
|
60
|
+
| |_step_definitions
|
61
|
+
| | |_web_steps.rb
|
62
|
+
| |_support
|
63
|
+
| | |_app_life_cycle_hooks.rb
|
64
|
+
|_my_first.feature
|
65
|
+
```
|
56
66
|
|
57
67
|
### Write a test
|
58
68
|
|
59
|
-
The features goes in the features foler and should have the
|
60
|
-
|
61
|
-
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).
|
69
|
+
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).
|
62
70
|
|
63
71
|
### Syntax
|
64
72
|
|
65
|
-
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
|
73
|
+
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`.
|
66
74
|
|
67
|
-
|
68
|
-
|
69
|
-
|
75
|
+
```
|
76
|
+
List of devices attached
|
77
|
+
user1 - emulator-5554 - Android_SDK_built_for_x86
|
78
|
+
user2 - emulator-5556 - Android_SDK_built_for_x86
|
79
|
+
```
|
70
80
|
|
71
81
|
After identifying what number each device has, you can write your test case giving each scenario the tag of a given device like so:
|
72
82
|
|
73
|
-
|
83
|
+
```
|
84
|
+
Feature: Example feature
|
74
85
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
86
|
+
@user1
|
87
|
+
Scenario: As a first user I say hi to a second user
|
88
|
+
Given I wait
|
89
|
+
Then I send a signal to user 2 containing "hi"
|
79
90
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
91
|
+
@user2
|
92
|
+
Scenario: As a second user I wait for user 1 to say hi
|
93
|
+
Given I wait for a signal containing "hi"
|
94
|
+
Then I wait
|
95
|
+
```
|
84
96
|
|
85
|
-
|
97
|
+
# Kraken steps
|
86
98
|
|
87
99
|
Kraken offers two main steps to help synchronizing your devices.
|
88
100
|
|
@@ -90,41 +102,139 @@ Kraken offers two main steps to help synchronizing your devices.
|
|
90
102
|
|
91
103
|
To wait for a signal coming from another device for 10 seconds that is Kraken default timeout use the following step.
|
92
104
|
|
93
|
-
|
105
|
+
```
|
106
|
+
Then /^I wait for a signal containing "([^\"]*)"$/
|
107
|
+
```
|
94
108
|
|
95
109
|
To wait for a signal coming from another device for an specified number of seconds use the following step
|
96
110
|
|
97
|
-
|
111
|
+
```
|
112
|
+
Then /^I wait for a signal containing "( [^\"]*)" for (\d+) seconds$/
|
113
|
+
```
|
98
114
|
|
99
115
|
To send a signal to another specified device use the following step
|
100
116
|
|
101
|
-
|
117
|
+
```
|
118
|
+
Then /^I send a signal to user (\d+) containing "([^\"]*)"$/
|
119
|
+
```
|
102
120
|
|
103
121
|
### Signaling functions
|
104
122
|
|
105
|
-
|
106
|
-
|
107
|
-
#### readSignal(channel, content, timeout)
|
123
|
+
Each device has an internal Kraken implementation of the signaling steps using the following functions.
|
108
124
|
|
109
|
-
|
125
|
+
```
|
126
|
+
read_signal(content, time_out)
|
127
|
+
```
|
110
128
|
|
111
|
-
|
129
|
+
Waits for a signal with the specified content. This functions waits for the specified number of seconds in the timeout parameter before throwing an exception if specified.
|
112
130
|
|
113
|
-
|
131
|
+
```
|
132
|
+
write_signal(signal)
|
133
|
+
```
|
114
134
|
|
115
|
-
Writes content to a
|
135
|
+
Writes signal content to a device inbox.
|
116
136
|
|
117
|
-
|
137
|
+
# 📱Kraken Mobile
|
118
138
|
|
119
139
|
## Running your tests
|
120
140
|
|
121
141
|
To run your test:
|
122
142
|
|
123
|
-
|
143
|
+
```
|
144
|
+
$ kraken-mobile run <apk>
|
145
|
+
```
|
124
146
|
|
125
147
|
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).
|
126
148
|
|
127
|
-
##
|
149
|
+
## 🦍 Mobile Monkey execution
|
150
|
+
|
151
|
+
Kraken offers the possibility of generating random GUI events by using Android ADB monkey as well as its own implementation based in the idea of sending and reading random signals.
|
152
|
+
|
153
|
+
### Android’s ADB Monkey
|
154
|
+
|
155
|
+
To execute ADB monkey Kraken offers the following command specifying the number of events to be executed:
|
156
|
+
|
157
|
+
```
|
158
|
+
Then I start a monkey with (\d+) events
|
159
|
+
```
|
160
|
+
|
161
|
+
### Kraken’s own monkey
|
162
|
+
|
163
|
+
Kraken extended the ADB monkey behavior by executing GUI events only in buttons and clickable views or inputs by offering the following command:
|
164
|
+
|
165
|
+
```
|
166
|
+
Then I start kraken monkey with (\d+) events
|
167
|
+
```
|
168
|
+
|
169
|
+
## XML snapshot
|
170
|
+
|
171
|
+
Kraken makes it possible to save the XML presented by the current view in a specific device, this is convenient to identify view ids, asserting the correct XML is presented after an action has being completed or running static analyzing tools.
|
172
|
+
|
173
|
+
### Saving the snapshot
|
174
|
+
|
175
|
+
To save the snapshot of the current view, Kraken offers the following step specifying where the file is going to be saved:
|
176
|
+
|
177
|
+
```
|
178
|
+
Then I save device snapshot in file with path "([^\"]*)"
|
179
|
+
```
|
180
|
+
|
181
|
+
# 🌎 Kraken Web
|
182
|
+
|
183
|
+
Kraken is extended to run also in web browsers and orchestrate the communication with other browsers running different websites or mobile applications that are being executed on physical devices or emulators. With the help of ChromeDriver/Geckodriver, selenium-webdriver and Cucumber we run test scenarios using Gherkin syntax as well as Kraken predefined signaling steps described before.
|
184
|
+
|
185
|
+
## Specifying a web user in a test
|
186
|
+
|
187
|
+
To specify that user is going to be run in a web browser instead of a mobile device you need to tag the scenario with @web. If a scenario is not tagged with @web Kraken will assume that is a mobile user and will attempt to run all steps in a mobile manner.
|
188
|
+
|
189
|
+
```bash
|
190
|
+
Feature: Example feature
|
191
|
+
|
192
|
+
@user1 @web
|
193
|
+
Scenario: As a first user I say hi to a second user
|
194
|
+
Given I navigate to page "https://www.gmail.com/"
|
195
|
+
Then I send a signal to user 2 containing "hi"
|
196
|
+
|
197
|
+
@user2 @web
|
198
|
+
Scenario: As a second user I wait for user 1 to say hi
|
199
|
+
Given I wait for a signal containing "hi"
|
200
|
+
Then I navigate to page "https://www.gmail.com/"
|
201
|
+
```
|
202
|
+
|
203
|
+
This scenario will open two web browsers and execute the signaling between them.
|
204
|
+
|
205
|
+
## Web steps
|
206
|
+
|
207
|
+
To see a list of all web steps available in Kraken, visit the following [link.](https://github.com/TheSoftwareDesignLab/KrakenMobile/blob/master/docs/WEB_STEPS.md)
|
208
|
+
|
209
|
+
## Executing web only scenarios
|
210
|
+
|
211
|
+
To run a test that only contains web users and as a result does not require an APK file, run the following command:
|
212
|
+
|
213
|
+
```
|
214
|
+
$ kraken-mobile run
|
215
|
+
```
|
216
|
+
|
217
|
+
Kraken with the help of selenium-webdriver will start all required browsers and run your test scenario.
|
218
|
+
|
219
|
+
## Specifying in what browser Kraken will run
|
220
|
+
|
221
|
+
Kraken uses ChromeDriver and Chrome as default web browser but provides support for Firefox and Geckodriver. To specify that your test is going to be run in Firefox, specify the environment variable BROWSER when running your tests as follows:
|
222
|
+
|
223
|
+
```bash
|
224
|
+
$ BROWSER=firefox kraken-mobile run
|
225
|
+
```
|
226
|
+
|
227
|
+
**Note: Make sure that you have Geckodriver and Firefox installed previously.**
|
228
|
+
|
229
|
+
## 🦍 Web Monkey execution
|
230
|
+
|
231
|
+
Kraken has implemented it's own monkey behavior by executing random GUI events in buttons, clickable views and inputs by offering the following command:
|
232
|
+
|
233
|
+
```
|
234
|
+
Then I start kraken monkey with (\d+) events
|
235
|
+
```
|
236
|
+
|
237
|
+
# Kraken Settings
|
128
238
|
|
129
239
|
Kraken uses kraken_mobile_settings.json to specify in what devices the tests should be run.
|
130
240
|
|
@@ -132,38 +242,102 @@ Kraken uses kraken_mobile_settings.json to specify in what devices the tests sho
|
|
132
242
|
|
133
243
|
The following command will show you the available connected devices or emulators and let you choose which ones you want to use.
|
134
244
|
|
135
|
-
|
245
|
+
```
|
246
|
+
$ kraken-mobile setup
|
247
|
+
```
|
136
248
|
|
137
249
|
### Run tests with settings file
|
138
250
|
|
139
|
-
|
251
|
+
```
|
252
|
+
$ kraken-mobile run <apk> --configuration=<kraken_mobile_settings_path>
|
253
|
+
```
|
254
|
+
|
255
|
+
# 🗯 Extended Kraken functionalities
|
256
|
+
|
257
|
+
In the following sections we provide specification for shared functionality between Kraken mobile and web as well as some examples of Kraken in action.
|
140
258
|
|
141
|
-
|
259
|
+
# Properties file
|
142
260
|
|
143
261
|
Kraken uses properties files to store sensitive data such as passwords or api keys that should be used in your test cases.
|
144
262
|
|
145
263
|
### Generate properties file
|
146
264
|
|
147
|
-
The properties files should be a manually created
|
265
|
+
The properties files should be a manually created JSON file with the following structure.
|
148
266
|
|
149
|
-
|
150
|
-
|
267
|
+
```
|
268
|
+
{
|
269
|
+
"@user1": {
|
151
270
|
"PASSWORD": "test"
|
152
|
-
|
153
|
-
|
271
|
+
},
|
272
|
+
"@user2": {
|
154
273
|
"PASSWORD": "test2"
|
155
|
-
}
|
156
274
|
}
|
157
|
-
|
275
|
+
}
|
276
|
+
```
|
277
|
+
|
158
278
|
### Use properties file in your test
|
159
279
|
|
160
280
|
You can use the specified properties using the following sintax.
|
161
281
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
282
|
+
```
|
283
|
+
@user1
|
284
|
+
Scenario: As a user
|
285
|
+
Given I wait
|
286
|
+
Then I see the text "<PASSWORD>"
|
287
|
+
```
|
166
288
|
|
167
289
|
### Run tests with settings file
|
168
290
|
|
169
|
-
|
291
|
+
```
|
292
|
+
kraken-mobile run <apk> --properties=<kraken_mobile_properties_path>
|
293
|
+
```
|
294
|
+
|
295
|
+
# Use fake strings in tests
|
296
|
+
|
297
|
+
Kraken offers a Fake string generator thanks to the Ruby gem [Faker](https://github.com/faker-ruby/faker), the list of supported faker types are listed as follows:
|
298
|
+
|
299
|
+
- Name
|
300
|
+
- Number
|
301
|
+
- Email
|
302
|
+
- String
|
303
|
+
- String Date
|
304
|
+
|
305
|
+
### Use a faker in a test
|
306
|
+
|
307
|
+
Kraken keeps a record of every Fake string generated, thats why each string will have an id associated. To generate a Faker string you need to follow the structure “$FAKERNAME_ID”.
|
308
|
+
|
309
|
+
```
|
310
|
+
@user1
|
311
|
+
Scenario: As a user
|
312
|
+
Given I wait
|
313
|
+
Then I enter text "$name_1" into field with id "view"
|
314
|
+
```
|
315
|
+
|
316
|
+
### Reusing a fake string
|
317
|
+
|
318
|
+
As mentioned before, Kraken keeps record of every string generated with an id given to each string, this gives you the possibility of reusing this string later in your scenario. To reuse a string you can you need to append a $ character to the fake string as follows:
|
319
|
+
|
320
|
+
```
|
321
|
+
@user1
|
322
|
+
Scenario: As a user
|
323
|
+
Given I wait
|
324
|
+
Then I enter text "$name_1" into field with id "view"
|
325
|
+
Then I press "add_button"
|
326
|
+
Then I should see "$$name_1"
|
327
|
+
```
|
328
|
+
|
329
|
+
# Examples
|
330
|
+
|
331
|
+
|
332
|
+
| Application | Video | Feature File | Steps Definition | Properties file | Settings File | Report Link |
|
333
|
+
|:-------------|:-------------|:-------------|:------------------|:-------|:-------|:-------|
|
334
|
+
| 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) |
|
335
|
+
| QuizUp | [video](https://www.youtube.com/watch?v=2mhZVTK0r6k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=4&t=1s) | [.feature](/examples/quizup/quizup.feature)|[stepsDef](../gh-pages/examples/quizup/step_definitions/kraken_steps.rb) | --- | --- | [report](/examples/quizup/report/index.html) |
|
336
|
+
| Spotify/Shazam | [video](https://www.youtube.com/watch?v=7AKsfY1KFX0&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=5&t=0s) | [.feature](/examples/shazam/shazam.feature)|[stepsDef](../gh-pages/examples/shazam/step_definitions/kraken_steps.rb) | [.json](/examples/shazam/kraken_properties.json) | [.json](/examples/shazam/kraken_mobile_settings.json) | [report](/examples/shazam/report/index.html) |
|
337
|
+
| Spunky | [video](https://www.youtube.com/watch?v=WOhRWkdFaVk&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=6&t=25s) | [.feature](/examples/spunky/spunky.feature)|[stepsDef](../gh-pages/examples/spunky/step_definitions/kraken_steps.rb) | --- | --- | [report](/examples/spunky/report/index.html) |
|
338
|
+
| Picap | [video](https://www.youtube.com/watch?v=RozQrmH_Z5k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=7&t=3s) | [.feature](/examples/picap/picap.feature)|[stepsDef](../gh-pages/examples/picap/step_definitions/kraken_steps.rb) | [.json](/examples/picap/kraken_properties.json) | --- | [report](/examples/picap/report/index.html) |
|
339
|
+
| AskFM | [video](https://www.youtube.com/watch?v=d9Gbdx8kFX8&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=8&t=0s) | [.feature](/examples/askfm/askfm.feature)|[stepsDef](../gh-pages/examples/askfm/step_definitions/kraken_steps.rb) | --- | --- | [report](/examples/askfm/report/index.html) |
|
340
|
+
| 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) |
|
341
|
+
| Tic Tac Toe | [video](https://www.youtube.com/watch?v=F9pDJDYsL_w&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=10&t=2s) | [.feature](/examples/tictactoe/tictactoe.feature)|[stepsDef](../gh-pages/examples/tictactoe/step_definitions/kraken_steps.rb) | --- | --- | [report](/examples/tictactoe/report/index.html) |
|
342
|
+
| Tumblr | [video](https://www.youtube.com/watch?v=eqFej2uJz4k&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=11&t=3s) | [.feature](/examples/tumblr/tumblr.feature)|[stepsDef](../gh-pages/examples/tumblr/step_definitions/kraken_steps.rb) | [.json](/examples/tumblr/kraken_properties.json) | --- | [report](/examples/tumblr/report/index.html) |
|
343
|
+
| F3 | [video](https://www.youtube.com/watch?v=vESh6Jyp-so&list=PLF5U8kfVgRcJ3RCHt7cWmwlqN93brbVW-&index=12&t=0s) | [.feature](/examples/f3/f3.feature)|[stepsDef](../gh-pages/examples/f3/step_definitions/kraken_steps.rb) | [.json](/examples/f3/kraken_properties.json) | --- | [report](/examples/f3/report/index.html) |
|
data/bin/kraken-mobile
CHANGED
@@ -1,91 +1,88 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require File.join(File.dirname(__FILE__),
|
4
|
-
require File.join(File.dirname(__FILE__),
|
5
|
-
require File.join(File.dirname(__FILE__),
|
6
|
-
$LOAD_PATH << File.expand_path(
|
7
|
-
require '
|
3
|
+
require File.join(File.dirname(__FILE__), 'kraken_mobile_helpers')
|
4
|
+
require File.join(File.dirname(__FILE__), 'kraken_mobile_setup')
|
5
|
+
require File.join(File.dirname(__FILE__), 'kraken_mobile_calabash_android')
|
6
|
+
$LOAD_PATH << File.expand_path('../lib', __dir__)
|
7
|
+
require 'kraken_mobile'
|
8
8
|
require 'kraken-mobile/constants'
|
9
9
|
|
10
10
|
#-------------------------------
|
11
11
|
# AGV reader helper
|
12
12
|
#-------------------------------
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
formatted_runner_command
|
20
|
-
end
|
21
|
-
end
|
14
|
+
def read_configuration
|
15
|
+
configuration_command = ARGV.select do |arg|
|
16
|
+
arg.include?('--configuration=')
|
17
|
+
end.first
|
18
|
+
return if configuration_command.nil?
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
formatted_protocol_command = protocol_command.strip.downcase
|
27
|
-
formatted_protocol_command.slice!("--protocol=")
|
28
|
-
if KrakenMobile::Constants::SUPPORTED_PROTOCOLS.include?(formatted_protocol_command)
|
29
|
-
formatted_protocol_command
|
30
|
-
else # Protocol not supported.
|
31
|
-
raise "Specified protocol not supported."
|
32
|
-
end
|
33
|
-
else # If protocol not specified use file based as default.
|
34
|
-
KrakenMobile::Constants::FILE_PROTOCOL
|
35
|
-
end
|
20
|
+
configuration_command = configuration_command.strip.downcase
|
21
|
+
configuration_command.slice!('--configuration=')
|
22
|
+
configuration_command
|
36
23
|
end
|
37
24
|
|
38
|
-
def
|
39
|
-
|
40
|
-
if
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
25
|
+
def read_user_entered_properties_path
|
26
|
+
properties_command = ARGV.select { |arg| arg.include?('--properties=') }.first
|
27
|
+
return if properties_command.nil?
|
28
|
+
|
29
|
+
properties_command = properties_command.strip.downcase
|
30
|
+
properties_command.slice!('--properties=')
|
31
|
+
properties_command
|
45
32
|
end
|
46
33
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
34
|
+
#-------------------------------
|
35
|
+
# Helpers
|
36
|
+
#-------------------------------
|
37
|
+
|
38
|
+
def user_entered_apk_path
|
39
|
+
return nil if ARGV.first.nil?
|
40
|
+
|
41
|
+
first_argument = ARGV.first
|
42
|
+
return nil if first_argument.start_with?('--') # Is argument parameter not apk
|
43
|
+
|
44
|
+
File.expand_path(first_argument)
|
54
45
|
end
|
55
46
|
|
56
47
|
#-------------------------------
|
57
48
|
# Command reader
|
58
49
|
#-------------------------------
|
59
50
|
|
60
|
-
if ARGV.length
|
61
|
-
|
51
|
+
if ARGV.length.zero?
|
52
|
+
print_usage
|
62
53
|
else
|
63
54
|
cmd = ARGV.shift
|
64
55
|
case cmd
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
56
|
+
when 'version'
|
57
|
+
require 'kraken-mobile/version'
|
58
|
+
puts KrakenMobile::VERSION
|
59
|
+
when 'devices'
|
60
|
+
require 'kraken-mobile/helpers/devices_helper/manager'
|
61
|
+
print_devices
|
62
|
+
when 'setup'
|
63
|
+
KrakenSetup.new.run
|
64
|
+
when 'gen'
|
65
|
+
ensure_java_installed
|
66
|
+
ensure_android_sdk_installed
|
67
|
+
|
68
|
+
scaffold_folder_structure
|
69
|
+
when 'resign'
|
70
|
+
ensure_java_installed
|
71
|
+
ensure_android_sdk_installed
|
72
|
+
|
73
|
+
require 'calabash-android/helpers'
|
74
|
+
puts 'Resigning APK with Calabash-Android'
|
75
|
+
ensure_apk_is_specified
|
76
|
+
resign_apk(user_entered_apk_path)
|
77
|
+
when 'run'
|
78
|
+
ensure_java_installed
|
79
|
+
ensure_android_sdk_installed
|
80
|
+
|
81
|
+
require File.join(File.dirname(__FILE__), 'kraken_mobile_calabash_android')
|
82
|
+
configuration = read_configuration
|
83
|
+
user_entered_properties_path = read_user_entered_properties_path
|
84
|
+
handle_calabash_android(configuration, user_entered_properties_path)
|
85
|
+
else
|
86
|
+
print_usage
|
90
87
|
end
|
91
88
|
end
|