BPB Online LLP
Mastering Behavior-Driven Development Using Cucumber
Mastering Behavior-Driven Development Using Cucumber
US$ 19.95
The publisher has enabled DRM protection, which means that you need to use the BookFusion iOS, Android or Web app to read this eBook. This eBook cannot be used outside of the BookFusion platform.
Description
Contents
Reviews

Master the skills required to effectively use Cucumber BDD which simplifies Agile development and fast-paced time-to-market

Key Features
● A step-by-step explanation of each component of the Cucumber framework.
● Expert coverage on speeding up the implementation of the Cucumber framework.
● Includes Parallel Execution, Cloud Testing, Explore Gherkin, and many more.

Description
In this book, readers will learn everything they need to know about Behavior-Driven Development (BDD) and a framework used for automation testing for BDD.

The book is divided into three sections. The first section covers the building blocks of Cucumber such as Feature files, Step Definition classes, and Runner classes, among other things. These will serve as the building blocks for becoming more familiar with Cucumber.

The second section covers the Page Object design pattern and Page Factories, both of which are useful in developing robust frameworks.

The final section demonstrates Cucumber's integration with TestNG and Maven. We will be putting each Maven build in Jenkins and configuring Jenkins to trigger automatically when a development build is completed. After reading this book, the test engineer will understand the concept of incorporating Cucumber as a BDD framework into his testing.

What you will learn
● Understand the fundamentals of Test-Driven Development and Behavior-Driven Development.
● Investigate Cucumber's building blocks such as Feature Files and Step Definition Files.
● Learn the Base Class and inheritance concept within the Page Object Model Framework.
● Create a TestNG XML that calls the test runner class.

Who this book is for
This book is aimed at individuals who have a firm grasp of the fundamentals of Java and are interested in improving their knowledge of the BDD framework.
Table of Contents
Section 1: Understanding the Cucumber framework
Chapter 1: Introduction to Behavior-Driven Development
Chapter 2: Understanding Feature Files
Chapter 3: Understanding Step Definition files
Chapter 4: Learning about the TestRunner

Section 2: Learning the Page Object Design Pattern
Chapter 5: Understanding the Page Object Model and Creating Page Objects
Chapter 6: Understanding Page Factories and Creating Page Factories

Section 3: Integration with TestNG, Maven, and Jenkins
Chapter 7: Configuring the TestNG Framework
Chapter 8: Configuring Maven and Learning about POM.xml
Chapter 9: POM.xml Execution from Eclipse and Command Line
Chapter 10: Configuring POM.xml to Trigger TestNG xml
Chapter 11: Configuring the Runner Class for Cucumber Reporter Plugin
Chapter 12: Reporting Using Extent Reports
Chapter 13: Parallel Execution Using Selenium Grid
Chapter 14: Integration with Jenkins
About the Authors
Pinakin Chaubal is a BE (Computer Science) with 19+ years of experience in the IT area. He has done PMP, ISTQB, HP0-M47 (QTP 11.0 Functional testing expert), and INS-21(General Insurance). He is working as an Automation Architect at Intellect Design Arena Ltd. (Previously, Polaris Consulting). Previously, he worked with companies like Patni, Accenture, ACS International (USA), L&T Infotech (USA & India), Polaris Financial Technology, and SQS. He carries 6 years of onsite experience in the US and 8 months in Hong Kong and China working closely with the client and getting involved in senior management and stakeholder meetings. The clients that he has worked for are YES Bank, HSBC, Travelers Insurance, Harleysville Insurance, Albertsons retail chain, Bellsouth Telecommunications GE-Fleet Services, and GE-Supply.

LinkedIn Profile: https://www.linkedin.com/in/pinakin-chaubal-300b372/
Blog Link: //www.youtube.com/channel/UCkkh8bX1KS5iaORXX23P8ZA

Language
English
ISBN
9789391030476
Cover Page
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewers
Acknowledgement
Preface
Errata
Table of Contents
1. Introduction to Behavior Driven Development
Objective
1.1 What is TDD?
1.1.1 Steps involved in a TDD
1.2 What is BDD?
1.3 What is Cucumber?
1.3.1 Structure of Cucumber
1.4 Understanding the DRY principle
1.5 Components of Cucumber Framework
1.5.1 Runner class
1.5.2 Feature Files
1.5.3 Step Definition Files
1.6 Design pattern
1.7 Driving the Framework
1.8 Configuring a Maven Project in Eclipse
1.8.1 A look at pom.xml
1.9 Installing TestNG in Eclipse
1.10 Structure of the Framework
Conclusion
Questions
2. Understanding Feature Files
Objectives
2.1 What are feature files?
2.1.1 Creating feature files in IDE
2.1.1.1 Cucumber Eclipse plugin
2.2 Introducing feature, scenario, and scenario outline
2.2.1 Feature
2.2.2 Scenario
2.2.3 Scenario Outline
2.3 Understanding the different keywords
2.4 Reusing the same step with different arguments
2.5 Using complex data types
2.6 Understanding DocStrings
2.7 Background Script
2.8 Feature files in a different language
2.9 Designing complex feature files
2.10 Understanding Cucumber tags
Conclusion
Questions
3. Step Definitions
Objectives
3.1 What are Step Definitions?
3.1.1 Auto generating the Step Definition code in an IDE
3.2 Understanding optional Capture/Non-Capture groups
3.2.1 Capture groups
3.2.2 Non-Capture groups
3.3 Handling string and integer arguments
3.4 Implementing Data Tables
3.5 Handling DocStrings
3.6 Handling Scenario Outline Data Tables
3.7 Duplicate Step Definitions
3.8 Cucumber Hooks
Conclusion
Questions
4. Learning About the Test Runner
Structure
Objectives
4.1 What is the Singleton Pattern?
4.2 Introduction to the ThreadLocal class in Java
4.3 Introducing the WebDriverManager library
4.4 Design a Singleton WebDriver using the WebDriverManager library
4.4.1 Private Constructor
4.4.2 Fetching the Singleton class instance
4.4.3 Setting the Driver and its preferences
4.4.4 Fetching the WebDriver instance
4.4.5 Closing the browser session
4.5 Introduction to the GLOBAL_DATA class
4.6 Introduction to the Test Runner class
4.7 Instantiating the Chrome browser instance
4.8 Opening the browser of your choice
4.9 Quitting the driver instance
4.10 Introduction to Tags in TestRunner
4.11 Designing Test Suites with the help of tags
Conclusion
Questions
5. The Page Object Model Without Page Factory
Structure
Objectives
5.1 Understanding the Page Object Design Pattern
5.2 What is the Page Object Model?
5.3 Introducing the BY class
5.4 Designing a login scenario
5.5 Creating the Page Objects
5.5.1 Creating the Abstract Base Page
5.5.2 Creating the Landing Page
5.5.3 Creating the login page
5.5.4 Creating the Home Page
5.6 Step definitions for the pages
5.6.1 Landing Page Step definition
5.6.2 Login Page Step Definition
5.6.3 Home Page step definition
5.7 Verification of text on a page using the Assert class
Conclusion
Questions
6. Learning About the Page Object Model Using Page Factory
Objectives
6.1 Understanding the Page Factory Design pattern
6.2 Learning about the PageFactory class
6.3 Introducing the @FindBy, @FindBys, and @FindAll annotations
6.3.1 The @FindBy annotation
6.3.2 The @FindBys annotation
6.3.3 The @FindAll annotation
6.4 Understanding the initElements method
6.5 Designing the Page Factory framework
6.6 Designing a Login scenario
6.7 Creating the Page Locators using @FindBy
6.7.1 Creating the Landing Page Locators
6.7.2 Creating the Login Page locators
6.7.3 Creating the Home Page locators
6.8 Creating the Page Objects
6.8.1 Creating the Abstract Base Page
6.8.2 Creating the Landing Page
6.8.3 Creating the Login page
6.8.4 Creating the Home page
6.9 Step definitions for the pages
6.9.1 Landing page step definition
6.9.2 Login page step definition
6.9.3 Home page step definition
6.10 Understanding the @CacheLookup annotation
Conclusion
Questions
7. Configuring the TestNG Framework
Objectives
7.1 Introduction to the TestNG framework
7.2 Configuring the TestNG framework in Eclipse
7.3 Glimpse of the TestNG XML
7.4 Various annotations in TestNG
7.5 A look at the updated HomePage pageobject and step definitions
7.6 Executing the Test Runner from the TestNG XML
Conclusion
Questions
8. Configuring Maven and Learning About POM.xml
Objectives
8.1 Downloading and extracting Maven
8.2 Configuring M2_HOME and path environment variables
8.3 Understanding Maven local and central repositories
8.4 Learning about Maven build lifecycle phases and goals
8.5 Understanding the pom.xml
8.6 Learning about Maven profiles
8.7 Adding a new Maven profile
8.8 Learning the important Maven plugins
8.9 Dependency management in Maven
Conclusion
Questions
9. Test Execution with Maven and Log4J
Structure
Objectives
9.1 Understand the Log4J framework
9.2 Create a generic class for logging
9.2.1 Create a log4j.properties file
9.3 Invoke the custom logger from the page objects
9.4 Compile from Eclipse
9.5 Executing the Compile from the command line
Conclusion
Questions
10. Configuring POM.XML to Trigger TestNG.XML
Structure
Objectives
10.1 Understand the Maven Surefire plugin
10.2 Configure the pom for using the Surefire plugin
10.3 Executing the pom.xml and the tests from Eclipse
10.4 Executing the pom.xml and the tests from the Command Line
10.5 Examining the Surefire reports
10.6 Skipping Tests
Conclusion
Questions
11. Configuring the Runner Class for the Cucumber Reporter Plugin
Structure
Objectives
11.1 Understanding the <testFailureIgnore> tag
11.2 Understand the maven-cucumber-reporting plugin
11.3 Capturing screenshots of failed scenario steps
11.4 Modifying the Test Runner for Cucumber JVM reports
11.5 Creating Feature files with multiple scenarios
11.6 Changing the modules related to Home Page
11.6.1 Modifications in the HomepageLocators.java
11.6.2 Modifications in the HomePageStepDef.java
11.7 Executing the multiple feature files with the help of tags
11.8 Examining the Cucumber-JVM reports
11.8.1 Examining the HappyFlowFeaturePF-feature.html
11.8.2 Examining the HappyFlowFeatureNF-feature.html
11.8.3 Examining the Sanity1.html
11.8.4 Examining the feature-overview.html
Conclusion
Questions
12. Reporting Using Extent Reports
Structure
Objectives
12.1 Introduction to Extent reports
12.1.1 Advantages of Extent reports
12.1.2 Components of Extent reports
12.2 Maven dependency for Extent reports
12.3 Creating a class for generating Extent reports
12.4 Creating a helper class for taking screenshots
12.5 Create a base steps class for declaring required variables
12.6 Changes to the Before and After Hooks
12.6.1 Changes to the Before Hook
12.6.2 Changes to the After Hook
12.7 Execution of the flows and generating the reports
Conclusion
Questions
13. Parallel Execution Using Selenium Grid
Structure
Objectives
13.1 Understand parallel execution
13.2 Understanding Synchronized methods
13.3 Creating an Extent Manager class
13.4 Creating an Extent Test class
13.5 Changes to the testng.xml for parallel execution
13.6 Changes to the Step Definitions for logging
13.7 Looking at the SingletonDriver code
13.8 Improved versions of the Before and After Hooks
13.9 Executing the test to generate the reports
13.10 Introduction to Remote Web Driver
13.11 Learning about the Selenium standalone server
13.12 Introduction to Selenium Grid
13.12.1 Introduction to the Hub
13.12.2 Introduction to the Node
13.13 Changes to the feature files and Test Runner
13.14 Executing the test cases on the configured grid
Conclusion
Questions
14. Integration with Jenkins
Structure
Objectives
14.1 Introduction to Jenkins
14.2 Download the jenkins.war file
14.3 Starting Jenkins
14.4 Installing required plugins
14.4.1 Maven integration plugin
14.4.2 HTML publisher plugin
14.5 Creating the very first Maven job in Jenkins
14.6 Executing the build from Jenkins
14.7 Viewing the Extent reports in Jenkins
Conclusion
Questions
Index

Loading...