Skip to content

Instantly share code, notes, and snippets.

@toranb
Last active December 10, 2017 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toranb/961f26466012ca3dcb69b216d8150050 to your computer and use it in GitHub Desktop.
Save toranb/961f26466012ca3dcb69b216d8150050 to your computer and use it in GitHub Desktop.
require 'watir-webdriver'
include Selenium
describe "Acceptance tests" do
before :each do
@b = Watir::Browser.new :firefox
end
after :each do
@b.close
end
describe "high level application tests" do
it "delete action will remove person from the table" do
@b.goto "http://127.0.0.1:3000/"
table = @b.table(:id => 'people')
assert_equal table.rows.length, 2
@b.table(:id => 'people')[1][1].button(:class,"delete").click
table = @b.table(:id => 'people')
assert_equal table.rows.length, 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment