UNPKG

2.44 kBMarkdownView Raw
1# Amaze test-driven development
2
3This is a set of tools that will allow for test-driven development using the following technologies:
4
5* Mocha
6* Chai
7* selenium-webdriver
8* Chrome, Firefox, IE, or PhantomJS
9
10## TLDR; Install
11
12Install the suite globally to have easy access to `amaze` from the command line:
13
14`npm install -g amaze-tdd`
15
16Then install the testing suite into each project root directory with:
17
18`npm install --save amaze-tdd`
19
20## Writing tests
21
22Ensure the testing suite is required at the top of the test
23
24`var Amaze = require('amaze-tdd)`
25
26Instantiate the browser object in the `suiteSetup` function. You should look at another test to see an example.
27
28`var Browser = new Amaze.Webdriver.Builder().forBrowser(Amaze.Agent).setChromeOptions(Amaze.Options).build();`
29
30## Running tests
31
32**Develop mode**
33
34`amaze chrome`
35
36**Production mode**
37
38For production, after JavaScript has been compiled and is placed on the remote server, you may use PhantomJS to headlessly test the interfaces. No browser plugin is required.
39
40`amaze phantomjs`
41
42## Test files
43
44Our process will run Mocha on any files in the specified path with the format `*-spec.js`. This means that the following examples will work:
45
46* `test-spec.js`
47* `overlay-name-spec.js`
48* `camelCase-spec.js`
49* `ALLCAPS-spec.js`
50* `some-folder/test-spec.js`
51* `some-folder/nested-folder/test-spec.js`
52
53Basically any file that ends with `-spec.js` will be covered in testing.
54
55## Changelog
56
57### 0.1.1
58* Moved the demo test Browser instance into a suiteSetup to fix the empty browser that spawns during tests
59* Fixed typo of this section heading :-)
60
61### 0.1.0
62* Removed unused Chai.should() library
63* Added documentation
64* Various cleanup and consolidations
65
66### 0.0.15
67* Added a jQuery wrapper to make working with Selenium easier
68
69### 0.0.14
70* Making Chrome plugin path work regardless of project
71* Moving browser builder to individual tests. This is necessary so the browser can reinstantiate itself between tests.
72
73### 0.0.13
74* Package bin path update
75
76### 0.0.12
77* Directory structure updates; needed an index.js for easier module loading
78
79### 0.0.11
80* Removed selenium/mocha wrapper to reduce dependencies
81* Moved to a promise-based test setup
82* Switched from BDD to TDD for clarity
83* Preferring local install to global; was previously global
84* Added changelog :-)
85
86### 0.0.1 - 0.0.10
87* Regreting not starting a changelog sooner
88* Basically gets stuff setup and working through bugs
\No newline at end of file