SlideShare a Scribd company logo
PAYMENT FORM
UnitTest
Using Qunit
Tess Hsu 1
Introduce Qunit
Usage
Automation with Grunt watch
Tess Hsu 2
INTRODUCE QUNIT
Why use Qunit?
Tess Hsu 3
WHY QUNIT?
1.You could testing in your local without server, environment
setting
2. Special for jQuery, JQuery UI, Jquery Mobile
3. Not only support testing in browser, also support testing in
Rhino or node.js
Tess Hsu 4
USAGE
Very easy!!
Tess Hsu 5
USAGE
Basic file require
1. Qunit.js
2. Qunit.css
That’s it!!!!!!!!!!!
Tess Hsu 6
USAGE
Tess Hsu 7
That’s build oneTest file in your web package !!
USAGE
Tess Hsu 8
Your web package
├ src // plugin source, project files, etc (could be diff for you)
├ tests // work on here
│ ├ script
│ │ ├ qunit-2.0.1.js // qunit library js
│ │ ├ formTesing.js //your testing file name
│ │ └ otherTesting.js // if you need other testing in different model
│ ├ formTest.html // our QUnit test specification
│ └ css // your qunit css
│ ├ qunit-2.0.1.css // qunit library css
│
├ Gruntfile.js // add qunit task
├ package.json // to install qunit package
└ ...
USAGE
Tess Hsu 9
Start first your formTesting.html
1. Head: Insert quint css
2. Body : Insert first qunit id class to have this first demonstrate qunit test page
3. Body: insert what element you want to test
4. Finally, got to include js file you need to call for those testing method
USAGE
Tess Hsu 10
Put what you like to test
USAGE
Tess Hsu 11
Don’t forgot to include your testing js files, including qunit js library
USAGE
Tess Hsu 12
Then let’s start most simple testing js file, here I called my testing file: fromTesting. js
1. Put your testing module name, this is also could be in different testing module
ex: QUnit.module( "Field validator" ) or Qunit. Module(“API tesing”) etc
2. Start your testing functionality code, for example
USAGE
Tess Hsu 13
Method to use
There’s reference method like ok(), notOk() || equal(), notEqual() etc
http://api.qunitjs.com/category/assert/
USAGE
Tess Hsu 14
Method to use
For example here, tesing input field has id: firstname
USAGE
Tess Hsu 15
Output will be like this:
USAGE
Tess Hsu 16
For special case, you could add some rule directly to testing function
USAGE
Tess Hsu 17
Output will be like this:
USAGE
Tess Hsu 18
Example over view of your all testing list
USAGE
Tess Hsu 19
If you have fail, here is output looks like:
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 20
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 21
3 step:
1. Install qunit
2. Add in grunt initConfig, task to run
3. Add in watch.js for auto run
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 22
1. Install qunit
Add "grunt-contrib-qunit": "^1.2.0", (version could be differ)
in Package.json
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 23
~$ npm install
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 24
In Gruntfile.js: add config, loadTask, then registerTask
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 25
In watch.js: this is for watch to find where to excute test js file
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 26
You are done!! Run grunt watch
~$ grunt watch
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 27
If Success
AUTOMATIONWITH
GRUNTWATCH
Tess Hsu 28
If has fails
FIN,THANKYOU!!
Tess Hsu 29

More Related Content

RTF
NinjaSynch
PDF
Spock framework
PDF
Of tutorials v1612+
PDF
Python Subprocess
DOCX
Batch processing Demo
PPTX
PDF
SUnit 4.0
PPTX
Introduction to node js
NinjaSynch
Spock framework
Of tutorials v1612+
Python Subprocess
Batch processing Demo
SUnit 4.0
Introduction to node js

What's hot (9)

PDF
デブサミ 2019 【祝】k8sデビュー!エンタープライズ巨大アプリをマイクロサービスコンテナ化
PDF
Ruby's require, autoload and load methods
PDF
Node js实践
PPTX
Odoo's Test Framework - Learn Best Practices
PDF
Quick Introduction to Node.js
PDF
Compressed js with NodeJS & GruntJS
PPTX
Java ppt
PPTX
Tutorial to make sure of nginx files starterpack.
デブサミ 2019 【祝】k8sデビュー!エンタープライズ巨大アプリをマイクロサービスコンテナ化
Ruby's require, autoload and load methods
Node js实践
Odoo's Test Framework - Learn Best Practices
Quick Introduction to Node.js
Compressed js with NodeJS & GruntJS
Java ppt
Tutorial to make sure of nginx files starterpack.
Ad

Similar to Qunit testing slider (20)

PDF
YUI Test The Next Generation (YUIConf 2010)
PDF
L08 Unit Testing
DOCX
Test Driven Development
PPTX
Introduction to JUnit testing in OpenDaylight
PPS
JUnit Presentation
PPS
J unit presentation
PPTX
Test ng tutorial
PPTX
Junit and cactus
PPT
Automated Unit Testing
PPT
JsUnit
PPTX
Testing with Junit4
PDF
Testing Tools
PPT
Testing And Drupal
PDF
TestNG introduction
PPTX
PHPUnit: from zero to hero
PPTX
2.Python_Testing_Using_PyUnit_PyTest.pptx
PPT
Unit testing php-unit - phing - selenium_v2
PPTX
Code igniter unittest-part1
PPTX
Testing with VS2010 - A Bugs Life
DOCX
Junit With Eclipse
YUI Test The Next Generation (YUIConf 2010)
L08 Unit Testing
Test Driven Development
Introduction to JUnit testing in OpenDaylight
JUnit Presentation
J unit presentation
Test ng tutorial
Junit and cactus
Automated Unit Testing
JsUnit
Testing with Junit4
Testing Tools
Testing And Drupal
TestNG introduction
PHPUnit: from zero to hero
2.Python_Testing_Using_PyUnit_PyTest.pptx
Unit testing php-unit - phing - selenium_v2
Code igniter unittest-part1
Testing with VS2010 - A Bugs Life
Junit With Eclipse
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Machine learning based COVID-19 study performance prediction
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
Programs and apps: productivity, graphics, security and other tools
MIND Revenue Release Quarter 2 2025 Press Release
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Qunit testing slider