O'Reilly logo

Jasmine Cookbook by Munish Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing Jasmine specs with Web/HTML

In Chapter 2, Jasmine with TDD and BDD Processes, we learned how to write incremental code with the BDD approach. In this recipe, we will learn how to develop a web application with HTML and JavaScript using the BDD approach. We will also look at how to write Jasmine specs with HTML and manipulate DOM to test the application from an E2E perspective.

The scope of this recipe is to implement Jasmine specs for both the scenarios described in the previous recipe, Defining Jasmine specs corresponding to user story.

Getting ready

To understand how to implement Jasmine specs with Web/HTML, let's create the TaxCalculator.html file using the following HTML code:

<!DOCTYPE html> <html> <head> <title>Tax Calculator</title> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required