Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate Cordova plugins in browser

To test a Cordova app I need to run it in an Emulator or on a physical device. That is a slow process so instead I test it in a browser when possible.

But the browser doesn't have a contacts database so the contact plugin doesn't work.

Is there any way to add mocks (contacts, date pickers, etc.) to the browser for fast testing?

like image 756
bgst Avatar asked May 08 '16 15:05

bgst


Video Answer


2 Answers

1) cordova platform add browser -force

2) cordova serve

3) in the browser: http://localhost:8000

4) click "browser" link on screen. It will open your app.

like image 93
Smaran Avatar answered Sep 16 '22 18:09

Smaran


you can use http://incubator.apache.org/projects/ripple.html

installation process is simple

npm install -g ripple-emulator

then move to your cordova project directory and run.

cordova prepare

then run the following to start simulator

ripple emulate --path platforms/android/assets/www

you will get something like this Screenshot of ripple emulator

see the detailed explanation about ripple on raymondcamden's blog

like image 40
Arpit Vasani Avatar answered Sep 17 '22 18:09

Arpit Vasani