Skip to content

tns test <platform> does not work in case the application is not installed on the device. #1513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue Feb 19, 2016 · 2 comments
Assignees
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

In case application is not installed on the device, instead of running the tests, the original app is stared.

Steps to reproduce

  • Create new app - tns create myApp
  • Navigate to the app - cd myApp
  • Initialize test structure - tns test init
  • Run the tests (make sure you do not have org.nativescript.myApp installed on the device): tns test <platform>

Workaround

Install the app first:

  • tns run <plartform> --justlaunch
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 19, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.7.0 milestone Feb 19, 2016
ligaz added a commit to NativeScript/nativescript-angular that referenced this issue Feb 20, 2016
@rosen-vladimirov
Copy link
Contributor Author

Also we must prepare the project first and start Karma launcher after that - in case the project is TypeScript, we will not have the .js files and the tests will not run. Preparing the project will generate the .js files :)

hdeshev added a commit to NativeScript/nativescript-angular that referenced this issue Feb 23, 2016
Add mocha karma reporter.

Downgrade CLI to avoid bug with unit test runner.

More info: NativeScript/nativescript-cli#1513

Make sure we have compiled the js files before starting karma.
This was referenced Feb 25, 2016
@rosen-vladimirov
Copy link
Contributor Author

Scenarios that must be tested:

  • Application is not installed on device:
    • tns test <platform> - should prepare the project, deploy it on device and start the tests
    • tns test <platform> --watch should prepare the project, deploy it on device and start the tests. When change is applied, test must be restarted. NOTE: Test must be restarted no matter if .xml, .css or .js is changed.
  • Application is installed on device:
    • tns test <platform> - prepare the project and run the tests
    • tns test <platform> --watch should prepare the project, deploy it on device and start the tests. When change is applied, test must be restarted. NOTE: Test must be restarted no matter if .xml, .css or .js is changed.
  • TypeScript application
    • tns test <platform> - make sure that you do not have .js files in your app folder before testing - this command should transpile the files, prepares the project and runs the tests
    • tns test <platform> --watch - make sure changing of .ts files does not lead to infinite loop
  • Debug:
    • tns test <platform> --debug-brk should break and allow you to debug the application
    • tns test <platform> --debug-brk --watch should fail - these two flags cannot be used simultaneously.
  • Additional tests
    • tns test <platform> and after that tns run <platform> - first call should run the tests, the second one should run the real application
    • tns test <platform> and after that tns livesync <platform> - first call should run the tests, the second one should deploy changed files on device and start the REAL application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants