Системное тестирование приложений на ruby on rails с...

Download Системное тестирование  приложений на Ruby on Rails с применением Rspec и Capybara

If you can't read please download the document

Upload: lshevtsov

Post on 14-Jun-2015

3.011 views

Category:

Technology


3 download

TRANSCRIPT

  • 1. Ruby on Rails Rspec Capybara , kiev.rb, 7 2011

2.

3. TDD 4. 5.

6. ( ) (QA-)

7. -

  • ,

Acceptance-? 8. Acceptance- ?

  • , .

9. . 10. - . 11.

12. 13. - , 14. 15.

  • ...

16. Javascript... 17. POST-... 18. ... 19. ... 20. Javascript... 21. HTML 22. ptance- ?

  • .

23. 24. , ... 25. . 26. , 27. 28. ... 29.

  • Selenium ( http://seleniumhq.org )

30. Cucumber ( http://cukes.info ) 31. Rspec+CapybaraNEW!

  • http://github.com/rspec/rspec-core

32. http://github.com/jnicklas/capybara 33. Rspec+Capybara ... ...Selenium-?

34. Rails 35. 36. (, Javascript) 37. Rspec+Capybara ... ...Cucumber-?

38. Rspec 39. , DRY 40. 41.

  • Rspec

42. Capybara 43. Steak ( Capybara edge) 44. rack_test / Selenium Webdriver 45. Mongrel 46. Rcov 47. Spork 48. JFGI 49. ?

  • Rspec ...

50. ... 51. ! (5-20 ) 52. Spork

  • http://github.com/timcharper/spork

53. 54. Rspec ( Unicorn) 55. 56. Firefox

  • http://github.com/leonid-shevtsov/capybara

57. feature Favorite adsdo let ( :user ) {Factory ( :user ) } beforedo ; @ad = Factory ( :ad ) ;end #... scenario"Preserving favorites across sessions" do add_ad_to_favorites ( @ad ) login ( user ) reset_session visit favorites_page we. should_notsee @ad. title login ( user ) visit favorites_page we. shouldsee @ad. title end end 58.

  • visit '/some/page'

59. click_link'some link' 60. fill_in'some_field' , :with=> 'value' 61. page. shouldhave_content ( 'foo' ) 62. deflogin ( user ) visit login_page fill_in'user_session[login]' , :with=>user. email fill_in'user_session[password]' , :with=> 'password' click_button'Login' end defadd_ad_to_favorites ( ad ) visit ad_page ( ad ) click_link'Add to favorites' end

  • http://github.com/leonid-shevtsov/behaving_rodent

63. UrlHelper

moduleUrlHelperdefhome_page '/' end defad_page ( ad ) / ads / #{ad.slug} end end 64. ?

  • root_path

65. 66. Rcov 67. 68. 100% Rcov 69. ?

  • ,

70. -. 71. ?

  • .

72. , . 73. , . 74. .

  • ?

75. N*100$ . 76. . 77. ?

  • [email_address] @leonid_shevtsov