Testiranje s CapybaroMartin Artink
Glavne prednosti● Works out of the box!● Intuitiven API● Preprosti preklopi med backendi● Razume asinhrone procese
Podprta okolja● Cucumber● RSpec● Test::Unit● MiniTest::Spec
Primeri
page.should have_contentscenario I need to see the home page dovisit /page.should have_content Homepageend
withinscenario Div should have content dovisit /within #some-content dopage.should have_content some contentendend
click_linkscenario I click a link to a page dovisit /click_link Link to another pagepage.should have_content subpageend
JavaScriptseleniumodpre Firefox browser in klika :/gem capybara-webkitheadless webkit browsergem poltergeistuporablja Phan...
JavaScriptscenario I fill and submit a form, js: true dovisit /within (#js-form) dofill_in(name, with: Martin)click_button...
JavaScript alerts, console, ...scenario JavaScript opens an alert message, js: true dovisit /click_link Click mepage.drive...
Screenshotscenario Take a screenshot, js: true dovisit /page.save_screenshot public/screen.pngFile.exist?(public/screen.pn...
Poltergeist debugscenario Test the poltergeist debug, js: true dovisit /page.driver.debugend
THE END
Upcoming SlideShare
Loading in …5
×

Testiranje s capybaro

330 views

Published on

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
330
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Testiranje s capybaro

  1. 1. Testiranje s CapybaroMartin Artink
  2. 2. Glavne prednosti● Works out of the box!● Intuitiven API● Preprosti preklopi med backendi● Razume asinhrone procese
  3. 3. Podprta okolja● Cucumber● RSpec● Test::Unit● MiniTest::Spec
  4. 4. Primeri
  5. 5. page.should have_contentscenario I need to see the home page dovisit /page.should have_content Homepageend
  6. 6. withinscenario Div should have content dovisit /within #some-content dopage.should have_content some contentendend
  7. 7. click_linkscenario I click a link to a page dovisit /click_link Link to another pagepage.should have_content subpageend
  8. 8. JavaScriptseleniumodpre Firefox browser in klika :/gem capybara-webkitheadless webkit browsergem poltergeistuporablja PhantomJS
  9. 9. JavaScriptscenario I fill and submit a form, js: true dovisit /within (#js-form) dofill_in(name, with: Martin)click_button Submitendwithin (#name-tag) dopage.should have_content "Hello, my name is Martin"endend
  10. 10. JavaScript alerts, console, ...scenario JavaScript opens an alert message, js: true dovisit /click_link Click mepage.driver.alert_messages.first.should eq Hello Capybara!endscenario Javascript prints some stuff to console, js: true dovisit /page.driver.console_messages.first[:message].should eq "Hello!"end
  11. 11. Screenshotscenario Take a screenshot, js: true dovisit /page.save_screenshot public/screen.pngFile.exist?(public/screen.png).should be_trueend
  12. 12. Poltergeist debugscenario Test the poltergeist debug, js: true dovisit /page.driver.debugend
  13. 13. THE END

×