[ hackfest.pl 2012] testing - what for and how
TRANSCRIPT
![Page 1: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/1.jpg)
TESTING
what for and how
Michał Czyż@cs3b
![Page 4: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/4.jpg)
http://www.worksmartmompreneurs.com/blog/wp-content/uploads/2012/03/url.jpg
![Page 5: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/5.jpg)
● precise requirements definition● automatic requirements
verification● code design● documentation● safety net for code changes● catch errors
![Page 6: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/6.jpg)
![Page 7: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/7.jpg)
http://www.projzilla.com/blog/wp-content/uploads/2011/12/Testing.jpg
![Page 8: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/8.jpg)
http://www.projzilla.com/blog/wp-content/uploads/2011/12/Testing.jpg
![Page 9: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/9.jpg)
● precise requirements definition● automatic requirements
verification● code design● documentation● safety net for code changes● catch errors
![Page 10: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/10.jpg)
TDD
![Page 11: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/11.jpg)
BDD
![Page 12: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/12.jpg)
OUTSIDE-IN
![Page 13: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/13.jpg)
http://pragprog.com/book/achbd/the-rspec-book page#29
![Page 14: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/14.jpg)
![Page 15: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/15.jpg)
![Page 16: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/16.jpg)
![Page 17: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/17.jpg)
![Page 18: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/18.jpg)
![Page 19: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/19.jpg)
http://pragprog.com/book/achbd/the-rspec-book page#29
![Page 20: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/20.jpg)
User perspective
testing using Ruby
![Page 21: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/21.jpg)
https://twitter.com/#!/moonmaster9000/status/169540724474384384
![Page 22: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/22.jpg)
https://twitter.com/#!/athoshun/statuses/165138347432488962
![Page 23: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/23.jpg)
https://twitter.com/#!/defkode/status/124066265642967040http://www.jackkinsella.ie/2011/09/26/why-bother-with-cucumber-testing.html
![Page 24: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/24.jpg)
http://blog.jonasbandi.net/2010/09/acceptance-vs-integration-tests.html
![Page 25: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/25.jpg)
![Page 26: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/26.jpg)
![Page 27: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/27.jpg)
![Page 28: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/28.jpg)
![Page 29: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/29.jpg)
click "Products"within('table.index) do
see :ordered => [ "apache baseball cap","zomg shirt" ]
end click "admin_products_listing_name_title"within('table.index') do
see :ordered => [ "zomg shirt","apache baseball cap"]
end
![Page 30: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/30.jpg)
click "Orders"within('table#listing_orders', :row => 1) do
click_link "R100"end click "Payments"within('#payment_status') do
see("Payment: balance due")end within(:cell =>[2,2]) { see "$39.98" }within(:cell =>[2,3]) { see "Credit Card" }within(:cell =>[2,4]) { see "pending" }
![Page 31: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/31.jpg)
click
![Page 32: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/32.jpg)
click 'Administrations', 'Products', click :and_dismiss => 'Delete' click :and_accept => 'Delete' click :image => 'OK' click :element => "#some_div"
![Page 33: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/33.jpg)
fill_in
![Page 34: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/34.jpg)
fill_in 'www.selleo.com' => 'Link' fill_in 'www.selleo.com' => 'Link'
'Selleo' => 'Company','Poland' => 'Country'
![Page 35: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/35.jpg)
fill_in :check => 'Remember me' fill_in :check => [ 'Red',
'Green','Grey' ]
![Page 36: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/36.jpg)
fill_in :uncheck => 'Remember me' fill_in :uncheck => [ 'Red',
'Green','Grey' ]
![Page 37: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/37.jpg)
fill_in :choose => 'Female' fill_in :choose => [ 'Europe',
'Poland' ]
![Page 38: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/38.jpg)
fill_in :select => { 'Poland' => 'Countries' }
fill_in :select => { 'Poland' =>
'Countries',
'Silesia' => 'Provinces' }
![Page 39: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/39.jpg)
fill_in :unselect => { 'Poland' => 'Countries' }
fill_in :unselect => { 'Poland' =>
'Countries',
'Silesia' => 'Provinces' }
![Page 40: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/40.jpg)
fill_in :attach => { 'me.png' => 'Avatar'}
fill_in :attach => { 'me.png' =>
'Avatar', 'selleo.png' =>
'Company Logo' }
![Page 41: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/41.jpg)
# spec_helper.rbKameleon.configure do |c| c.assets_dir = '(...)/fixtures/assets'end
![Page 42: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/42.jpg)
see
![Page 43: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/43.jpg)
see 'www.selleo.com',
see 'one','another piece of text','and another one'
![Page 44: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/44.jpg)
see :link => 'Wrocloverb' see :link => { 'Wrocloverb' => 'http://wrocloverb.com' } see :links => { 'Wrocloverb' => 'http://wrocloverb.com', 'Selleo' => 'http://www.selleo.com' }
![Page 45: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/45.jpg)
see :image => 'OK' see :image => 'icon_ok.png' see :images => [ 'completed',
'approved' ]
![Page 46: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/46.jpg)
see 'Ruby' => 'First Name' see 'Wisła' => 'City',
'Silesia' => 'Province'
![Page 47: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/47.jpg)
see :field => 'Email' see :fields => ['Email',
'City','Street' ]
![Page 48: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/48.jpg)
see :empty => 'Last Name' see :empty => [ 'Last Name',
'City' ]
![Page 49: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/49.jpg)
see :checked => 'Remember me' see :checked => [ 'Newsletter',
'Remember me' ]
![Page 50: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/50.jpg)
see :unchecked => 'Remember me' see :unchecked => [ 'Newsletter',
'Remember me' ]
![Page 51: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/51.jpg)
see :selected => { 'Poland' => 'Countries' }
see :selected => { 'Poland' =>
'Countries',
'Silesia' => 'Provinces' }
![Page 52: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/52.jpg)
see :selected => { [ 'Red','Green','Orange' ] =>
'Colors' }
![Page 53: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/53.jpg)
see :unselected => { 'Poland' => 'Countries' }
see :unselected => { 'Poland' =>
'Countries',
'Silesia' => 'Provinces' }
![Page 54: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/54.jpg)
see :unselected => { [ 'Red','Green','Orange' ] =>
'Colors' }
![Page 55: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/55.jpg)
see :ordered => [ 'Bart', 'Tom',
'Anette' ]
![Page 56: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/56.jpg)
see 5 => ".element" see 3 => :menu_item see 5 => [:xpath, '//div[@class="element"]' ]
![Page 57: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/57.jpg)
not_see
![Page 58: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/58.jpg)
not_see 'php'
not_see 'java','c#','.net'
![Page 59: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/59.jpg)
not_see :field => 'Email' not_see :fields => [ 'Email',
'City','Street' ]
![Page 60: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/60.jpg)
not_see :link => 'Wrocloverb' not_see :link => { 'Wrocloverb' =>
'http://wrocloverb.com' }
not_see :links => [ 'Wrocloverb', 'Selleo' ]
![Page 61: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/61.jpg)
not_see :image => 'OK' not_see :image => 'ok.png' not_see :images => [ 'OK',
'rails.png' ]
![Page 62: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/62.jpg)
act_as
![Page 63: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/63.jpg)
visit('/') act_as(:default) do
click 'Products'end
![Page 64: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/64.jpg)
visit('/') create_session(:user)visit('/login') act_as(:default) do
not_see :field => 'Email'end act_as(:user)see :fields => [ 'Email', 'Password' ]
![Page 65: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/65.jpg)
http://s1.desktopia.net/wp-content/uploads/walls/thumbs/Funny-Chameleon-575x359.jpg
![Page 66: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/66.jpg)
click_link "Products"within('table.index tr:nth-child(2)') {
page.should have_content("apache baseball cap") }
within('table.index tr:nth-child(3)') { page.should have_content("zomg shirt") }
click_link "admin_products_listing_name_title"within('table.index tr:nth-child(2)') {
page.should have_content("zomg shirt") }within('table.index tr:nth-child(3)') {
page.should have_content("apache baseball cap") }
https://github.com/spree/spree/blob/master/core/spec/requests/admin/products/products_spec.rb#L22
![Page 67: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/67.jpg)
click "Products"within('table.index) do
see :ordered => [ "apache baseball cap","zomg shirt" ]
end click "admin_products_listing_name_title"within('table.index') do
see :ordered => [ "zomg shirt","apache baseball cap"]
end
![Page 68: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/68.jpg)
click_link "Products"click_link "admin_new_product" fill_in "product_name", :with => "Baseball Cap"fill_in "product_sku", :with => "B100"fill_in "product_price", :with => "100"fill_in "product_available_on", :with =>
"2012/01/24"select "Size", :from => "Prototype"check "Large"click_button "Create"page.should have_content("successfully created!")
https://github.com/spree/spree/blob/master/core/spec/requests/admin/products/products_spec.rb#L77
![Page 69: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/69.jpg)
click "Products","admin_new_product"
fill_in "Baseball Cap" => "product_name",
"B100" => "product_sku","100" => "product_price","2012/01/24" => "product_available_on",:select => {
"Size" => "Prototype" },
:check => "Large"click "Create"see "successfully created!"
![Page 70: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/70.jpg)
within(:css, 'table.index tr:nth-child(2)') { click_link "Edit" }
fill_in "adjustment_amount", :with => "99"fill_in "adjustment_label", :with => "rebate 99"click_button "Continue"page.should have_content("successfully
updated!")page.should have_content("rebate 99")page.should have_content("$99.00")
https://github.com/spree/spree/blob/master/core/spec/requests/admin/orders/adjustments_spec.rb#L48
![Page 71: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/71.jpg)
within(:row => 2) { click "Edit" } fill_in 99 => "adjustment_amount",
"rebate 99" => "adjustment_label"click "Continue"see "successfully updated!",
"rebate 99","$99.00"
![Page 72: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/72.jpg)
click_link "Orders"within('table#listing_orders tbody tr:nth-child(1)') { click_link "R100" } click_link "Payments"within('#payment_status') { page.should have_content("Payment: balance due") } find('table.index tbody tr:nth-child(2)
td:nth-child(2)').text.should == "$39.98"find('table.index tbody tr:nth-child(2)
td:nth-child(3)').text.should == "Credit Card"find('table.index tbody tr:nth-child(2)
td:nth-child(4)').text.should == "pending" https://github.com/spree/spree/blob/master/core/spec/requests/admin/orders/payments_spec.rb#L32
![Page 73: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/73.jpg)
click "Orders"within('table#listing_orders', :row => 1) do
click_link "R100"end click "Payments"within('#payment_status') do
see("Payment: balance due")end within(:cell =>[2,2]) { see "$39.98" }within(:cell =>[2,3]) { see "Credit Card" }within(:cell =>[2,4]) { see "pending" }
![Page 74: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/74.jpg)
DEMOinspired by a case takenfrom a production system
![Page 75: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/75.jpg)
![Page 76: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/76.jpg)
create_session(:user)sign_in_as(:user)
create_session(:admin)sign_in_as(:admin)
![Page 77: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/77.jpg)
act_as(:user) do not_see 'IS OPEN', 'IS CLOSED' within(:right_column) do
not_see 'Submit a proposal', 'Submit' endend
![Page 78: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/78.jpg)
act_as(:admin) do within(:menu) { click 'Set Contest' } fill_in 'S vs C' => 'Name', '2012-01-19 08:00:00' => 'starts at', '2012-01-20 08:00:00' => 'ends at' click 'Create Contest' see 'Contest was successfully created'end
![Page 79: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/79.jpg)
Timecop.travel(2012, 1, 19, 8, 59, 55) do act_as(:user) do
refresh_pagesee 'IS CLOSED'sleep 10not_see 'IS CLOSED'see 'IS OPEN'
endend
![Page 80: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/80.jpg)
Timecop.travel(2012, 1, 19, 9, 1, 1) do act_as(:user) do
refresh_page%w(ruby ... haml).each do |content|
fill_in content => 'proposal_content' click 'Submit'
end end
![Page 81: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/81.jpg)
act_as(:admin) do click 'Sticker proposals', 'Load more' %w(ruby ... html).each do |c|
within(:proposal_with_content => c) do click 'favorite'
end endend
![Page 82: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/82.jpg)
act_as(:user) do refresh_page %w(...).each_with_index do |c, r|
within(:proposal_with_content => c) do click "Rate #{r+1} out of 5"
end endend
![Page 83: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/83.jpg)
act_as(:user) do %w(ruby coffescript).each do |c|
within(:proposal_with_content => c) do click 'Comment' fill_in "sample text #{c}" => 'body' click 'Create comment'
end endend
![Page 84: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/84.jpg)
Timecop.travel(2012, 1, 20, 11, 10, 10) do act_as(:admin) do
refresh_pageclick 'Load more'%w(html python).each do |c|
within(:proposal_with_content => c) do click 'choose' end
end end
![Page 85: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/85.jpg)
act_as(:user) do refresh_page click 'Gallery' within(:ordered_list) do
see *(%w(html python))not_see *(%w(ruby ... coffescript))
endend
![Page 86: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/86.jpg)
act_as(:admin) do click 'Gallery', 'Add new production picture' fill_in 'Sample title for picture' => 'Title', :attach => {'pict.jpg' => 'Image'} click 'Create Gallery image'end
![Page 87: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/87.jpg)
act_as(:user) do click 'Gallery' fill_in :select => {'S vs C' => 'contest_id'} within(:gallery_list) do
see :image => 'Thumb_pict' endend
![Page 88: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/88.jpg)
act_as(:admin) do click 'Add new contest sticker' fill_in 'Sample title for picture' => 'Title', :attach => {'pict2.jpg' => 'Image'} click 'Create Gallery image'end
![Page 89: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/89.jpg)
act_as(:user) do click 'Gallery' fill_in :select => {'S vs C' => 'contest_id'} within(:gallery_list) do
see :image => 'Thumb_pict2' endend
![Page 90: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/90.jpg)
http://2.bp.blogspot.com/_bVtGlUaW-tA/TMOUvmYXzHI/AAAAAAAAP90/SR5yHHWydN4/s1600/Mech_chameleon_by_tommaso_sanguigni.jpg
![Page 91: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/91.jpg)
# gemfilegem 'kameleon', '>= 0.2.0.alpha.2'gem 'headless' # spec_helper.rbrequire 'kameleon'require 'kameleon/ext/rspec/all'
![Page 92: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/92.jpg)
# orrequire 'kameleon/ext/rspec/dsl' # optional# .../rspec/garbage_collector'# .../rspec/headless'
![Page 93: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/93.jpg)
SHARED DB CONNECTION
example: lib/kameleon/ext/active_record/
● shared_single_connection.rb
● shared_single_connection_with_spork.rb
![Page 94: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/94.jpg)
RSpec.configure do |config| config.before(:suite) do
@headless = Headless.new(:display => '100')@headless.start
end config.after(:suite) do
@headless.stop if defined?(@headless) endend
HEADLESS
require 'kameleon/ext/rspec/headless'
![Page 95: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/95.jpg)
config.after(:each) doif exception = example.instance_variable_get(:@exception)
Ripl.start :binding => binding
end end
RIPL
example: lib/kameleon/utils/debug_console.rb
![Page 96: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/96.jpg)
FAKE DATA
IN ACCEPTANCE AND INTEGRATION TESTS
![Page 97: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/97.jpg)
DATABASE
![Page 98: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/98.jpg)
FIXTURES# fernitures.ymlcouch: name: Couch price: 399.99 manufacturer: lazyboy categories: furnituretv_stand: name: TV Stand price: 149.95 manufacturer: highdeph categories: furniture, electronics # categories.ymlfurniture: name: Furnitureelectronics: name: Electronics
![Page 99: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/99.jpg)
FIXTURES
---- PostgreSQL database dump-- SET statement_timeout = 0;SET client_encoding = 'UTF8';SET standard_conforming_strings = on;SET check_function_bodies = false;SET client_min_messages = warning;
![Page 100: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/100.jpg)
FACTORIES
10.times do |i| banner = BannerMessage.new :content => "text_#{i}" banner.origin_ip = "127.#{i+1}.#{i}.#{i}" banner.save! rand(6).times do |v|
vote = banner.votes.buildvote.origin_ip = "127.0.0.#{v}"vote.cookies = {vote.banner_message_id.to_s =>
Time.now.to_s}vote.save!
endend
![Page 101: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/101.jpg)
FACTORIES
FactoryGirl.define do factory :comment do
sequence(:body) { |n| "this is #{n} comment!" }banner_messagesequence(:origin_ip) { |n| "127.0.0.#{n}" }user
endend ### 10.times { Factory.create(:comment) }
![Page 102: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/102.jpg)
SERVICES
![Page 103: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/103.jpg)
VCR + WEB MOCK
VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' c.hook_into :webmock c.default_cassette_options = { :record => :new_episodes }end
![Page 104: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/104.jpg)
VCR + WEB MOCK context "passing authentication process", :status => :done do
use_vcr_cassette 'authorization_pass'before(:each) do
get '/', nil, { 'HTTP_AUTHORIZATION' => {"domain" => "selleo2",
"email" => "[email protected]", "token" => "xK1KPKCcP3v6VvTkhDogzI"}.to_json }
end
it { response.code.should == "200" }
it 'message' do...
![Page 105: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/105.jpg)
VCR + WEB MOCK---recorded_with: VCR 2.0.0http_interactions:- request:
method: geturi: https://someapp.com/api/v1/users/currentbody:
string: ""headers:
... Authorization: - Basic bSnl6QHNlbjb20vdG9rZW46eS1BL User-Agent: - Some Ruby Client 0.1.0
![Page 106: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/106.jpg)
VCR + WEB MOCK response:
status: code: 200 message: OK
headers: Content-Type: - application/json; charset=utf-8 Server: - nginx/0.8.53 .... Connection: - keep-alive
body: string: "{\"name\":\"Selleo\",\"locale_id\":null,\"pho\":\"wow\"}"
http_version: recorded_at: Mon, 09 Apr 2012 11:32:23 GMT
![Page 107: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/107.jpg)
VCR + WEB MOCK response:
status: code: 200 message: OK
headers: Content-Type: - application/json; charset=utf-8 Server: - nginx/0.8.53 .... Connection: - keep-alive
body: string: "{\"name\":\"Selleo\",\"locale_id\":null,\"pho\":\"wow\"}"
http_version: recorded_at: Mon, 09 Apr 2012 11:32:23 GMT
![Page 108: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/108.jpg)
META-DATA
![Page 109: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/109.jpg)
![Page 110: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/110.jpg)
context "passing auth", :status => :done douse_vcr_cassette 'authorization_pass'
...end
![Page 111: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/111.jpg)
![Page 112: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/112.jpg)
#::: page: sign_in#::: wireframe: http://some_url context "passing auth", :status => :done do
use_vcr_cassette 'authorization_pass' ...end
![Page 113: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/113.jpg)
![Page 114: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/114.jpg)
![Page 115: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/115.jpg)
![Page 116: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/116.jpg)
![Page 117: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/117.jpg)
![Page 118: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/118.jpg)
INTEGRATIONTESTS
![Page 119: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/119.jpg)
http://blog.jonasbandi.net/2010/09/acceptance-vs-integration-tests.html
![Page 120: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/120.jpg)
![Page 121: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/121.jpg)
INTEGRATION TESTdescribe "fill in" do before(:each) { visit('/form_elements') } context "single value in field" do it "text" do see :empty => [ 'sampleEmptyInput', 'textarea2'] fill_in 'Value for sampleEmtyInput' => 'sampleEmptyInput', 'Value for textarea2' => 'textarea2' see 'Value for textarea2' => 'textarea2', 'Value for sampleEmtyInput' => 'sampleEmptyInput' end it "checkbox" do see :unchecked => 'Sample unchecked checkbox' fill_in :check => 'Sample unchecked checkbox' see :checked => 'Sample unchecked checkbox' fill_in :uncheck => 'Sample checked checkbox' see :unchecked => 'Sample checked checkbox' end
![Page 122: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/122.jpg)
INTEGRATION TESTdescribe 'order' do before(:each) { visit('/special_elements') } it 'should see text in proper order' do see :ordered => ['Michal Czyz', 'Tomasz Bak', 'Rafal Bromirski'] end context 'raise error' do it 'different order' do expect do see :ordered => ['Tomasz Bak', 'Michal Czyz', 'Rafal Bromirski'] end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end it 'not all elements present' do expect do see :ordered => ['Michal Czyz', 'Lukas Bak', 'Rafal Bromirski'] end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end endend
![Page 123: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/123.jpg)
INTEGRATION TEST before(:each) do post "/users", { :user => { :name => "Wookie 5", :email => "[email protected]", :roles => 4, "is_verified" => true, :groups => [20188052, 20180893] } }, SelleoSomeApi.headers end it { response.status.should == 201 } subject do JSON.parse(response.body) end it { subject["id"].should be_a(Fixnum) } it { should include "email" => "[email protected]" } it { should include "name" => "Wookie 5" } it { should include "roles" => 4 } it { should include "is_active" => true } it { should include "is_verified" => "true" }
![Page 124: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/124.jpg)
UNIT TESTS
![Page 125: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/125.jpg)
![Page 126: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/126.jpg)
UNIT TEST describe "PARSING" do before(:each) do subject { CucumberFM::Feature.new('some_path') } subject.stub(:raw).and_return(FEATURE_CONTENT) cfm = mock(:cfm) filter = CucumberFM::TagFilter.new('') cfm.stub(:filter).and_return(filter) subject.stub(:cfm).and_return(cfm) end it "should parse feature info" do CucumberFM::FE::Info.should_receive(:new).with(subject, INFO_CONTENT) subject.info end it "should parse background" do CucumberFM::FE::Background.should_receive(:new).with(subject, BAC..._C) subject.background end
![Page 127: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/127.jpg)
UNIT TESTdescribe CucumberFM::FeatureElement::Info do before(:all) do raw = <<EOF #{@comment_1 = "# some comment"} @tag @mc
Feature: #{@title = "Tag filter"}EOF feature = CucumberFM::Feature.new('fake_path') @info = CucumberFM::FeatureElement::Info.new(feature, raw) end it "should parse tags" do @info.tags.should == %w(@tag @mc) end it "should parse comments lines" do CucumberFM::FE::Comment.should_receive(:new).with(@info, @comment_1) CucumberFM::FE::Comment.should_receive(:new).with(@info, @comment_2) @info.should have(2).comments end
![Page 128: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/128.jpg)
UNITvs
INTEGRATION
![Page 129: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/129.jpg)
http://www.codingthearchitecture.com/images/20120412-sketches.jpg
![Page 130: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/130.jpg)
![Page 131: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/131.jpg)
![Page 132: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/132.jpg)
PERFORMANCETESTS
![Page 133: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/133.jpg)
http://2.bp.blogspot.com/-yR4off2JRt0/TzZEOolbm5I/AAAAAAAAB_Q/Sl7UKjVl9Cw/s400/Snail%2Bon%2Bturtle%2Bfast.jpg
![Page 134: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/134.jpg)
http://www.projzilla.com/blog/wp-content/uploads/2011/12/Testing.jpg
![Page 135: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/135.jpg)
LOADTESTS
![Page 136: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/136.jpg)
http://www.funtim.com/wp-content/uploads/2009/01/indian-funny-pic.jpg
![Page 137: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/137.jpg)
http://www.projzilla.com/blog/wp-content/uploads/2011/12/Testing.jpg
![Page 138: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/138.jpg)
SECURITYTESTS
![Page 139: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/139.jpg)
http://www.penetration-testing-group.co.uk/penetration-testing.jpg
![Page 140: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/140.jpg)
http://www.projzilla.com/blog/wp-content/uploads/2011/12/Testing.jpg
![Page 141: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/141.jpg)
STATICANALYSIS
![Page 142: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/142.jpg)
http://metric-fu.rubyforge.org/reek.gif
![Page 143: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/143.jpg)
CONTINUOUSINTEGRATION
![Page 144: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/144.jpg)
http://www.jetbrains.com/teamcity/features/index.html
![Page 146: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/146.jpg)
http://www.worksmartmompreneurs.com/blog/wp-content/uploads/2012/03/url.jpg
![Page 147: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/147.jpg)
● precise requirements definition● automatic requirements
verification● code design● documentation● safety net for code changes● catch errors
![Page 148: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/148.jpg)
LINKS
RSPEC● http://pragprog.com/book/achbd/the-rspec-book● https://www.relishapp.com/rspec
CAPYBARA● https://github.com/jnicklas/capybara
XPATH● http://www.w3.org/TR/xpath/● https://addons.mozilla.org/en-US/firefox/addon/firepath/
SELENIUM● http://seleniumhq.org/docs/
WEBKIT● https://github.com/thoughtbot/capybara-webkit
KAMELEON
● https://github.com/cs3b/kameleon
![Page 149: [ HackFest.pl 2012] Testing - what for and how](https://reader031.vdocuments.us/reader031/viewer/2022020122/555adb0fd8b42a62528b4d3f/html5/thumbnails/149.jpg)
THANKS :-)
http://selleo.com/people/michal-czyz
http://cs3b.com
questions ?