Your SlideShare is downloading. ×
  • Like
2_cucumber
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

2_cucumber

  • 681 views
Published

Cucumber

Cucumber

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
681
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1.  
  • 2.  
    • Разработка с использованием Cucumber состоит из 3-х основных этапов.
      • Описание фич проекта простым человеческим языком. И даже необязательно английским.
      • Определение поступков (step definition) на Ruby
      • Цикл разработки: проверка фич кукумбером и реализация не прошедших тестирование фич ручками.
  • 3.   Cucumber + Capybara + Selenium Webdriver + Ruby
  • 4. Структура |~ features /                   | |~ step_definitions /         | | |-person_steps.rb         | | `-web_steps.rb            | |~ support /                  | | |-env.rb                  | | `-paths.rb                | |-addtocontacts.feature     | |-attachimage.feature       | |-chpass.feature            | |-ignore.feature            | |-ims.feature               | |-login.feature             | |-logout.feature            | |-present.feature           | `-registeration.feature     |~ lib /                        | `+ faker /                    `+data/                       
  • 5. Feature: Login                                             In order to manage my private data                       As a person.com user                                     I want to login                                                                                               Scenario: Normal login                                     Given I am on the home page                              When I fill in "login" with "value"        And I fill in password field "passwd" with "value1"     And I press "login"                                      Then I should see "My Stuff"    But I should not see "ERROR: Invalid password!"                                                                                Scenario: Invalid login with bad login                     Given I am on the home page                              When I fill in "login" with "value1"                     And I fill in password field "passwd" with "value2"      And I press "login"                                      Then I should see "NO Login"                                                                                  Scenario: Invalid login with incorrect password            Given I am on the home page                              When I fill in "login" with "value"        And I press "login"                                      Then I should see "ERROR: Invalid password!"
  • 6. Scenario Outline : eating    Given there are <start> cucumbers    When I eat <eat> cucumbers    Then I should have <left> cucumbers    Examples :      | start | eat | left |      |  12   |  5  |  7   |      |  20   |  5  |  15  | Given  the following people exist:    | name  | email           | phone |    | Aslak | aslak@email.com | 123   |    | Joe   | joe@email.com   | 234   |    | Bryan | bryan@email.org | 456   |
  • 7. Feature: Registration     In order to start using site     As a new user     I want to register Scenario: Normal registration     Given I am on the home page     When I fill in &quot;email&quot; with random email     And I fill in &quot;fullname&quot; with &quot;MyNameIs&quot;     And I fill in &quot;nickname&quot; with &quot;MyNicknameIs&quot;     And I choose &quot;gender_1&quot;     And I select &quot;10&quot; from &quot;birthday_day&quot;     And I select &quot;March&quot; from &quot;birthday_month&quot;     And I select &quot;1986&quot; from &quot;birthday_year&quot;     And I fill in &quot;city&quot; with &quot;Antarctica, Antarctica, Antarctica&quot;     And I fill in &quot;password&quot; with &quot;testpass&quot;     And I fill in &quot;city&quot; with &quot;Antarct&quot;     And I click to city autocomplete item with &quot;Antarctica&quot;     And I press &quot;button_submit&quot;     Then I should see &quot;Thank you for registration!&quot;
  • 8. Given /^(?:|I )am on (.+)$/ do |page_name|   visit path_to(page_name) end   When /^(?:|I )press &quot;([^&quot;]*)&quot;(?: within &quot;([^&quot;]*)&quot;)?$/ do |button, selector|   with_scope(selector) do     click_button(button)   end end   Then /^(?:|I )should not see &quot;([^&quot;]*)&quot;(?: within &quot;([^&quot;]*)&quot;)?$/ do |text, selector|   with_scope(selector) do     if page.respond_to? :should       page.should have_no_content(text)     else       assert page.has_no_content?(text)     end   end end When /^(?:|I )fill in &quot;([^&quot;]*)&quot; with random email(?: within &quot;([^&quot;]*)&quot;)?$/ do |field, selector|   @email = Faker::Internet.email   with_scope(selector) do     fill_in(field, :with => @email)   end end
  • 9.  
  • 10. Пример ошибки при выполнении
  • 11.
    • Возникшие у нас проблемы:
    •  
      • Selenium не видит новых дочерних окон
      • Скрытые поля
      • Капча
      • Не семантическая верстка
  • 12.
    • Подключаемые библиотеки:
    •  
      • Capybara
      • Faker
      • brominet
      • bermuda
      • ... их много...
  • 13. Непрерывное системное тестирование   integrity + cucumber + selenium на VPS
  • 14. The RSpec Book
  • 15. Спасибо за внимание =)