cordova-plugin-livereload
Version:
Cordova Plugin to facilitate livereload workflow
142 lines (110 loc) • 7.79 kB
Plain Text
========Dependencies installation======
- cordova plugin add https://github.com/omefire/cordova-plugin-livereload.git => deps installed + no warning msg
- cordova plugin add cordova-plugin-device => no deps installed
- no message related to optional deps failing displayed on cmd line (Linux, Windows, OSX)
-
======Basic LiveReload===========
- cordova run android --livereload
- cordova run android -- --livereload
- cordova run ios -- --livereload
- cordova run ios --livereload
- cordova emulate android -- --livereload => .html, .css livereloaded
- cordova run android --device => runs fine
- cordova emulate android => runs fine
- cordova run android -- --livereload => Display "CTRL+C" msg
- cordova build android -- --livereload => Doesn't start LiveReload
- cordova platform add android -- --livereload => works fine
- phonegap run android -- --livereload => starts livereload and .html, .css works fine
- taco run android -- --livereload => starts livereload and .html, .css works fine
- gulp run -- --livereload => starts livereload and .html, .css works fine
- add a new file to www/ folder => livereload kicks in
- modify img file in www/ folder => livereload kicks in
- modify merge file not in www/ folder => livereload kicks in
- cordova build android -- --livereload => NO livereload kicks in
- Add a new file to www/folder1/ folder => livereload kicks in
- Remove a file from www/folder1 => livereload kicks in
- With logo file referenced from index.html => remove logo.png => livereload kicks in => rendered app with NO logo
- With logo file referenced from index.html => add logo.png (it was previously non-existent in filesystem, only present in index.html source code)
=> livereload kicks in => rendered app has logo on
-
======Unsupported platforms=========
- cordova run browser -- --livereload
- cordova run windows -- --livereload => displays msg saying it's unsupported
- cordova emulate windows -- --livereload => displays msg saying it's unsupported
- cordova run browser windows -- --livereload => displays that none of the platforms is supported and stops the process
& no "CTRL+C" msg is displayed
- cordova run android browser -- --livereload => displays that browser is not supported, starts livereload on android platform
& "CTRL+C" msg is displayed
-
=======User ends LiveReload via "CTRL+C"=========
=======Content Security Policy==========
- app has CSP blocking network communication in its index.html => cordova run ios -- --livereload => livereload works fine
=======Custom Index.html page=========
- app with start page being 'customPage.html' => cordova run android -- --livereload => livereload works fine
-
=======Computer Not connected to any network==========
- cordova plugin add cordova-plugin-livereload => disconnect from networks => cordova run android -- --livereload => LiveReload server stopped
& an error msg displayed: "No External URLs available. Make sure your computer is connected to a network."
& no "CTRL+C" msg displayed
-
========Multi-Platform Scenarios================
- cordova run android ios -- --livereload => modify index.html, index.css => mirror changes in all connected devices
- cordova emulate android ios -- --livereload => modify index.html, index.css => mirror changes in all connected devices
- cordova run --target=emulator-1 --target=device-1 => modify index.html, index.css => mirror changes in all connected devices
- cordova run android ios -- --livereload => modify index.html, index.css => mirror CLICKS + SCROLLS + REFRESH + FORM ACTIONS changes in all connected devices
-
==========GULP WORKFLOW==============
- use exposed LiveReload API via gulp tasks
- compile typescript and drop into www/ folder => livereload kicks in
=========CUSTOM START PAGE=============
- create project with a customer start page set in project_root/config.xml => cordova run android -- --livereload => livereload works fine
- create project with index.html start page set in project_root/config.xml => cordova run android -- --livereload => livereload works fine
-
==========Config.xml could be anywhere in the platform folder===============
- test iOS app named: HelloWorld
- test iOS app named: StarterApp
- test iOS app created with ionic template
- all the above tests will have different folders that contain the config.xml. good area to look for bugs
-
=========IGNORE OPTION===========
- `cordova run android -- --livereload` on project with www/css/index.css as main css src for main page => edit www/css/index.css => livereload
- `cordova run android -- --livereload --ignore=css` on project with www/css/index.css as main css src for main page => edit www/css/index.css => NO livereload
- `cordova run android -- --livereload --ignore =css` => edit www/css/index.css => livereload happens because of whitespace after ignore option
-
==========A Random error occurs==========
- simulate a random error in random parts of the code => a clear error msg gets displayed to user stating: `cordova-plugin-livereload: An error occurred - bla bla bla`
-
==========Custom options provided by user when using the API============
- User passes open=true as an option => the browser gets opened by default on `cordova run android -- --livereload`
- User passes custom file watcher => the custom file watcher gets called
===========Linux, OSX, Windows===========
- Run all the tests on the 3 OSes: Linux, OSX, Windows
-
===========Bug Fix for emulate option==========
- cordova emulate android => works
- cordova emulate android -- --livereload => works
- cordova emulate android -- --livereload --ignore=/lib/** => work
- cordova emulate android -- --livereload --ignore= => works
- cordova emulate android -- --livereload --ignore => works
===================GhostMode option=============
- cordova run android ios -- --livereload => ghostmode enabled and user can sync gestures across the 2 platforms
- cordova run android ios -- --livereload --ghostmode=false => ghostmode disabled and user CANNOT sync gestures across the 2 platforms
- cordova run android ios -- --livereload --ghostmode=true => ghostmode enabled and user can sync gestures across the 2 platforms
=====================Exposing API Endpoints================
- test that all the events fire at the correct moment : 'livereload:start', 'livereload:stop', 'livereload:error', etc...
- test that the Patcher (.patch, removeCSP) can be consumed successfully from npm package clients
- test that clients can successfully query the livereload status after consuming the npm package
- test that clients can kick off the livereload process from the npm package
- test the api endpoints
- when using the api, specify whether you want to install the dependencies
-
- make sure that running `phonegap|ionic run android --livereload` doesn't start livereloading when the plugin is installed
- make sure only running `phonegap|ionic run android -- --livereload` starts livereloading
-
================Error page and connection issues handling============
- disconnect the mobile device from the same WIFI the computer is on, then run `cordova run android -- --livereload` => the mobile app should display an error page
telling the user about the connection error and should offer suggestions on how to get past it
- Now, reconnect to the same WIFI, and run the above command again => the cordova app should start successfully and the user should be able to use livereload
without any issues
-
- If user tries to livereload a platform that hasn't been added => error out and warn him