Add more parameters. Add a basic readme for running the tests

This commit is contained in:
Erjan Gavalji
2015-10-21 15:15:50 +03:00
parent 4b37a7ec95
commit 58d05747cd
2 changed files with 34 additions and 2 deletions

View File

@@ -6,6 +6,11 @@ module.exports = {
//Construct and validate the arguments //Construct and validate the arguments
var args = { var args = {
platform: grunt.option("platform") 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(){ (function validateInput(){
@@ -16,9 +21,7 @@ module.exports = {
tnsPath: "tns", tnsPath: "tns",
emulatorProcessIdentifier:".*emulator64-x86", emulatorProcessIdentifier:".*emulator64-x86",
emuAvdName:"Api19", emuAvdName:"Api19",
androidRuntimePath:"/Users/erjan/tns-android.tgz",
outfile:"./TestRunResult.txt", outfile:"./TestRunResult.txt",
androidRuntimePath: "/Users/erjan/tns-android.tgz",
androidFrameworkArgument: " --frameworkPath=/Users/erjan/tns-android.tgz", androidFrameworkArgument: " --frameworkPath=/Users/erjan/tns-android.tgz",
workingDir:".testsapprun", workingDir:".testsapprun",

29
running-tests.md Normal file
View File

@@ -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"]
```