mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Tests (#9)
* adding test for finding find-owners page * verify Veterinarians is there * adding test for searching for veternarians and finding Helen * removing save screenshot * using longer explicit wait * changing wait to 3 * putting sleep back in * putting sleep back in * sleep
This commit is contained in:
parent
251dd8f8d0
commit
b83c0b2d53
1 changed files with 31 additions and 11 deletions
|
@ -10,7 +10,8 @@ describe 'Petlinic' do
|
|||
|
||||
@driver = Selenium::WebDriver.for :firefox
|
||||
@driver.navigate.to 'http://tomcat:8080/petclinic'
|
||||
@wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
||||
@wait = Selenium::WebDriver::Wait.new(:timeout => 30)
|
||||
@driver.manage.timeouts.implicit_wait = 30
|
||||
end
|
||||
|
||||
after do
|
||||
|
@ -19,19 +20,38 @@ describe 'Petlinic' do
|
|||
|
||||
describe 'when homepage is available' do
|
||||
it 'I should see page title containing PetClinic' do
|
||||
puts "Title is: #{@driver.title}"
|
||||
assert @driver.title == "PetClinic :: a Spring Framework demonstration"
|
||||
sleep 3
|
||||
assert @driver.title == "PetClinic :: a Spring Framework demonstration"
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when homepage is available' do
|
||||
it 'click the find owners link' do
|
||||
@driver.find_element(:class, "icon-search").click
|
||||
sleep 3
|
||||
h2 = @driver.find_element(:tag_name, "h2")
|
||||
assert h2.text == "Find Owners"
|
||||
end
|
||||
end
|
||||
|
||||
# describe 'when homepage is available' do
|
||||
# it 'click the find owners button' do
|
||||
# @driver.find_element(:class, "icon-search").click
|
||||
# form = @driver.find_element(:id, "lastName")
|
||||
# puts "form is #{form.label}"
|
||||
# assert @driver.title == "PetClinic :: a Spring Framework demonstration"
|
||||
# end
|
||||
# end
|
||||
describe 'when homepage is available' do
|
||||
it 'click the veterinarians link' do
|
||||
@driver.find_element(:class, "icon-th-list").click
|
||||
sleep 3
|
||||
h2 = @driver.find_element(:tag_name, "h2")
|
||||
assert h2.text == "Veterinarians"
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when homepage is available' do
|
||||
it 'search for veterinarian' do
|
||||
@driver.find_element(:class, "icon-th-list").click
|
||||
search_box = @driver.find_element(:id, "vets_filter")
|
||||
textBox = search_box.find_element(:tag_name, "input")
|
||||
textBox.send_keys("Helen Leary")
|
||||
vets = @driver.find_element(:id, "vets").text
|
||||
assert vets.split("\n")[1] == "Helen Leary radiology"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue