SlideShare uma empresa Scribd logo
1 de 24
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

Mais conteúdo relacionado

Mais procurados

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 ArchitectureTom 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 codeWim Godden
 
TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI yogita kachve
 
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 DataMongoDB
 

Mais procurados (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
 

Semelhante a 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 PythonPyCon Italia
 
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 JasmineRaimonds Simanovskis
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumberBachue Zhou
 
Writing Sensible Code
Writing Sensible CodeWriting Sensible Code
Writing Sensible CodeAnis Ahmad
 
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 RubyBen Hall
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!Boy Baukema
 
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 ScriptingLori 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 PerformanceJonas De Smet
 
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 worldjeromevdl
 

Semelhante a 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
 

Mais de 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 FutureQAFest
 
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 spoiledQAFest
 
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 ClusterQAFest
 
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 automationQAFest
 
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. Алиса Бойко. Какнезапутаться в коммуникативных сетях ITQAFest
 
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 22QAFest
 

Mais de 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
 

Último

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

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

Notas do Editor

  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