Ruby with Cucumber
CHAPTER – 4
THE BASICS OF SEARCH ENGINE FRIENDLY DESIGN & DEVELOPMENT
Copyright @ 2019 Learntek. All Rights Reserved. 3
Ruby Cucumber Training : Introduction to BDD and
Cucumber
What is BDD?
Ruby Cucumber Training : BDD stands for Behaviour-Driven Development.
BDD was conceived by Dan North in 2003
BDD uses natural language to describe the “desired behavior” of the system, that
can be understood by both the developer and the customer.
Gives us an opportunity to create test scripts from both the developer’s and the
customer’s prospective as well.
Copyright @ 2019 Learntek. All Rights Reserved. 4
What is Cucumber?
Cucumber is a command-line tool. When you run it, it reads in your specifications
from plain-language text files called features, examines them for scenarios to test,
and runs the scenarios against your system. Each scenario is a list of steps for
Cucumber to work through. So that Cucumber can understand these feature files,
they must follow some basic syntax rules. The name for this set of rules is Gherkin.
Why Cucumber?
Cucumber supports Behavior Driven Development (BDD) framework. Cucumber
allows automation functional validation that is easily read and understood.
Cucumber was initially implemented in Ruby and then extended to Java framework.
Copyright @ 2019 Learntek. All Rights Reserved. 5
Cucumber benefits?
It is an Open Source Tool
Plugin in cucumber works faster
Cucumber supports other language as well beyond Ruby like Java, Groovy, .Net etc.
Involve business stakeholders who cannot easily read code
Cucumber focuses on end-user experience
Style of writing tests allow for easier reuse of code in the tests
Quick and easy set up and execution
Efficient tool for testing
Cucumber supports many
Copyright @ 2019 Learntek. All Rights Reserved. 6
Capybara
Introduction to Capybara
Capybara is an Acceptance test framework for web applications. It integrates with
Cucumber and hides the details of controlling a browser behind an API. It simulates
how a user would interact with a website.
Install Capybara
Capybara settings
Capybara functions Various capybara functions with examples
Copyright @ 2019 Learntek. All Rights Reserved. 7
Introduction to Poltegriest, PhantomJs and Gems
Poltergriest:
Poltergeist is another headless driver which integrates Capybara with PhantomJS.
After registering Poltergeist as the driver in Capybara we need not interact directly
with Poltergeist nor PhantomJS, only with the Capybara API.
PhantomJS:
It is a headless, full featured browser. It is based on WebKit and supports all
important web standards (CSS, JavaScript, …). It is ideally suited for automated
website tests.
Copyright @ 2019 Learntek. All Rights Reserved. 8
Gems:
Ruby Gems is a package manager for the Ruby programming language that
provides a standard format for distributing Ruby programs and libraries. Each gem
has a name, version, and platform.
Copyright @ 2019 Learntek. All Rights Reserved. 9
Cucumber installation
Cucumber installation
Introduction to Cucumber Gherkin
Gherkin Keywords
• Scenario
• Feature
• given
• When
• Then
• Tagging
• Background
• Scenario Outline
Copyright @ 2019 Learntek. All Rights Reserved. 10
Introduction to Ruby
Installing Ruby
Installing Devkit
Ruby Editor
Programming basic concepts
Ruby Data Types
Ruby Variables
Ruby Operators
Ruby Basics
Control Structures
Loop Structures While and For
Copyright @ 2019 Learntek. All Rights Reserved. 11
Ruby Advanced
Strings
Array
Regular Expressions
Ruby Advanced Topics
Files and IO
Methods
Exception Handling
Copyright @ 2019 Learntek. All Rights Reserved. 12
Ruby-Cucumber Framework Creation
Config files creation
Support files creation
Driver settings
Environment settings
BDD Creating and Executing Test
Feature File
Creation of Step Definition File
Execution
Results and Reports
Cucumber Tags
Copyright @ 2019 Learntek. All Rights Reserved. 13
Testing A Web Application using Ruby, Cucumber and Capybara
Introduction to Real Time Project and implementation
Creation of Feature and Step Definition File for test automation example
Execution
Result and Report
Error handling
Different kinds of error which you can encounter during automation
How to solve them easily
Good resources/help/forum to read
Interview Preparation
Copyright @ 2019 Learntek. All Rights Reserved. 14
For more Training Information , Contact Us
Email : info@learntek.org
USA : +1734 418 2465
INDIA : +40 4018 1306
+7799713624

Ruby with cucmber

  • 1.
  • 2.
    CHAPTER – 4 THEBASICS OF SEARCH ENGINE FRIENDLY DESIGN & DEVELOPMENT
  • 3.
    Copyright @ 2019Learntek. All Rights Reserved. 3 Ruby Cucumber Training : Introduction to BDD and Cucumber What is BDD? Ruby Cucumber Training : BDD stands for Behaviour-Driven Development. BDD was conceived by Dan North in 2003 BDD uses natural language to describe the “desired behavior” of the system, that can be understood by both the developer and the customer. Gives us an opportunity to create test scripts from both the developer’s and the customer’s prospective as well.
  • 4.
    Copyright @ 2019Learntek. All Rights Reserved. 4 What is Cucumber? Cucumber is a command-line tool. When you run it, it reads in your specifications from plain-language text files called features, examines them for scenarios to test, and runs the scenarios against your system. Each scenario is a list of steps for Cucumber to work through. So that Cucumber can understand these feature files, they must follow some basic syntax rules. The name for this set of rules is Gherkin. Why Cucumber? Cucumber supports Behavior Driven Development (BDD) framework. Cucumber allows automation functional validation that is easily read and understood. Cucumber was initially implemented in Ruby and then extended to Java framework.
  • 5.
    Copyright @ 2019Learntek. All Rights Reserved. 5 Cucumber benefits? It is an Open Source Tool Plugin in cucumber works faster Cucumber supports other language as well beyond Ruby like Java, Groovy, .Net etc. Involve business stakeholders who cannot easily read code Cucumber focuses on end-user experience Style of writing tests allow for easier reuse of code in the tests Quick and easy set up and execution Efficient tool for testing Cucumber supports many
  • 6.
    Copyright @ 2019Learntek. All Rights Reserved. 6 Capybara Introduction to Capybara Capybara is an Acceptance test framework for web applications. It integrates with Cucumber and hides the details of controlling a browser behind an API. It simulates how a user would interact with a website. Install Capybara Capybara settings Capybara functions Various capybara functions with examples
  • 7.
    Copyright @ 2019Learntek. All Rights Reserved. 7 Introduction to Poltegriest, PhantomJs and Gems Poltergriest: Poltergeist is another headless driver which integrates Capybara with PhantomJS. After registering Poltergeist as the driver in Capybara we need not interact directly with Poltergeist nor PhantomJS, only with the Capybara API. PhantomJS: It is a headless, full featured browser. It is based on WebKit and supports all important web standards (CSS, JavaScript, …). It is ideally suited for automated website tests.
  • 8.
    Copyright @ 2019Learntek. All Rights Reserved. 8 Gems: Ruby Gems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries. Each gem has a name, version, and platform.
  • 9.
    Copyright @ 2019Learntek. All Rights Reserved. 9 Cucumber installation Cucumber installation Introduction to Cucumber Gherkin Gherkin Keywords • Scenario • Feature • given • When • Then • Tagging • Background • Scenario Outline
  • 10.
    Copyright @ 2019Learntek. All Rights Reserved. 10 Introduction to Ruby Installing Ruby Installing Devkit Ruby Editor Programming basic concepts Ruby Data Types Ruby Variables Ruby Operators Ruby Basics Control Structures Loop Structures While and For
  • 11.
    Copyright @ 2019Learntek. All Rights Reserved. 11 Ruby Advanced Strings Array Regular Expressions Ruby Advanced Topics Files and IO Methods Exception Handling
  • 12.
    Copyright @ 2019Learntek. All Rights Reserved. 12 Ruby-Cucumber Framework Creation Config files creation Support files creation Driver settings Environment settings BDD Creating and Executing Test Feature File Creation of Step Definition File Execution Results and Reports Cucumber Tags
  • 13.
    Copyright @ 2019Learntek. All Rights Reserved. 13 Testing A Web Application using Ruby, Cucumber and Capybara Introduction to Real Time Project and implementation Creation of Feature and Step Definition File for test automation example Execution Result and Report Error handling Different kinds of error which you can encounter during automation How to solve them easily Good resources/help/forum to read Interview Preparation
  • 14.
    Copyright @ 2019Learntek. All Rights Reserved. 14 For more Training Information , Contact Us Email : info@learntek.org USA : +1734 418 2465 INDIA : +40 4018 1306 +7799713624