the new major 2 version.
🔨 At the moment, there is development ofThe JavaScript framework for testing web UI
Installation
# Local installation: npm install --save-dev guit # Global installation: npm install -g guit
Usage
To run your tests in command line
guit --help# # Usage: guit [options] # # Options: # # -h, --help output usage information # --spec-dir <dir> Specify spec's dir to find # --spec-files <regex> Specify spec's file regex to run # --helper-dir <dir> Specify helper's dir to find # --helper-files <regex> Specify helper's file regex to import # --junit-filename <file> Specify junit results file to save #
Run the tests using
guit --spec-dir ./example/spec/ --spec-files \\-spec\\.js$
To run your tests using npm, you may specify scripts in package.json
Run the tests using npm test
Configuration
You may specify the config in .guitrc
Alternatively, you may specify the field guit
in your package.json
And specify scripts in package.json
Global methods
describe("<SUITE DESCRIPTION>", <FUNCTION>);
it("<CASE DESCRIPTION>", <FUNCTION>);
(support async await)
beforeAll(<FUNCTION>);
(support async await)
beforeEach(<FUNCTION>);
(support async await)
afterEach(<FUNCTION>);
(support async await)
afterAll(<FUNCTION>);
(support async await)
expect(<ACTUAL>)
guit uses expect
Usage methods for create specs
;
Usage with async await
; ;
Usage json file for create specs
Helpers
Helper file example
{ await thisbrowser;} { await thisbrowser;} { await thisbrowser;} { await thisbrowser;}
Tools
Browser
;
Initializing
let browserInstance = await width: <WIDTH px> height: <WIDTH px> checkTimeout: <TIME ms> doneTimeout: <TIME ms>;
Methods
Open page in browser
await browserInstance;
Close page
await browserInstance;
Close browser
await browserInstance;
Render view into image
await browserInstance;
Sleep
await browserInstance;
Fire mouse event
await browserInstance;
Fire keyboard event
await browserInstance;
Return snapshot of computed style
await browserInstance;
Save snapshot of computed style
await browserInstance;
Load snapshot of computed style
await browserInstance;
Compare current snapshot with saved snapshot
await browserInstance;
Compare current snapshot with saved snapshot
await browserInstance;
Usage Browser
;; ;
Add custom reporter
;
Usage addReporter(CustomReporterClass)
{ /* ... */} { /* ... */} { /* ... */} { /* ... */} { /* ... */} { /* ... */ } { /* ... */ }
Dependencies
babel-cli * babel-plugin-transform-object-rest-spread * babel-polyfill * babel-preset-es2015 * babel-preset-es2017 * colors * commander * deep-object-diff * expect * image-diff * phantom * recursive-readdir-sync * xmlbuilder * express * nodemon
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Send me a pull request.