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:

  1. install capybara-webkit
  2. add capybara.javascript_driver = :webkit spec_helper.rb
  3. 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:

  1. your link titled "account" above , looking "account settings". typo?
  2. 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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -