Skip to content

Commit

Permalink
Merge pull request #73 from ot-chris-holt/master
Browse files Browse the repository at this point in the history
increased timeouts, 0.7.25
  • Loading branch information
ot-chris-holt committed Apr 17, 2012
2 parents b4ad63c + 626079a commit c0ec4f0
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def NavigateTo(page)
end

def CurrentUrl
wait = Selenium::WebDriver::Wait.new(:timeout => 20)
wait = Selenium::WebDriver::Wait.new(:timeout => 60)
url = wait.until { x = self.Browser().current_url
x unless x == nil
}
Expand Down Expand Up @@ -128,7 +128,7 @@ def ShouldNavigateTo(page, comparator)
$page ||= page

timeout = GetValue(page, :wait)
timeout ||= 20
timeout ||= 60

$page.Init

Expand Down Expand Up @@ -202,7 +202,7 @@ def FindItem(array, comparator = nil)
end

def FindItemWithWait(array, comparator=nil)
masterWait = Selenium::WebDriver::Wait.new(:timeout => 5)
masterWait = Selenium::WebDriver::Wait.new(:timeout => 20)

element = masterWait.until {
x = FindItem(array, comparator)
Expand All @@ -227,7 +227,7 @@ def FindItemWithoutWait(array, comparator=nil)
end

def FindAllItems(array)
masterWait = Selenium::WebDriver::Wait.new(:timeout => 5)
masterWait = Selenium::WebDriver::Wait.new(:timeout => 20)

element = masterWait.until {
x = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/sapphire/DSL/Browser/Verbs/Remove.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module DSL
module Browser
def Remove(item)
ExecuteHashAgainstControl(item) do |control, arg|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
wait = Selenium::WebDriver::Wait.new(:timeout => 20)
begin
evaluation = wait.until { x = control
val = x.Text
Expand Down
2 changes: 1 addition & 1 deletion lib/sapphire/WebAbstractions/Controls/Base/Control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def Evaluate(key, arg, comparator, block)

value = GetValue(arg, key)
timeout = GetValue(arg, :wait)
timeout ||= 5
timeout ||= 20

begin
value = value.Text if value.is_a? Control
Expand Down
2 changes: 1 addition & 1 deletion lib/sapphire/WebAbstractions/Controls/List.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def Contain(value)
end

def Click
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
wait = Selenium::WebDriver::Wait.new(:timeout => 20)
begin
clicked = wait.until { items = self.FindAll
if items.empty? == false
Expand Down
2 changes: 1 addition & 1 deletion lib/sapphire/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Sapphire
VERSION = "0.7.24"
VERSION = "0.7.25"
end
4 changes: 4 additions & 0 deletions tests/BasicPage/BasicPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ <h1 id="welcome">Welcome</h1>
<br>
<input type="text" value="Jane Doe" readonly="readonly" id="read_only">

<br>
<br>
<span id="credit_score">600</span>

<script type="text/javascript">
$(document).ready(function() {
setTimeout(function() {$("#ajax").html("ajax loaded");}, 4000)
Expand Down
1 change: 1 addition & 0 deletions tests/BasicPage/Pages/BasicPage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def Init
TextArea :notes, :id => "notes"
Button :click_me_to_add_note!, :id => "add_note"
TextBox :read_only, :id => "read_only"
Label :credit_score, :id => "credit_score"

end

Expand Down
6 changes: 6 additions & 0 deletions tests/BasicPage/Specs/Evaluators/ShowSpecs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
And "the first name should not be Jane" do
Should Not Show :first_name => "Jane"
end
And "the credit score should be 600" do
Should Not Show :credit_score => "600"
end
And "the credit score should not be 601" do
Should Not Show :credit_score => "601"
end
And "the page should not be the incorrect page" do
Should Not Show IncorrectPage
end
Expand Down

0 comments on commit c0ec4f0

Please sign in to comment.