From 58d05747cda47ffb34a2b0a682447858a2e5de96 Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Wed, 21 Oct 2015 15:15:50 +0300 Subject: [PATCH] Add more parameters. Add a basic readme for running the tests --- build/run-testsapp.grunt.js | 7 +++++-- running-tests.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 running-tests.md diff --git a/build/run-testsapp.grunt.js b/build/run-testsapp.grunt.js index 74a463ad6..2e3630c5d 100644 --- a/build/run-testsapp.grunt.js +++ b/build/run-testsapp.grunt.js @@ -6,6 +6,11 @@ module.exports = { //Construct and validate the arguments var args = { platform: grunt.option("platform") + tnsPath: grunt.option("tnsPath") + emulatorProcessIdentifier: grunt.option("emuPId") + emuAvdName: grunt.option("avdNameToStart") + outFile: grunt.option("logFilePath") + androidRuntimePath: grunt.option("androidRuntimePath") }; (function validateInput(){ @@ -16,9 +21,7 @@ module.exports = { tnsPath: "tns", emulatorProcessIdentifier:".*emulator64-x86", emuAvdName:"Api19", - androidRuntimePath:"/Users/erjan/tns-android.tgz", outfile:"./TestRunResult.txt", - androidRuntimePath: "/Users/erjan/tns-android.tgz", androidFrameworkArgument: " --frameworkPath=/Users/erjan/tns-android.tgz", workingDir:".testsapprun", diff --git a/running-tests.md b/running-tests.md new file mode 100644 index 000000000..5a44b18a6 --- /dev/null +++ b/running-tests.md @@ -0,0 +1,29 @@ +Running NativeScript Tests +========================= + + +# Details +NativeScript is a framework for building applications on mobile devices. Many +of its components are UI elements which get tested most efficiently on the +respective device or simulator/emulator. Thus, running the tests involves +the following steps: +- Create a NativeScript project +- Build it to a native image +- Start a simulator/emulator +- Deploy the application image +- Start the application +- Monitor its output +- Gather test output + +# Prerequisites +- Node JS +- grunt +- NativeScript CLI +- Android/iOS setup +- expect + +# Sample run: +``` +grunt testsapp --platform=Android [--tnsPath="tns"] --emuPId=".*emulator64-x86" +--emuAvdName="Api19" [--logFilePath="./TestRunResult.txt"] [--androidRuntimePath="./tns-android.tgz"] +```