Download - Jasmine Testing Framework
![Page 1: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/1.jpg)
Jasmine Testing Framework
![Page 2: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/2.jpg)
What’s Jasmine For?
• Framework for Test Driven Development
• Designed around acceptance testing
• Works in any environment (with or without browser, etc.)
![Page 3: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/3.jpg)
What does Jasmine look like?
![Page 4: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/4.jpg)
How do I use Jasmine?
• First: define your behavior• Example: Citadel Trivia App• Should provide information about the citadel
• Should be location aware
• Second: define your interface• Example: Citadel Trivia App• HTML5 Page
• Three important elements: title div, content div and update button
• Clicking the update button should put information in the two divs
• The information should change if the user is in a new area
![Page 5: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/5.jpg)
Citadel Trivia App HTML Skeleton
![Page 6: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/6.jpg)
How do I write a test?
![Page 7: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/7.jpg)
What do the test results look like?
![Page 8: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/8.jpg)
What about when they fail?
![Page 9: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/9.jpg)
How do I use dummy results?
![Page 10: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/10.jpg)
And the results?
![Page 11: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/11.jpg)
What does the testing driver look like?
![Page 12: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/12.jpg)
How do I get started?
1. Go to http://pivotal.github.io/jasmine/
2. Scroll to the bottom of the page
3. Download “Standalone Release”
4. Extract all files
5. Modify the SpecRunner.html to include your own files and structure
![Page 13: Jasmine Testing Framework](https://reader035.vdocument.in/reader035/viewer/2022062501/5681609d550346895dcfc4f6/html5/thumbnails/13.jpg)
What are some other tools?
• QUnit: an alternative to Jasmine (http://qunitjs.com/)
• JSCover: A code coverage tool (http://tntim96.github.io/JSCover/)
• PhantomJS: a ‘headless’ JS environment --good for automatically running tests (http://phantomjs.org/)