honeydew 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +79 -8
- data/Rakefile +2 -2
- data/examples/cucumber/Gemfile +5 -0
- data/{example → examples/cucumber}/Rakefile +0 -0
- data/{example → examples/cucumber}/features/example.feature +0 -0
- data/{example → examples/cucumber}/features/step_definitions/honeydew_steps.rb +0 -0
- data/examples/rspec/spec/browse_spec.rb +16 -0
- data/examples/rspec/spec/spec_helper.rb +6 -0
- data/honeydew.gemspec +17 -17
- data/honeydew.iml +12 -18
- data/lib/honeydew.rb +1 -72
- data/lib/honeydew/device.rb +79 -44
- data/lib/honeydew/device_actions.rb +32 -100
- data/lib/honeydew/device_commands.rb +36 -23
- data/lib/honeydew/device_matchers.rb +29 -22
- data/lib/honeydew/dsl.rb +1 -1
- data/lib/honeydew/honeydew.rb +82 -0
- data/lib/honeydew/version.rb +1 -1
- data/{android-server → server}/.gitignore +0 -0
- data/{android-server → server}/pom.xml +16 -6
- data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/_maven.repositories +0 -0
- data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/uiautomator-4.1.1.4.jar +0 -0
- data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/uiautomator-4.1.1.4.pom +0 -0
- data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/android-maven-plugin-3.5.2-SNAPSHOT.jar +0 -0
- data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/android-maven-plugin-3.5.2-SNAPSHOT.pom +0 -0
- data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/maven-metadata-local.xml +0 -0
- data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/_maven.repositories +0 -0
- data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/commons-jxpath-1.4-SNAPSHOT.jar +0 -0
- data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/commons-jxpath-1.4-SNAPSHOT.pom +0 -0
- data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/maven-metadata-local.xml +0 -0
- data/{android-server → server}/repo/commons-jxpath/commons-jxpath/maven-metadata-local.xml +0 -0
- data/server/repo/fi/iki/elonen/nanohttpd-webserver/2.0.3/nanohttpd-webserver-2.0.3.jar +0 -0
- data/server/repo/fi/iki/elonen/nanohttpd-webserver/2.0.3/nanohttpd-webserver-2.0.3.pom +9 -0
- data/server/repo/fi/iki/elonen/nanohttpd-webserver/maven-metadata-local.xml +12 -0
- data/server/repo/fi/iki/elonen/nanohttpd/2.0.3/nanohttpd-2.0.3.jar +0 -0
- data/server/repo/fi/iki/elonen/nanohttpd/2.0.3/nanohttpd-2.0.3.pom +9 -0
- data/server/repo/fi/iki/elonen/nanohttpd/maven-metadata-local.xml +12 -0
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/Action.java +13 -6
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/ActionsExecutor.java +3 -2
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/Command.java +6 -1
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/Result.java +7 -7
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/TestRunner.java +14 -6
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/Click.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/ClickAndWaitForNewWindow.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/DumpWindowHierarchy.java +5 -5
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/HasSettingsMenuItem.java +4 -5
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/InspectOptionInSettingsMenu.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsButtonPresent.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsChildCountEqualTo.java +4 -4
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsElementWithNestedTextPresent.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsOptionInSettingsMenuDisabled.java +1 -1
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsOptionInSettingsMenuEnabled.java +1 -1
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/IsTextPresent.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/LaunchApp.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/LaunchHome.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/LongClick.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/PressBack.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/PressEnter.java +4 -4
- data/server/src/main/java/com/amplify/honeydew_server/actions/ScrollToTextByIndex.java +27 -0
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/SelectFromAppsList.java +4 -4
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/SelectMenuInSettings.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/SetText.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/SetTextByIndex.java +2 -2
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/SetTextByLabel.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/Unlock.java +3 -3
- data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew_server}/actions/WakeUp.java +4 -4
- data/server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java +66 -0
- data/spec/honeydew/device_matchers_spec.rb +21 -42
- data/spec/honeydew/device_spec.rb +38 -36
- data/spec/spec_helper.rb +2 -25
- metadata +93 -92
- data/android-server/src/main/java/com/uiautomator_cucumber/android_server/httpd/NanoHTTPD.java +0 -1100
- data/android-server/src/main/java/com/uiautomator_cucumber/android_server/httpd/RemoteCommandReceiver.java +0 -64
- data/example/Gemfile +0 -5
- data/example/features/support/hooks.rb +0 -4
- data/lib/honeydew/hooks.rb +0 -0
- data/lib/honeydew/step_definitions.rb +0 -75
- data/lib/tasks/honeydew.rake +0 -7
- data/todo.md +0 -9
@@ -1,64 +0,0 @@
|
|
1
|
-
package com.uiautomator_cucumber.android_server.httpd;
|
2
|
-
|
3
|
-
import android.util.Log;
|
4
|
-
import com.google.gson.Gson;
|
5
|
-
import com.uiautomator_cucumber.android_server.ActionsExecutor;
|
6
|
-
import com.uiautomator_cucumber.android_server.Command;
|
7
|
-
import com.uiautomator_cucumber.android_server.Result;
|
8
|
-
|
9
|
-
import java.io.File;
|
10
|
-
import java.io.IOException;
|
11
|
-
import java.util.Properties;
|
12
|
-
|
13
|
-
public class RemoteCommandReceiver extends NanoHTTPD {
|
14
|
-
private static final String MIME_JSON = "application/json";
|
15
|
-
private static final String TAG = "RemoteCommandReceiver";
|
16
|
-
private final Gson gson;
|
17
|
-
private final ActionsExecutor actionsExecutor;
|
18
|
-
private boolean running = true;
|
19
|
-
|
20
|
-
public RemoteCommandReceiver(ActionsExecutor actionsExecutor) throws IOException, InterruptedException {
|
21
|
-
super(7120, new File("/"));
|
22
|
-
Log.d(TAG, "Listening on HTTP port 7120. Kill test to stop");
|
23
|
-
this.gson = new Gson();
|
24
|
-
this.actionsExecutor = actionsExecutor;
|
25
|
-
while (running) {
|
26
|
-
Thread.sleep(5000);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
@Override
|
31
|
-
public Response serve(String uri, String method, Properties header, Properties params, Properties files) {
|
32
|
-
log(uri, method, params);
|
33
|
-
|
34
|
-
Result result = tryPerformingControlAction(method, uri);
|
35
|
-
if (result == null) {
|
36
|
-
result = performActionOnDevice(params);
|
37
|
-
}
|
38
|
-
return new Response(HTTP_OK, MIME_JSON, gson.toJson(result));
|
39
|
-
}
|
40
|
-
|
41
|
-
@Override
|
42
|
-
public void stop() {
|
43
|
-
super.stop();
|
44
|
-
this.running = false;
|
45
|
-
}
|
46
|
-
|
47
|
-
private Result performActionOnDevice(Properties params) {
|
48
|
-
return actionsExecutor.execute(gson.fromJson((String) params.get("command"), Command.class));
|
49
|
-
}
|
50
|
-
|
51
|
-
private Result tryPerformingControlAction(String method, String uri) {
|
52
|
-
if (uri.equalsIgnoreCase("/terminate")) {
|
53
|
-
stop();
|
54
|
-
return Result.OK;
|
55
|
-
} else if(method.equalsIgnoreCase("HEAD")) {
|
56
|
-
return Result.OK;
|
57
|
-
}
|
58
|
-
return null;
|
59
|
-
}
|
60
|
-
|
61
|
-
private void log(String uri, String method, Properties params) {
|
62
|
-
Log.d(TAG, String.format("Processing uri: %s, method: %s, params: %s", uri, method, params));
|
63
|
-
}
|
64
|
-
}
|
data/example/Gemfile
DELETED
data/lib/honeydew/hooks.rb
DELETED
File without changes
|
@@ -1,75 +0,0 @@
|
|
1
|
-
Given /^I unlock$/ do
|
2
|
-
Honeydew.current_device.unlock
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I launch app "(.*?)"$/ do |app_name|
|
6
|
-
Honeydew.current_device.launch_application app_name
|
7
|
-
end
|
8
|
-
|
9
|
-
Given /^I launch home$/ do
|
10
|
-
Honeydew.current_device.launch_home
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I press back$/ do
|
14
|
-
Honeydew.current_device.press_back
|
15
|
-
end
|
16
|
-
|
17
|
-
Given /^I select "(.*?)" in the Settings view$/ do |menu_item|
|
18
|
-
Honeydew.current_device.launch_settings_item menu_item
|
19
|
-
end
|
20
|
-
|
21
|
-
Given /^I select app "(.*?)" from the Apps list in the Settings view$/ do |app_name|
|
22
|
-
Honeydew.current_device.launch_settings_app app_name
|
23
|
-
end
|
24
|
-
|
25
|
-
Given /^I should see text containing "(.*?)"$/ do |expected_text|
|
26
|
-
Honeydew.current_device.should have_textview_text expected_text
|
27
|
-
end
|
28
|
-
|
29
|
-
Given /^I enter text "(.*?)" into field with description "(.*?)"$/ do |text, field_description|
|
30
|
-
Honeydew.current_device.fill_in field_description, with: text
|
31
|
-
end
|
32
|
-
|
33
|
-
Given /^I press the "(.*?)" button$/ do |button_text|
|
34
|
-
Honeydew.current_device.click_button button_text
|
35
|
-
end
|
36
|
-
|
37
|
-
Given /^I press the "(.*?)" text$/ do |text|
|
38
|
-
Honeydew.current_device.click_text text
|
39
|
-
end
|
40
|
-
|
41
|
-
Given /^I press the element with description "(.*?)"$/ do |element_description|
|
42
|
-
Honeydew.current_device.click_element element_description
|
43
|
-
end
|
44
|
-
|
45
|
-
Given /^I long press the element with description "(.*?)"$/ do |element_description|
|
46
|
-
Honeydew.current_device.long_click_element element_description
|
47
|
-
end
|
48
|
-
|
49
|
-
When /^I wait up to (\d+) seconds for "(.*?)" to appear$/ do |timeout, text|
|
50
|
-
Honeydew.current_device.should have_textview_text text, timeout
|
51
|
-
end
|
52
|
-
|
53
|
-
When /^I wait up to (\d+) seconds for "(.*?)" to appear in edit text$/ do |timeout, text|
|
54
|
-
Honeydew.current_device.should have_edit_text text, timeout
|
55
|
-
end
|
56
|
-
|
57
|
-
Given /I uninstall the app "(.*?)" using ADB$/ do |pacakge_name|
|
58
|
-
Honeydew.current_device.uninstall_app pacakge_name
|
59
|
-
end
|
60
|
-
|
61
|
-
Given /I install the app "(.*?)" using ADB$/ do |apk_location|
|
62
|
-
Honeydew.current_device.install_app apk_location
|
63
|
-
end
|
64
|
-
|
65
|
-
Given /I reboot the device using ADB$/ do
|
66
|
-
Honeydew.current_device.reboot
|
67
|
-
end
|
68
|
-
|
69
|
-
Then /I see the app "(.*?)" installed using ADB$/ do |package_name|
|
70
|
-
Honeydew.current_device.should have_app_installed package_name
|
71
|
-
end
|
72
|
-
|
73
|
-
Then /I should see a button "(.*?)" with (package|description) as "(.*?)"$/ do |button_text, condition, package_name|
|
74
|
-
Honeydew.current_device.should have_button button_text
|
75
|
-
end
|
data/lib/tasks/honeydew.rake
DELETED