Skip to content

Setup for web app

msporna edited this page Jan 8, 2019 · 3 revisions

This page lists steps required to make LAVA work with so called simple web app - meaning web application without any framework,consisting only of html and javascript files.

  1. Do the initial setup: https://github.com/msporna/LAVA-test-coverage/wiki/Initial-setup or skip if done already
  2. open src/config.json and update required fields:
source_root_absolute_path: [absolute path to folder containing .html and .js files]
web_routes_available: [list routes that can be visited by end user]
INJECT_MODE: "web"

All paths must be absolute. For config details go to config.json-explained page.

  1. start LAVA server from /server by executing the following command manually:
python instrument_server.py

or if you are on Windows you can simply run:

run_api_windows.bat
  1. go to /client and from your terminal run python instrument_client.py and pass config.json path as command line argument so the command becomes: python instrument_client.py config.json

  2. the process of injecting probes will start

  3. check your project's files, should be appended by instrumentation code

  4. your website's root folder will now have instrument.js file and index.html will be referencing it (done automatically)

  5. serve the website on a web server you like - it's ready for testing

related example:https://github.com/msporna/LAVA-test-coverage/tree/master/examples/web_demo