mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 21:45:49 +00:00
Removed minutest/spec dependency
Better test titles use single quotes
This commit is contained in:
parent
6104f9801e
commit
67b75a905b
1 changed files with 17 additions and 19 deletions
|
@ -1,6 +1,5 @@
|
|||
require 'headless'
|
||||
require 'selenium-webdriver'
|
||||
require 'minitest/spec'
|
||||
require 'minitest/autorun'
|
||||
|
||||
describe 'Petlinic' do
|
||||
|
@ -10,7 +9,6 @@ describe 'Petlinic' do
|
|||
|
||||
@driver = Selenium::WebDriver.for :firefox
|
||||
@driver.navigate.to 'http://tomcat:8080/petclinic'
|
||||
@wait = Selenium::WebDriver::Wait.new(:timeout => 30)
|
||||
@driver.manage.timeouts.implicit_wait = 30
|
||||
end
|
||||
|
||||
|
@ -19,38 +17,38 @@ describe 'Petlinic' do
|
|||
end
|
||||
|
||||
describe 'when homepage is available' do
|
||||
it 'I should see page title containing PetClinic' do
|
||||
it 'should show correct page title' do
|
||||
sleep 3
|
||||
assert @driver.title == "PetClinic :: a Spring Framework demonstration"
|
||||
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
|
||||
it 'should have Find Owners page' do
|
||||
@driver.find_element(:class, 'icon-search').click
|
||||
sleep 3
|
||||
h2 = @driver.find_element(:tag_name, "h2")
|
||||
assert h2.text == "Find Owners"
|
||||
h2 = @driver.find_element(:tag_name, 'h2')
|
||||
assert h2.text == 'Find Owners'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when homepage is available' do
|
||||
it 'click the veterinarians link' do
|
||||
@driver.find_element(:class, "icon-th-list").click
|
||||
it 'should have veterinarians page' do
|
||||
@driver.find_element(:class, 'icon-th-list').click
|
||||
sleep 3
|
||||
h2 = @driver.find_element(:tag_name, "h2")
|
||||
assert h2.text == "Veterinarians"
|
||||
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"
|
||||
it 'should have search for veterinarian feature' 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue