fordelive / capybara_test

lesson 3 task3
0 stars 0 forks source link

Result validation #1

Open alexey-voronenko opened 5 years ago

alexey-voronenko commented 5 years ago

Use capybara matchers to validate expectations for your scenarios. Example: instead of

  if @session.has_xpath?("//h3[contains(text(),'Login form')]")
    write_result(__method__, :passed)
  else
    write_result(__method__, :failed)
  end

Try: expect(page).to have_xpath("//h3[contains(text(),'Login form')]")

alexey-voronenko commented 5 years ago

If built-in expectations is not enough for your cases you can check out rspec matchers gem

fordelive commented 5 years ago

Hi, I've created a pull request https://github.com/fordelive/capybara_test/pull/2 Check please.