Panos Matsinopoulos

Practical Test Automation

Learn to Use Jasmine, RSpec, and Cucumber Effectively for Your TDD and BDD

1st ed.
Panos Matsinopoulos
KERATEA, Greece
ISBN 978-1-4842-6140-8e-ISBN 978-1-4842-6141-5
© Panos Matsinopoulos 2020
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

Dedicated to my wife, Matina

Introduction

Part of developing an application is writing a set of automated tests. In fact, you should write them first, before the core code of your application. These tests function as a specification of the requirements of your application – what your application should be doing. They also function as a documentation of what your application is doing. In other words, they play a very important role, both before the actual implementation and after you deliver your application to your end users. And they have to be automated, that is, to be executed by a computer, not by a human.

Do you have the tools to write the automated tests, in such a way that they will cover both of these two needs, the specification of the requirements and the documentation of your application?

Absolutely yes!

And this book is all about it. It covers a series of such tools, both for the front-end developer and the back-end developer. And it follows a very practical approach. You develop a project, and you do it the right way: TDD and BDD, that is, Test-Driven and Behavior-Driven Development.

Moreover, although it is presenting its material using specific tools, the techniques that you learn can be applied to any other test automation tool that you might happen to work with.

Audience

This book is aimed at developers who know JavaScript and Ruby and want to improve their test-writing skills.

Contents of This Book

  • Chapter 1, “Introduction to Jasmine”: This chapter introduces you to Jasmine, a very popular JavaScript testing framework.

  • Chapter 2, “Advanced Jasmine”: This chapter continues your level-up on Jasmine by presenting its more advanced features.

  • Chapter 3, “Using Minitest”: In this chapter, you learn about minitest. This tool is the usual tool a Ruby developer writes their first automated tests with.

  • Chapter 4, “Introduction to RSpec”: In this chapter, you learn about RSpec, a very popular Ruby testing framework.

  • Chapter 5, “Useful RSpec Tools”: In this chapter, you continue to learn about the tools that RSpec is offering to you. RSpec is very feature rich.

  • Chapter 6, “Introduction to Cucumber”: In this chapter, you are introduced to BDD with Cucumber and Gherkin.

  • Chapter 7, “Advanced Cucumber": In this chapter, you learn more advanced Cucumber techniques and develop a bigger project.

Conventions Used in This Book

This book has the following typographical conventions:
Constant width
It is used inside code snippets and listings and to indicate variables, functions, types, parameters, objects, and other programming, coding-related constructs.
Constant width in Bold

It is used inside code snippets and listings to indicate the code parts that you need to pay more attention to.

$

The symbol $ is used to denote an Operating System shell prompt, that is, where you should type a command that will be executed by your Operating System. For example, if you work with a Mac OS, you can open a terminal and type the command that follows this symbol.

Using Code Listings

All the code listings of this book are available for download at https://github.com/Apress/practical-test-automation .

Table of Contents
Index 311
About the Author
Panos Matsinopoulos
../images/497830_1_En_BookFrontmatter_Figb_HTML.jpg

loves developing programs, both for web browsers and for mobile apps. He has been doing that for the last 25 years and has developed numerous applications. He also loves writing books, blogging, and teaching computer programming. He has organized a lot of programming classes for kids, adults, and elderly people. You can read more about him on his LinkedIn profile (www.linkedin.com/in/panayotismatsinopoulos ) and find him on Twitter (@pmatsino).

 
About the Technical Reviewer
Alexander Chinedu Nnakwue
../images/497830_1_En_BookFrontmatter_Figc_HTML.jpg

has a background in mechanical engineering from the University of Ibadan, Nigeria, and has been a front-end developer for over 3 years working on both web and mobile technologies. He also has experience as a technical author, writer, and reviewer. He enjoys programming for the Web, and occasionally, you can also find him playing soccer. He was born in Benin City and is currently based in Lagos, Nigeria.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.120.109