Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Игры с огнём: знакомимся с BDD и Cucumber фреймворком BDDfire

2.499 visualizaciones

Publicado el

Доклад Владислава Романенко на конференции SQA Days-19, 20-21 мая 2016 г., Санкт-Петербург

Publicado en: Educación
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Игры с огнём: знакомимся с BDD и Cucumber фреймворком BDDfire

  1. 1. Software quality assurance days 19 Международная конференция по вопросам качества ПО sqadays.com Санкт-Петербург. 20–21 мая 2016 Владислав Романенко Intellectsoft. Минск, Беларусь Игры с огнём: знакомимся с BDD и Cucumber фреймворком BDDfire
  2. 2. QA-инженер в Intellectsoft В тестировании >2 лет, до этого работал инженером географических информационных систем (ГИС) Тестирую мобильные и веб приложения Сертификат ISTQB Foundation level v.romanenko_ laechoppe@gmail.com
  3. 3. BDD is like Jazz. There is no authoritative definition of what it is
  4. 4. BDD is a process designed to aid the management and the delivery of software development projects by improving communication between engineers and business professionals
  5. 5. w o r k s h o p 1.
  6. 6. 1. BA QA dev
  7. 7. 2.=> Cucumber format Given… When… Then… Gherkin:
  8. 8. 3. ruby => step definitions
  9. 9. 3. => tests execution
  10. 10. - prevent the bug To do list:
  11. 11. - exhaustive list of scenarios To do list:
  12. 12. What’s to avoid?
  13. 13. What’s to avoid? - Leaking scenarios Given When Then A BX
  14. 14. What’s to avoid? - All is end-to-end
  15. 15. What’s to avoid? - Fixtures
  16. 16. BDD is not: Equal to Functional testing
  17. 17. BDD is not: Only about testing
  18. 18. a quick fix,... BDD is not:
  19. 19. ...an investment BDD is:
  20. 20. SQA DAys-18 talk: “Behat-trick:...”
  21. 21. w e b d r i v e r
  22. 22. bddfire: Write your tests, not framework
  23. 23. Why “Cucumber”?
  24. 24. bddfire: Capybara Selenium Webdriver Docker RestClient Poltergeist Gatling Appium Saucelabs Relish, Yard Axe accessibility engine Rubocop
  25. 25. Installation: $ gem install bddfire $ bddfire fire_cucumber $ cd cucumber & bundle install
  26. 26. Predefined steps: Given I am on “url” When I click on element having text “foo" Then The page title is “bar"
  27. 27. Predefined steps definitions: Then(/^page contains "(.*?)"$/) do |element| page.should have_css(element) end Then(/^I should see "(.*?)"$/) do |text| page.should have_content text end
  28. 28. Scenario: Signing in as an existing user Given I am on "http://test.org/auth" When I fill in "email" with the text "vlad@r.by" And I fill in "password" with the text "qwerty" And I click on element having text "Sign In" Then The page title is "Homepage" Hello world scenario:
  29. 29. Natural risks forest fire avalanche Project overview: Actions Rescue people Put out the fire Warn alpinists
  30. 30. 1. Features Project structure: Scenario: I can see the quantity of risks in each state Given I'm a rescue team member When I observe the table of risks Then I see the correct quantity of risks by state
  31. 31. Project structure: When (/^I want to view the details of a Risk/) do risk_num = rand(1...10).to_s link = '#/steps/' + risk_num + '/details' find(:xpath,"(//*[@href='#{link}'])[1]").click end 2. Step definitions
  32. 32. Project structure: Capybara.configure do |config| config.run_server = false ... config.default_selector = :xpath config.default_wait_time = 60 end 3. Support code
  33. 33. Project structure: After do page.evaluate_script('window.confirm = function() { return true; }') find(:xpath, '//*[@ng-click="vm.logOut()"]').click end 4. Hooks
  34. 34. Project structure: default: -p selenium html: --format --out reports/test.html api : DRIVER=poltergeist --tags @api chrome: DRIVER=chrome pretty: -f pretty 5. Configuration file
  35. 35. Project structure: source 'http://rubygems.org' gem 'cucumber' gem 'capybara' gem 'bddfire' gem 'selenium-webdriver' 6. Dependencies
  36. 36. Project structure: 6. Reports / Docs folders
  37. 37. What’s included? 1. Capybara Acceptance test framework for web applications. It simulates how a real user would interact with the app
  38. 38. Why “Capybara”?
  39. 39. Why “Capybara”? Webrat => Capybara
  40. 40. What’s included? 1. Capybara Given(/^I am on homepage$/) do visit('http://risk.piemont.org/#/login') end Given(/^I want to see Risk timeline/) do find(:xpath,'//*[@ui-sref="risk.timeline"]').click end
  41. 41. What’s included? 2. Poltergeist allows runNing Capybara tests on a headless browser
  42. 42. What’s included? 2. Poltergeist @poltergeist Scenario: Signing in as an existing user Given I am on "http://test.org/auth" When I fill in "email" with the text "vlad@r.by" And I fill in "password" with the text "qwerty" And I click on element having text "Sign In" Then The page title is "Homepage"
  43. 43. What’s included? 3. parallel_tests
  44. 44. What’s included? 4. BrowserStack Cloud-based cross-browser testing tool
  45. 45. What’s included? 4. BrowserStack
  46. 46. What’s included? 5. Rubocop Code style checker based on the community-driven Style Guide
  47. 47. What’s included? 5. Rubocop
  48. 48. What’s included? 6. CukeSniffer Static analysis tool for the Cucumber.
  49. 49. What’s included? 6. CukeSniffer
  50. 50. What’s included? 7. Yard A Requirements Documentation Tool
  51. 51. What’s included? 7. Yard
  52. 52. What’s included? 8. RestClient Simple HTTP and REST client for Ruby
  53. 53. What’s included? 8. RestClient Given I send a GET request for "<your_uri>" Given I send a GET/PUT/POST/DELETE request for "<your_uri>" with the following: """ <your_payload> """ Then the response should be JSON
  54. 54. What’s included? 9. Axe
  55. 55. What’s included? 9. Axe
  56. 56. What’s included? 10. Gatling load testing framework
  57. 57. What’s included? 10. Gatling
  58. 58. What’s included? 11. Docker platform for distributed applications
  59. 59. Summary: $ gem install bddfire $ bddfire fire_cucumber $ cd cucumber & bundle install
  60. 60. Thanks! Questions? v.romanenko_ laechoppe@gmail.com

×