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
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...