Skip to content
Browse files

has_row method for listviews

  • Loading branch information...
1 parent 2a63746 commit 59bd04513b83a5a7263dbc58638ce4fe2f5decb0 @cathoderay committed Mar 24, 2010
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/selenium-extjs/component/ListView.rb
  2. +1 −1 test/list_view_test.rb
View
5 lib/selenium-extjs/component/ListView.rb
@@ -1,5 +1,10 @@
module Ext
class ListView < Component
+
+ def has_row(label)
+ @selenium.is_element_present(node() + "//div[contains(@class, 'x-list-body-inner')]//em[text() = '#{label}']")
+ end
+
def click_at_row(label)
@selenium.click_at(node() + "//div[contains(@class, 'x-list-body-inner')]//em[text() = '#{label}']", "0,0")
end
View
2 test/list_view_test.rb
@@ -10,9 +10,9 @@ class ListViewTest < Test::Unit::TestCase
def test_list_view
@s.open 'deploy/dev/examples/view/list-view.html'
listview = @s.find_ext(:xtype => "listview", :wait => true)
-
fail if not listview.is_a? Ext::ListView
listview.wait_for_row_visible('sara_pink.jpg')
+ p listview.has_row('sara_pink.jpg')
listview.click_at_row('sara_pink.jpg')
end
end

0 comments on commit 59bd045

Please sign in to comment.
Something went wrong with that request. Please try again.