From a7256d496ee084248dbf0a4a9e6a0e5c5f95d04b Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 21 May 2017 16:21:17 -0400 Subject: [PATCH] better readme --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2f8245d..81aaf7e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,61 @@ -1. run `npm install -g grunt-cli` -1. run `npm install -g jasmine-node` +# Example of End To End Testing Using Selenium Webdriver and Jasmine Tests With Istanbul Code Coverage + +## Installation + +### Global Installation + +Firstly, install `grunt-cli` globally: + +``` +npm install -g grunt-cli +``` + +Next install `jasmine-node` test runner globally: + +``` +npm install -g jasmine-node +``` + +Now we'll download a browser driver that Selenium will use to control Firefox: + 1. Download firefox webdriver: https://github.com/mozilla/geckodriver/releases/tag/v0.16.1 - - put in in your PATH -1. Clone this repo -1. cd into local repo directory -1. run `npm install` -1. run `grunt dev` -1. in a different terminal run `grunt server` -1. run `jasmine-node specs/test-spec.js` -1. run `grunt report` +1. Put the driver somewhere in your PATH + - e.g. `/usr/local/bin` + +### Local Installation + +1. clone this repo somewhere on your computer +1. `cd` into the newly created directory for the locally cloned version of this repo +1. Install all necessary node packages: + + ``` + npm install + ``` + +## Running + +Website code from `src/` into the `prod/` directory and instrument it: + +``` +grunt dev +``` + +Start a local static file web server in a different terminal window: + +``` +grunt server +``` + +Back in the previous terminal window, run the tests: + +``` +jasmine-node specs/test-spec.js +``` + +The tests have been run, and the coverage has been generated. Create human readble report: + +``` +grunt report +``` + +This will create an html report and put it in `coverage/lcov-report/index.html`