ruby on rails - javascript Confirmation Dialog in capybara webkit driver -
so want test user deleting account using capybara , rspec:
scenario "user wants delete account" click_link "account" click_link "delete account" expect(page).to have_text("you're account deleted.") end
only problem js confirmation dialog appears when user clicks 'delete account'. confirm dialog did following:
- install capybara-webkit
- add
capybara.javascript_driver = :webkit
spec_helper.rb - add
:js => true
scenario "user wants delete account" do
.
now nothing seems work addition of :js => true
. getting error capybara::elementnotfound: unable find link "account"
, before working fine, js: true
interfere these capybara methods? config wrong?
:js => true
tells capybara use javascript driver spec; it's needed run pages have execute javascript part of functionality. in case, needed js confirmation dialog.
but...there's couple of other things note:
- your link titled "account" above , looking "account settings". typo?
- i don't think you'll able interact vanilla browser confirmation dialog (i.e. alert box confirm buttons). know can't when using poltergeist driver
Comments
Post a Comment