Skip to content

Commit

Permalink
make toggle test ready for appium test
Browse files Browse the repository at this point in the history
- build it in reset.sh
- move test files to an appropriate dir
- add to test.sh
cc @mobiware
  • Loading branch information
jlipps committed Jan 22, 2014
1 parent da0919c commit 8ce088c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if $android_only || $all_tests; then
echo "RUNNING ANDROID TESTS"
echo "---------------------"
android_testfile="./test/functional/_joined/android.js"
android_dirs="apidemos selendroid android gappium"
android_dirs="apidemos selendroid android toggletest gappium"
join_testfiles android $android_testfile $android_dirs
APPIUM_CORDOVA="android" time $appium_mocha $android_testfile
fi
2 changes: 1 addition & 1 deletion grunt-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ module.exports.setupAndroidBootstrap = function(grunt, cb) {

module.exports.setupAndroidApp = function(grunt, appName, cb) {
var appPath = path.resolve(__dirname, "sample-code", "apps", appName);
var args = ["update", "project", "--subprojects", "-t", "android-18", "-p", "."];
var args = ["update", "project", "--subprojects", "-t", "android-18", "-p", ".", "-n", appName];
setupAndroidProj(grunt, appPath, args, cb);
};

Expand Down
14 changes: 14 additions & 0 deletions reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ appium_home=$(pwd)
reset_successful=false
has_reset_unlock_apk=false
apidemos_reset=false
toggletest_reset=false
hardcore=false
grunt="$(npm bin)/grunt" # might not have grunt-cli installed with -g
verbose=false
Expand Down Expand Up @@ -251,6 +252,14 @@ reset_apidemos() {
apidemos_reset=true
}

reset_toggle_test() {
echo "* Configuring and cleaning/building Android test app: ToggleTest"
run_cmd $grunt configAndroidApp:ToggleTest
run_cmd $grunt buildAndroidApp:ToggleTest
uninstall_android_app com.example.toggletest
toggletest_reset=true
}

reset_gps_demo() {
if $hardcore ; then
echo "* Removing previous copies of the gps demo"
Expand Down Expand Up @@ -293,6 +302,7 @@ reset_android() {
reset_unlock_apk
if $include_dev ; then
reset_apidemos
reset_toggle_test
reset_gps_demo
fi
echo "* Setting Android config to Appium's version"
Expand Down Expand Up @@ -320,6 +330,10 @@ reset_selendroid() {
reset_apidemos
uninstall_android_app com.example.android.apis.selendroid
fi
if ! $toggletest_reset; then
reset_toggle_test
uninstall_android_app com.example.toggletest.selendroid
fi
echo "* Linking selendroid test app: WebViewDemo"
run_cmd rm -rf $appium_home/sample-code/apps/WebViewDemo
run_cmd ln -s $appium_home/submodules/selendroid/selendroid-test-app $appium_home/sample-code/apps/WebViewDemo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var driverBlock = require("../../helpers/driverblock.js")
, Q = driverBlock.Q
, path = require('path')
, appPath = path.resolve(__dirname, "../../../sample-code/apps/ToggleTest/bin/ToggleTest.apk")
, appPath = path.resolve(__dirname, "../../../sample-code/apps/ToggleTest/bin/ToggleTest-debug.apk")
, appPkg = "com.example.toggletest"
, appAct = ".MainActivity"
, it = driverBlock.it;
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 8ce088c

Please sign in to comment.