Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
Wait until stuff is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessByte committed Jun 7, 2013
1 parent d7b076d commit 35395ca
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
multi_json (1.7.3)
multi_json (1.7.6)
nested_form (0.3.2)
nokogiri (1.5.9)
nokogiri (1.5.9-x86-mingw32)
Expand Down Expand Up @@ -142,7 +142,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
selenium-webdriver (2.32.1)
selenium-webdriver (2.33.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
Expand Down
46 changes: 34 additions & 12 deletions test/integration/main_view_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,59 @@ class MainViewTest < ActionDispatch::IntegrationTest
#Mouseover event on class module-hitbox
#Check if popover showed up on mouseover
test "module mouseover" do
sleep( 2 )
el = @wait.until { @driver.find_element(:class, "cellgrowth-hitbox") }
@driver.mouse.move_to(el)
pop = @wait.until { @driver.find_element(:class, "cellgrowth-box") }
assert pop.displayed?
displayed = false
if @wait.until { el.displayed? }
@driver.mouse.move_to(el)
pop = @wait.until { @driver.find_element(:class, "cellgrowth-box") }
displayed = @wait.until { pop.displayed? }
end
assert displayed
end

#Click on module
#Check if edit popover showed up
test "open edit popover" do
sleep( 2 )
el = @wait.until { @driver.find_element(:class, "module-hitbox") }
el.click
pop = @wait.until { @driver.find_element(:class, "popover") }
assert pop.displayed?
displayed = false
if @wait.until { el.displayed? }
el.click
pop = @wait.until { @driver.find_element(:class, "selected") }
displayed = @wait.until { pop.displayed? }
end
assert displayed
end

#Click on dummy module
#Check wether a module has been added
test "add a module" do
el = @wait.until { @driver.find_element(:class, "inactive") }
el.click
newmodule = @wait.until { @driver.find_element(:class, "module-hitbox") }
assert newmodule.displayed?
sleep( 2 )
els = @wait.until { @driver.find_elements(:class, "inactive") }
displayed = false
for el_pot in els
if el_pot.displayed?
el = el_pot
break
end
end
if el and @wait.until { el.displayed? }
el.click
newmodule = @wait.until { @driver.find_element(:class, "module-hitbox") }
displayed = @wait.until { newmodule.displayed? }
end
assert displayed
end

#Click on Action History Pane
#Check if pane showed up
test "view the actionhistory pane" do
el = @wait.until { @driver.find_element(:class, "pane-button") }
el.click
pane = @wait.until { @driver.find_element(:class, "pane-left") }
assert_equal pane.attribute("class"), "pane pane-left extended"
assert_equal "pane pane-left extended", pane.attribute("class")
el.click
assert_equal "pane pane-left", pane.attribute("class")
end

end

0 comments on commit 35395ca

Please sign in to comment.