The introductory course that takes you from beginner through to writing effective Feature Files and then Automating them using WebDriver JavaScript
Recommended for anyone new to BDD and Cucumber.
This comprehensive course covers all the essential principles to get you up and running in Behaviour-Driven Development of Cucumber and WebDriver JavaScript Tests.
Designed for beginners of BDD and Cucumber, it takes the new-comer through all the basic techniques of writing Feature Files in Gherkin, to writing the associated Step Definitions and code in Cucumber & WebDriver to executing from the command line.
Throughout the course practical examples are demonstrated, and the delegates get to practice what they have learned in each chapter against a Web training application.
The course uses: Visual Studio Code, cucumber-js, WebDriver JS, Chai, NodeJS, NPM
Learning Objectives
- understand the required installs and packages to use Cucumber
- understand how to structure your automated Cucumber project
- gain a full understanding of how to write good Gherkin and Step Definitions
- Understand how to refactor and re-use common Methods for Steps
- By the end of the course you should have a thorough understanding of how to develop well-written Feature Files and Scenarios, How to manage Step Definitions and write associated Methods, how to organise the Cucumber project and how to integrate into the POM framework
Pre-Requisites
- A basic understanding of writing Selenium WebDriver JavaScript Tests or attended our WebDriver JS course.
- Some programming experience would be advantageous - the course is based on using WebDriver JavaScript & Chai with NodeJS, but does not teach you JavaScript as you can use a variety of programming languages with WebDriver and Cucumber.
Course Content
Introduction to BDD
A background to BDD and its benefits. The process of BDD. An overview of the tools available, terminology.
Introduction to Gherkin
Feature Files, introduction to the Gherkin language, basic syntax
More Gherkin
Using the Background fixture, Parameters, Doc Strings, Examples and Data Tables, using Tags to organise execution, commenting
Installation of the Cucumber Framework
Installing Cucumber with npm. Creating a project structure, creating a Feature, execution of Feature Files
Step Definitions & Code Binding
Using prototype step definitions, creating step definition Methods, expanding Methods with Parameters, Step Definition syntax, using Regular Expressions
Running the Cucumber Tests
Using Cucumber Command Line Interface, CLI parameters, Results & Reporting, HTML reports
Hooks
Using Hooks in cucumber-js (BeforeAll, Before, After, AfterAll), Cucumber Timeouts
The Cucumber World Object
Attaching items to World, Creating your own custom World Constructor
Tables & Scenario Outlines
In-line Step Table Iterating, Scenario Outline Data Handling
Integrating Cucumber into the POM
Using Cucumber & WebDriver under the Page Object Model. Using Helpers
VS Code Tips
Cucumber Icon Packs, Setting up GoTo Definitions Shortcut, Debugging scripts