AimdekTechnologies
75 views
20 slides
Nov 03, 2020
Slide 1 of 20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
About This Presentation
Learn how to develop Cucumber based automation
-TDD
-BDD
-Cucumber
-Gherkin
-Feature
-Scenario
Size: 6.13 MB
Language: en
Added: Nov 03, 2020
Slides: 20 pages
Slide Content
WWW.AIMDEK.COM Testing with Cucumber Developing Cucumber based automation By: Devarshi Chokshi
Agenda TDD BDD Cucumber Gherkin Feature Scenari
Interlink between TDD, BDD & Cucumber
What is TDD? TDD is an innovative software development approach where tests are written, before writing the bare minimum of code required for the test to be fulfilled.
Advantage of TDD over Traditional Approach In the traditional development approach first, you select a user story, then develop it, run tests over it and refactor the code until the test is passed. In this method, the coding is done before testing. The disadvantage of using this approach is that you are unable to discover the errors or missing cases until the functionality has been fully developed. With TDD, you write tests upfront for functions that doesn’t yet exist. You know that the test will certainly fail at the start, but minimal incremental coding at each stage will make sure it will eventually pass at some point. So, this process makes sure you won’t miss any scenarios once the functionality is fully finished.
What is BDD? BDD Stands for Business Driven Development. Behavioral Driven Development (BDD) is a software development approach that has evolved from TDD (Test Driven Development) but differs by being written in a shared language, which improves communication between tech and non-tech teams and stakeholders.
What is Cucumber? Cucumber is the open source tool that is used by the Industry to test software. Cucumber is a high-level testing framework that supports behavior driven development (BDD). Cucumber is a way of taking features , which is the combination of scenarios written in plain English language using a simple grammar defined by a language called gherkins .
What is Cucumber? The Feature File is then share between developers, tester, business analyst, product owner. Features - Scenarios - Steps - Gherkins Glue Code - Step Definition - Ruby - java - C# Application
Gherkin,Feature,Scenario,FeatureFile So we gather features from user and write them down using gherkin language in feature file. Features is the combination of the Scenario.
Gherkin Language Gherkins is the language that cucumber understands, it is a business Readable, domain specific language that lets you describe software behavior with out detailing its implementation. Gherkins serves two purposes- Documentation and automated testes. Single Gherkin source file contains a description of a single feature. Source files have .feature extension.
Feature It can be defined as a standalone unit or functionality of a project. Ex Login Functionality One Feature File contain many scenario.
Scenario Scenario is one of the most important part of the Cucumber. Scenario is just like test case. Ex:Successful Login
How to write Scenario? We can write the scenario using GIVEN,WHEN THEN and AND. Given When THEN and AND are Cucumber nomenclature .
GIVEN,WHEN,THEN & AND GIVEN: we used GIVEN for any prequestie. Ex:GIVEN user is in the login page WHEN:It is like an trigger point. Ex:WHEN user enter the correct username and password THEN:It describe what the output should be. Ex:THEN user should login successful AND:It provide the logical AND operation. Ex:AND user enter the correct password
Example of the Feature File Feature: Login Profile Scenario: Successful login When I fill in " Username " with " Test " And I fill in " Password " with " 123 " And I click on the " Log In " button Then I am on the " My profile " page on URL " www.mycompany.com/myprofile " And I should see " Welcome to your profile " message And I should see the " Log out " button
New Interlink Image
Why we use Cucumber?
What we have covered till now? Your Project Features Scenarios Steps Step Definitions Support Code Automation Library Your System Business Facing Technical Facing