Skip to content

Instantly share code, notes, and snippets.

@tesshsu
Created January 10, 2017 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tesshsu/52dd9a157c5c30245ddcaa34e4024bcf to your computer and use it in GitHub Desktop.
Save tesshsu/52dd9a157c5c30245ddcaa34e4024bcf to your computer and use it in GitHub Desktop.
Billing Form using Unit test for testing user input if correspond to MTX validation rules,also applicable with grunt automation with grunt watch

#Billing Form Unit Test with grunt automation

##Overview Automation billing form testing use "grunt watch", the store has to install grunt first.

##Usage

  1. In your package.json file, install qunit package by adding: grunt.loadNpmTask('grunt-contrib-qunit');
  2. In a console window navigate to your store folder
  3. Type: npm-install
  4. once installed, open Gruntfile.js and add qunit task and config code: grunt.registerTask('qunit');
  5. Open watch.js in your grunt/config folder
  6. add qunit config code: qunit: creatSetup([ 'qunit' ], [ 'local-testing/tests/scripts/*.js' ]),
  7. In a console window navigate to your store folder
  8. Type: grunt-watch
  9. You should able to see the quint test automation run
module.exports = function(grunt) {
var gruntConfig,
taskConfigs;
// set up a configuration
gruntConfig = {
qunit : {
files: 'local-testing/tests/*.html'
}
};
};
{
"devDependencies": {
"grunt-contrib-qunit": "^1.2.0"
}
}
// ### watch task
module.exports = function(grunt, globalConfig) {
return {
qunit: createSetup([
'qunit'
], [
'local-testing/tests/scripts/*.js'
])
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment