SlideShare a Scribd company logo
COOL AS A CUCUMBER
QA FEST
2014
04.11.2014 / 2
Gherkin COBOL
(COmmon Business-Oriented Language)
WHAT IS IT?
04.11.2014 / 3
Gherkin
04.11.2014 / 4
Feature: Short summary title
As a common user
I want to be able to do something
So that I have a profit
Scenario: Particular case
Given some precondition
And some other precondition
When some action is done by user
And some other action
And yet another action
Then some testable outcome is achieved
And something else we can check happens too
Prepare Act Assert
Step Definitions & Runners
04.11.2014 / 5
package myprecious.tests.cucumber.steps;
public class CertainSteps {
@Given("^some precondition$")
public void step_definition() {
... //My code here
}
@When("^some action is done by user$")
public void some_action_is_done {
... //Some Selenium here
}
...
package myprecious.tests.cucumber.runners;
@RunWith(Cucumber.class)
@Cucumber.Options(
tags = {"~@skipped", "~@inProgress", "~@current"},
strict = true,
format = { "json:target/cukes.json"},
monochrome = true,
glue = {"myprecious.tests.cucumber.steps",
" myprecious.tests.cucumber.hooks"})
public class LetTehTestsOut {
}
regular expressions
only informative role
locations for test parts
“features” is separate one
@runMe
~@dontRunMe
reporting options
@tag
Scenario: Particular case
Given some precondition
WHAT CAN
A SCENARIO
DO?
04.11.2014 / 6
Hooks
04.11.2014 / 7
Feature: Payment operations
@ui
Scenario: Make payment using current card
Given I have logged
And I have selected card
...
@service
Scenario: Get internal payment info
Given I have submitted payment :
...
public class TaggedHooks {
@Before("@ui")
public void startUpUi() {
//open browser ...
}
@After("@ui")
public void clearUi(Scenario scenario) {
if (scenario.getStatus().equals("failed")) {
byte[] screenshot = ((TakesScreenshot)driver).
getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
}
OR (“@ui, @service”)
AND ({“@ui”, “@service”})
only scenario status
if few, executed in backward order
~ works
here too
Feature: Card operations
Scenario: Change PIN successfully
Given I am on account main page
And I select my card from list
And I enter the correct PIN
When I change the PIN to 9876
Then the system should know my new PIN is 9876
Scenario: Transaction list
Given I am on account main page
And I select my card from list
And I enter the correct PIN
And card was used at least once
When I click info panel
Then list of transactions is shown
Scenario: Print card information
Given I am on account main page
And I select my card from list
And I enter the correct PIN
When I click print button
Then page with card information is shown
And it contains card account number
Background
04.11.2014 / 8
Feature: Card operations
Background: User selected a card
Given I am on account main page
And I select my card from list
And I enter the correct PIN
Scenario: Change PIN successfully
When I change the PIN to 9876
Then the system should know my new PIN is 9876
Scenario: Transaction list
Given card was used at least once
When I click info panel
Then list of transactions is shown
Scenario: Print card information
When I click print button
Then page with card information is shown
And it contains card account number
Examples
04.11.2014 / 9
Feature: User registration
Scenario: Tooltips for email registration
Given I am on quick registration form
When I fill "Email" field with ""
And I click somewhere else
Then I should see error message "Email cannot be blank"
When I fill "email" field with "darth.vader"
And I click somewhere else
Then I should see error message "Please input valid Email address"
When I fill "email" field with "admin@domain.com"
And I click somewhere else
Then I should see error message "Email has already been taken"
When I fill "password" field with ""
And I click somewhere else
Then I should see error message "Password cannot be blank"
When I fill "password" field with "asdf"
And I click somewhere else
Then I should see error message "Password is too short"
Feature: User registration
Scenario Outline: Tooltips for email registration
Given I am on quick registration form
When I fill "<field_name>" field with "<value>"
And I click somewhere else
Then I should see error tooltip "<error_message>"
Examples:
| field_name | value | error_message |
| Email | | Email cannot be blank |
| Email | luke.skywalker | Please input valid Email address |
| Email | admin@domain.com | Email has already been taken |
| Password | | Password cannot be blank |
| Password | asdf | Password is too short |
WHAT CAN
A STEP DEFINITION
DO?
04.11.2014 / 10
Usual variables
04.11.2014 / 11
When I select 28 as a "delivery date"
@When("^I select (d+) as a "(.+)"$")
public void stepDefA(int number, String controlName){
Given months "September,July,March" are checked
@Given("^months "(.+)" are checked$")
public void stepDefB(List<String> monthNames){
Given delivery date is “28-02-2014"
@Given("^delivery date is "(d{2}-d{2}-d{4})"$")
public void stepDefC(@Format("dd-MM-yyyy") Date today) {
Then payment is updated in DB2 database
@Then("^payment is updated in (DB2|Oracle) database$")
public void stepDefD(String dbName){
Then error dialog is shown again
@When("^error dialog is shown(?: again)?$")
public void stepDefE(){
Multiline text
04.11.2014 / 12
Then informational message is shown:
"""
Welcome to the Cosa Nostra card activation system.
=======
If you would like us to take care of these losers before they cause you
any trouble, please proceed to payment card information menu.
"""
Given I have a user account "Test Testersen"
When it is granted <Role> rights
And I submit a support request
Then I should receieve an email:
"""
Dear T. Testersen,
Unfortunately all our specialists are busy.
Please <Action> <Person> in order to get further help
with Your issue.
Thank You for using our service.
"""
Examples:
| Role | Action | Person |
| customer | call | customer support team |
| customer support | email | service operations team |
| service operations | brace | yourself |
@Then("^informational message is shown:$")
public void info_message_shown(String messageText) {
Data tables
04.11.2014 / 13
Given following accounts already exist in DB:
| debitorName | debtorAddress1 | debtorPostCd | updateDate |
| "Anakin Skywalker" | "Sand str 8, 2" | "Tatooine" | <current> +1d |
| "R2D2" | "MISTY JUNGLE 1" | "DAGOBAH" | <current> -1d |
| "Qui-Gon Jinn" | "Shrine, apt. 63" | "Yavin 4" | <current> -3d |
| "Padme Amidala" | "Theed Royal Palace" | "Naboo" | <current> -3d |
| "Luke Skywalker" | "Misty Jungle 1" | "Dagobah" | <current> -1d |
| "Lando Calrissian" | "Building 2A, room 45" | "Bespin" | <current> -1d |
| "Han Solo" | "Deck 06A, 12" | "Hoth" | <current> +3d |
| "Leia Organa" | "Laser str. 13" | "Alderaan" | <current> -1d |
@Then("^following accounts already exist in DB:$")
public void stepDefA(DataTable accounts) {
@Then("^following accounts already exist in DB:$")
public void stepDefB(List<Map<String>> accounts) {
@Then("^following accounts already exist in DB:$")
public void stepDefC(List<AccountClass> accounts) {
@Then("^following accounts already exist in DB:$")
public void stepDefD(List<List<String>> accounts) {
HOW CAN WE MAKE IT BETTER?
04.11.2014 / 14
Integrate
04.11.2014 / 15
Maven failsafe plugin to launch the tests.
Test reports passed in json to Jenkins Cucumber report plugin.
Use the power
04.11.2014 / 16
Backgrounds, examples, regexps …
Given I am on the advanced search page
And I select "Endocrinology" from "Specialty"
And I choose "Yes" within "Accepts Insurance"
And I fill in "ZIP Code" with "90010"
And I select "5 miles" from "Search Radius"
When I press "Search"
When I search for a provider with the criteria:
| Provider Type | Doctor |
| Specialty | Endocrinology |
| Accepts Insurance | Yes |
| ZIP | 90010 |
| Search Radius | 5 miles |
When I search for a provider with the default criteria and:
| Specialty | Endocrinology |
| Accepts Insurance | No |
...
When I search for a provider with the default criteria
Then the search criteria should include:
| Provider Type | Doctor |
| Specialty | General |
| Accepts Insurance | Yes |
| ZIP | 90010 |
| Search Radius | 5 miles |
Use the power … of regexps?
04.11.2014 / 17
When I use email (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-
9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d-x7f]|[x01-
x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-
9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-
9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-
9]:(?:[x01-x08x0bx0cx0e-x1fx21-x5ax53-x7f]|[x01-x09x0bx0cx0e-x7f])+)])
When I am logged in
...
When I am logged in as "Joda"
@Then("^I am logged in$")
.* Anything or nothing
.+ Something
d* none or more digits
d+ some digits
"[^"]*" Something in quotes
an? Something optional
...
@When("^(?:I am logged|I log) in as an? "([^"]*)"$")
@Then("^(?:receipt has )?following payment (?:information|info) :$")
Choose your domain
04.11.2014 / 18
Scenario: User with valid credentials
Given an unauthenticated user
When the user tries to navigate to the welcome page
Then they should be redirected to the login page
When the user enters a valid name in the Name field
And the user enters the corresponding password in the Password field
And the user presses the Login button
Then they should be directed to the welcome page
• Security domain, user authentication
• Password based authentication domain
• UI widgets domain
• Domain of web assets
Scenario: User with valid credentials
Given an unauthenticated user
When the user tries to access a restricted asset
Then they should be directed to a login page
When the user submits valid credentials
Then they should be redirected back to the restricted content
• “WHAT”  User authentication domain
• “HOW” Web based security domain
Declarative vs. Imperative
04.11.2014 / 19
How exactly to do it ?What should be done?
Scenario: Successful login
Given a user "Smith" with password "qwerty"
And I am on the login page
And I fill in "User name" with "Smith"
And I fill in "Password" with "qwerty"
When I press "Log in"
Then I should see "Welcome, Smith"
Background:
Scenario: Successful login
Given a user "Smith" with password "qwerty"
And I am on the login page
And I fill in "User name" with "Smith"
And I fill in "Password" with "qwerty"
When I press "Log in"
Then I should see "Welcome, Smith"
Scenario: User is greeted upon login
Given the user "Smith" has an account
When he logs in
Then he should see "Welcome, Smith"
Background: The user is logged in
Given a logged in user
Feature: The System
Scenario: Everything Works
Given the system exists
When I use it
Then it should work, perfectly
WHEN DO WE
NEED IT?
04.11.2014 / 20
04.11.2014 / 21
Don’t use Cucumber unless you live in the magic kingdom
of non-programmers-writing-tests (and send me a bottle of
fairy dust if you’re there!)
~ David Heinemeier Hansson
1. Non-developers are involved too
 Product owner
 Test engineer
? Test automation engineer
2. Executable specification
3. BDD, TDD
 Specification, not script
 Abstract, declarative
 Shared language
 Key examples
Collaboration tool
Jira (Behave Plug-in), Cucumber Pro, Relish . . .
 Developer
Useful links and sources
Web
• github.com/cucumber/cucumber-jvm
• cukes.info/ – project page
• dannorth.net/archives/ – creator of BDD
• aslakhellesoy.com/ – framework creator
• agileforall.com/blog/ – usage examples
• cucumber.pro/ – Cucumber Pro + blog
Books
• The Cucumber Book – Wynne M, Hellesøy A, 2012
04.11.2014 / 22
04.11.2014 / 23
anna.gavriluk@iteraconsulting.com
Skype: angavriluk
THANKS FOR TRYING
TO STAY AWAKE

More Related Content

What's hot

Aesthetics and the Beauty of an Architecture
Aesthetics and the Beauty of an ArchitectureAesthetics and the Beauty of an Architecture
Aesthetics and the Beauty of an Architecture
Tom Scott
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
Wim Godden
 
Clojure workshop
Clojure workshopClojure workshop
Clojure workshop
Alf Kristian Støyle
 
TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI
yogita kachve
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
Christoffer Noring
 
Using Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your DataUsing Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your Data
MongoDB
 

What's hot (6)

Aesthetics and the Beauty of an Architecture
Aesthetics and the Beauty of an ArchitectureAesthetics and the Beauty of an Architecture
Aesthetics and the Beauty of an Architecture
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Clojure workshop
Clojure workshopClojure workshop
Clojure workshop
 
TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Using Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your DataUsing Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your Data
 

Similar to QA Fest 2014. Анна Гаврилюк. Cool as сucumber

Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
Atlassian
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
PyCon Italia
 
Behat: Beyond the Basics
Behat: Beyond the BasicsBehat: Beyond the Basics
Behat: Beyond the Basics
Jessica Mauerhan
 
When Cukes go sour...
When Cukes go sour...When Cukes go sour...
When Cukes go sour...
Leonard Fingerman
 
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and JasmineRails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Raimonds Simanovskis
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
Bachue Zhou
 
Writing Sensible Code
Writing Sensible CodeWriting Sensible Code
Writing Sensible Code
Anis Ahmad
 
Clean code
Clean codeClean code
Clean code
Roy Nitert
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
Ben Hall
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!
Boy Baukema
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
Domenic Denicola
 
ES3-2020-06 Test Driven Development (TDD)
ES3-2020-06 Test Driven Development (TDD)ES3-2020-06 Test Driven Development (TDD)
ES3-2020-06 Test Driven Development (TDD)
David Rodenas
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side Scripting
Lori MacVittie
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
Jonas De Smet
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
Lorenzo Dematté
 
Wireless pres ba
Wireless pres baWireless pres ba
Wireless pres ba
Monsur Ahmed Shafiq
 
Do more with less code in a serverless world
Do more with less code in a serverless worldDo more with less code in a serverless world
Do more with less code in a serverless world
jeromevdl
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
Michelangelo van Dam
 

Similar to QA Fest 2014. Анна Гаврилюк. Cool as сucumber (20)

Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
 
Behat: Beyond the Basics
Behat: Beyond the BasicsBehat: Beyond the Basics
Behat: Beyond the Basics
 
When Cukes go sour...
When Cukes go sour...When Cukes go sour...
When Cukes go sour...
 
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and JasmineRails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
Writing Sensible Code
Writing Sensible CodeWriting Sensible Code
Writing Sensible Code
 
Clean code
Clean codeClean code
Clean code
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
ES3-2020-06 Test Driven Development (TDD)
ES3-2020-06 Test Driven Development (TDD)ES3-2020-06 Test Driven Development (TDD)
ES3-2020-06 Test Driven Development (TDD)
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side Scripting
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Wireless pres ba
Wireless pres baWireless pres ba
Wireless pres ba
 
Do more with less code in a serverless world
Do more with less code in a serverless worldDo more with less code in a serverless world
Do more with less code in a serverless world
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 

More from QAFest

QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилинQA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QAFest
 
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The FutureQA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QAFest
 
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QAFest
 
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QAFest
 
QA Fest 2019. Никита Галкин. Как зарабатывать больше
QA Fest 2019. Никита Галкин. Как зарабатывать большеQA Fest 2019. Никита Галкин. Как зарабатывать больше
QA Fest 2019. Никита Галкин. Как зарабатывать больше
QAFest
 
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
QA Fest 2019. Сергей Пирогов. Why everything is spoiledQA Fest 2019. Сергей Пирогов. Why everything is spoiled
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
QAFest
 
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QA Fest 2019. Сергей Новик. Между мотивацией и выгораниемQA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QAFest
 
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QAFest
 
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QAFest
 
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QA Fest 2019. Иван Крутов. Bulletproof Selenium ClusterQA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QAFest
 
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QAFest
 
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QAFest
 
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automationQA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QAFest
 
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QAFest
 
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QAFest
 
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях ITQA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QAFest
 
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложенииQA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QAFest
 
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QAFest
 
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QAFest
 
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QAFest
 

More from QAFest (20)

QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилинQA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
 
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The FutureQA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
 
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
 
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
 
QA Fest 2019. Никита Галкин. Как зарабатывать больше
QA Fest 2019. Никита Галкин. Как зарабатывать большеQA Fest 2019. Никита Галкин. Как зарабатывать больше
QA Fest 2019. Никита Галкин. Как зарабатывать больше
 
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
QA Fest 2019. Сергей Пирогов. Why everything is spoiledQA Fest 2019. Сергей Пирогов. Why everything is spoiled
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
 
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QA Fest 2019. Сергей Новик. Между мотивацией и выгораниемQA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
 
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
 
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
 
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QA Fest 2019. Иван Крутов. Bulletproof Selenium ClusterQA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
 
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
 
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
 
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automationQA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
 
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
 
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
 
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях ITQA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
 
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложенииQA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
 
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
 
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
 
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
 

Recently uploaded

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

QA Fest 2014. Анна Гаврилюк. Cool as сucumber

  • 1. COOL AS A CUCUMBER QA FEST 2014
  • 2. 04.11.2014 / 2 Gherkin COBOL (COmmon Business-Oriented Language)
  • 4. Gherkin 04.11.2014 / 4 Feature: Short summary title As a common user I want to be able to do something So that I have a profit Scenario: Particular case Given some precondition And some other precondition When some action is done by user And some other action And yet another action Then some testable outcome is achieved And something else we can check happens too Prepare Act Assert
  • 5. Step Definitions & Runners 04.11.2014 / 5 package myprecious.tests.cucumber.steps; public class CertainSteps { @Given("^some precondition$") public void step_definition() { ... //My code here } @When("^some action is done by user$") public void some_action_is_done { ... //Some Selenium here } ... package myprecious.tests.cucumber.runners; @RunWith(Cucumber.class) @Cucumber.Options( tags = {"~@skipped", "~@inProgress", "~@current"}, strict = true, format = { "json:target/cukes.json"}, monochrome = true, glue = {"myprecious.tests.cucumber.steps", " myprecious.tests.cucumber.hooks"}) public class LetTehTestsOut { } regular expressions only informative role locations for test parts “features” is separate one @runMe ~@dontRunMe reporting options @tag Scenario: Particular case Given some precondition
  • 7. Hooks 04.11.2014 / 7 Feature: Payment operations @ui Scenario: Make payment using current card Given I have logged And I have selected card ... @service Scenario: Get internal payment info Given I have submitted payment : ... public class TaggedHooks { @Before("@ui") public void startUpUi() { //open browser ... } @After("@ui") public void clearUi(Scenario scenario) { if (scenario.getStatus().equals("failed")) { byte[] screenshot = ((TakesScreenshot)driver). getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png"); } OR (“@ui, @service”) AND ({“@ui”, “@service”}) only scenario status if few, executed in backward order ~ works here too
  • 8. Feature: Card operations Scenario: Change PIN successfully Given I am on account main page And I select my card from list And I enter the correct PIN When I change the PIN to 9876 Then the system should know my new PIN is 9876 Scenario: Transaction list Given I am on account main page And I select my card from list And I enter the correct PIN And card was used at least once When I click info panel Then list of transactions is shown Scenario: Print card information Given I am on account main page And I select my card from list And I enter the correct PIN When I click print button Then page with card information is shown And it contains card account number Background 04.11.2014 / 8 Feature: Card operations Background: User selected a card Given I am on account main page And I select my card from list And I enter the correct PIN Scenario: Change PIN successfully When I change the PIN to 9876 Then the system should know my new PIN is 9876 Scenario: Transaction list Given card was used at least once When I click info panel Then list of transactions is shown Scenario: Print card information When I click print button Then page with card information is shown And it contains card account number
  • 9. Examples 04.11.2014 / 9 Feature: User registration Scenario: Tooltips for email registration Given I am on quick registration form When I fill "Email" field with "" And I click somewhere else Then I should see error message "Email cannot be blank" When I fill "email" field with "darth.vader" And I click somewhere else Then I should see error message "Please input valid Email address" When I fill "email" field with "admin@domain.com" And I click somewhere else Then I should see error message "Email has already been taken" When I fill "password" field with "" And I click somewhere else Then I should see error message "Password cannot be blank" When I fill "password" field with "asdf" And I click somewhere else Then I should see error message "Password is too short" Feature: User registration Scenario Outline: Tooltips for email registration Given I am on quick registration form When I fill "<field_name>" field with "<value>" And I click somewhere else Then I should see error tooltip "<error_message>" Examples: | field_name | value | error_message | | Email | | Email cannot be blank | | Email | luke.skywalker | Please input valid Email address | | Email | admin@domain.com | Email has already been taken | | Password | | Password cannot be blank | | Password | asdf | Password is too short |
  • 10. WHAT CAN A STEP DEFINITION DO? 04.11.2014 / 10
  • 11. Usual variables 04.11.2014 / 11 When I select 28 as a "delivery date" @When("^I select (d+) as a "(.+)"$") public void stepDefA(int number, String controlName){ Given months "September,July,March" are checked @Given("^months "(.+)" are checked$") public void stepDefB(List<String> monthNames){ Given delivery date is “28-02-2014" @Given("^delivery date is "(d{2}-d{2}-d{4})"$") public void stepDefC(@Format("dd-MM-yyyy") Date today) { Then payment is updated in DB2 database @Then("^payment is updated in (DB2|Oracle) database$") public void stepDefD(String dbName){ Then error dialog is shown again @When("^error dialog is shown(?: again)?$") public void stepDefE(){
  • 12. Multiline text 04.11.2014 / 12 Then informational message is shown: """ Welcome to the Cosa Nostra card activation system. ======= If you would like us to take care of these losers before they cause you any trouble, please proceed to payment card information menu. """ Given I have a user account "Test Testersen" When it is granted <Role> rights And I submit a support request Then I should receieve an email: """ Dear T. Testersen, Unfortunately all our specialists are busy. Please <Action> <Person> in order to get further help with Your issue. Thank You for using our service. """ Examples: | Role | Action | Person | | customer | call | customer support team | | customer support | email | service operations team | | service operations | brace | yourself | @Then("^informational message is shown:$") public void info_message_shown(String messageText) {
  • 13. Data tables 04.11.2014 / 13 Given following accounts already exist in DB: | debitorName | debtorAddress1 | debtorPostCd | updateDate | | "Anakin Skywalker" | "Sand str 8, 2" | "Tatooine" | <current> +1d | | "R2D2" | "MISTY JUNGLE 1" | "DAGOBAH" | <current> -1d | | "Qui-Gon Jinn" | "Shrine, apt. 63" | "Yavin 4" | <current> -3d | | "Padme Amidala" | "Theed Royal Palace" | "Naboo" | <current> -3d | | "Luke Skywalker" | "Misty Jungle 1" | "Dagobah" | <current> -1d | | "Lando Calrissian" | "Building 2A, room 45" | "Bespin" | <current> -1d | | "Han Solo" | "Deck 06A, 12" | "Hoth" | <current> +3d | | "Leia Organa" | "Laser str. 13" | "Alderaan" | <current> -1d | @Then("^following accounts already exist in DB:$") public void stepDefA(DataTable accounts) { @Then("^following accounts already exist in DB:$") public void stepDefB(List<Map<String>> accounts) { @Then("^following accounts already exist in DB:$") public void stepDefC(List<AccountClass> accounts) { @Then("^following accounts already exist in DB:$") public void stepDefD(List<List<String>> accounts) {
  • 14. HOW CAN WE MAKE IT BETTER? 04.11.2014 / 14
  • 15. Integrate 04.11.2014 / 15 Maven failsafe plugin to launch the tests. Test reports passed in json to Jenkins Cucumber report plugin.
  • 16. Use the power 04.11.2014 / 16 Backgrounds, examples, regexps … Given I am on the advanced search page And I select "Endocrinology" from "Specialty" And I choose "Yes" within "Accepts Insurance" And I fill in "ZIP Code" with "90010" And I select "5 miles" from "Search Radius" When I press "Search" When I search for a provider with the criteria: | Provider Type | Doctor | | Specialty | Endocrinology | | Accepts Insurance | Yes | | ZIP | 90010 | | Search Radius | 5 miles | When I search for a provider with the default criteria and: | Specialty | Endocrinology | | Accepts Insurance | No | ... When I search for a provider with the default criteria Then the search criteria should include: | Provider Type | Doctor | | Specialty | General | | Accepts Insurance | Yes | | ZIP | 90010 | | Search Radius | 5 miles |
  • 17. Use the power … of regexps? 04.11.2014 / 17 When I use email (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0- 9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d-x7f]|[x01- x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0- 9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0- 9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0- 9]:(?:[x01-x08x0bx0cx0e-x1fx21-x5ax53-x7f]|[x01-x09x0bx0cx0e-x7f])+)]) When I am logged in ... When I am logged in as "Joda" @Then("^I am logged in$") .* Anything or nothing .+ Something d* none or more digits d+ some digits "[^"]*" Something in quotes an? Something optional ... @When("^(?:I am logged|I log) in as an? "([^"]*)"$") @Then("^(?:receipt has )?following payment (?:information|info) :$")
  • 18. Choose your domain 04.11.2014 / 18 Scenario: User with valid credentials Given an unauthenticated user When the user tries to navigate to the welcome page Then they should be redirected to the login page When the user enters a valid name in the Name field And the user enters the corresponding password in the Password field And the user presses the Login button Then they should be directed to the welcome page • Security domain, user authentication • Password based authentication domain • UI widgets domain • Domain of web assets Scenario: User with valid credentials Given an unauthenticated user When the user tries to access a restricted asset Then they should be directed to a login page When the user submits valid credentials Then they should be redirected back to the restricted content • “WHAT”  User authentication domain • “HOW” Web based security domain
  • 19. Declarative vs. Imperative 04.11.2014 / 19 How exactly to do it ?What should be done? Scenario: Successful login Given a user "Smith" with password "qwerty" And I am on the login page And I fill in "User name" with "Smith" And I fill in "Password" with "qwerty" When I press "Log in" Then I should see "Welcome, Smith" Background: Scenario: Successful login Given a user "Smith" with password "qwerty" And I am on the login page And I fill in "User name" with "Smith" And I fill in "Password" with "qwerty" When I press "Log in" Then I should see "Welcome, Smith" Scenario: User is greeted upon login Given the user "Smith" has an account When he logs in Then he should see "Welcome, Smith" Background: The user is logged in Given a logged in user Feature: The System Scenario: Everything Works Given the system exists When I use it Then it should work, perfectly
  • 20. WHEN DO WE NEED IT? 04.11.2014 / 20
  • 21. 04.11.2014 / 21 Don’t use Cucumber unless you live in the magic kingdom of non-programmers-writing-tests (and send me a bottle of fairy dust if you’re there!) ~ David Heinemeier Hansson 1. Non-developers are involved too  Product owner  Test engineer ? Test automation engineer 2. Executable specification 3. BDD, TDD  Specification, not script  Abstract, declarative  Shared language  Key examples Collaboration tool Jira (Behave Plug-in), Cucumber Pro, Relish . . .  Developer
  • 22. Useful links and sources Web • github.com/cucumber/cucumber-jvm • cukes.info/ – project page • dannorth.net/archives/ – creator of BDD • aslakhellesoy.com/ – framework creator • agileforall.com/blog/ – usage examples • cucumber.pro/ – Cucumber Pro + blog Books • The Cucumber Book – Wynne M, Hellesøy A, 2012 04.11.2014 / 22
  • 24. THANKS FOR TRYING TO STAY AWAKE

Editor's Notes

  1. Что общего между корнишонами** и мейнфреймами**? Наверное все таки ничего. Но если вспомнить корнишон это Gherkin**, а с мейнфреймами тесно связан язык COBOL** то мы получим два языка которые разделяет пятьдесят пять лет и которые были созданы с очень похожими целями. Как и COBOL, а именно COmmon Business-Oriented Language, язык Gherkin был создан для того что бы заполнить нишу между knowledge-holder’ами и разработчиками. Сложно судить получилось ли это у COBOL, за время своего существования язык сталкивался со множеством проблем (отсутствие модульности, структурности, нецелевое использование)
  2. Подготовка – Действие – Проверка Precondition (Условие) – Input – Output Язык для определения спецификац ий используется практически во всех BDD Фреймворках Ruby - Cucubmer Java – Cucumber-jvm, Jbehave Python – Behave PHP – Behat SpecFlow – C# В общем всё что угодно что бы поработить мир и использоваться на проекте
  3. Есть тест кейс с определённым шагом-действием Для него в каком то классе есть аннотированный метод Step Definition И все это дела запускает раннер
  4. Всем понятно
  5. Also scalar transformations Cucumber-JVM's built-in scalar types are numbers, enums, java.util.Date, java.util.Calendar and arbitrary types that have a single-argument constructor that is either a String or an Object
  6. Если помните есть такие Examples, так вот
  7. Screenshots are embedded in json as Base64 byte array Cucumber tests are ran nightly or by launching the Jenkins job. Bamboo (plugin), TeamCity (formatter) , TFS (SpecFlow uses Nunit)
  8. Регекспы такое дело, можно такого сделать что захочется застрелиться В какой степени использовать их решать вам (автоматизаторам), потому что им же их потом в основном и поддерживать
  9. + от password-based к OpenID, или centralized authentication system (CAS) model, или email ? + name выбирается DDL, radio buttons ? + обойти welcome page и попасть на дэшборд? Разные stakeholder’ы для каждого домена, каждый меняется, сценарий _хрупкий_ Должно быть 2 домена: - домен ЧТО, название, требование -- ЦЕЛЬ - домен КАК , шаги, реализация -- желаемое ПОВЕДЕНИЕ приложения 2 человека для которых мы это пишем: Тот кому необходима эта функиональность Тот кто её реализует
  10. Boring scenarios = bored stakeholders
  11. Ханссон, Давид Хейнемейер ---Back to COBOL One of the design goals for COBOL was to make it possible for non-programmers such as supervisors, managers and users, to read and understand COBOL code. As a result, COBOL contains such English-like structural elements as verbs, clauses, sentences, sections and divisions. As it happens, this design goal was not realized.  ---- TDD, but where to start? BDD and PO will help The idea was to combine automated acceptance tests, functional requirements and software documentation into one format that would be understandable by non-technical people as well as testing tools. ------ Outside-In Your features should drive your implementation, not reflect it.
  12. Aslak Hellesøy 2003 DN jBehave  DN Rbehave  DN Rspec  2008 AH Cucumber Richard Lawrence  Cuke4Nuke (.Net) Pragmatic bookshelf