Name: meteor-nightwatch-helpers
Owner: TABLEFLIP
Description: A series of helper functions for writing Nightwatch tests for Meteor apps
Created: 2015-10-18 19:10:32.0
Updated: 2015-10-18 19:25:55.0
Pushed: 2015-10-19 08:47:25.0
Homepage: null
Size: 140
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A series of helper functions for writing Nightwatch tests for Meteor apps.
m install -g starrynight
arrynight generate-autoconfig
arrynight scaffold --framework nightwatch
packages
subdirectory from the project root. You might need to create a packages
directory.@host:~/YOUR_PROJECT/packages$ git clone https://github.com/tableflip/meteor-nightwatch-helpers
teor add tableflip:nightwatch-helpers
"custom_commands_path"
key in the .meteor/nightwatch.json
file that will have been created:kages/tests-helpers/nightwatch"
Tests should be put in tests/nightwatch/walkthroughs
. The starrynight scaffold will have created an example walkthrough in the appropriate location.
nt.login()
This will log the test client in with a user ID of AAAAAAAAAAAAAAAAA and name Test User. Note that the core accounts-base package must be present in the app for this to work (accounts-base is included with all the accounts-XXX packages).
nt.clearDB()
This method will remove all the contents of the collections which appear in fixtures files (see below).
nt.populateDB()
This method will insert all of the documents listed in any file in the tests-helpers/fixtures
directory. Files must be valid JSON and must contain an object with two keys: name
, which is the collection name (in Meteor, not in the MongoDB), and docs
, which is an array of documents to insert. An example is provided and should be either amended or removed before using this method.
arrynight run-tests --framework nightwatch