Permalink
Browse files

more methods in Grid component, little changes in Component and Fieldset

  • Loading branch information...
roosevelt committed Jul 7, 2010
1 parent 8f514d7 commit 19d43d935dc5613b767abd491be74185de913995
@@ -1,4 +1,3 @@
-
require 'json'
module Ext
@@ -55,8 +54,8 @@ def method_missing(method_name, *args, &block)
cmd = Ext::build_remote_call(@id, method_name, arguments)
ret = @selenium.get_eval(cmd)
ret = JSON ret.split(":", 2)[1]
- if ret.start_with? "JSON:"
- end
+# if ret.start_with? "JSON:"
+# end
if ret == "true" || ret == "false"
ret = (ret =="true")
@@ -5,11 +5,8 @@ def init_component()
super()
end
- def collapsed=(flag)
- if collapsed != flag
- @selenium.click_at("//fieldset[@id='#{@id}']//*[contains(@class, 'x-tool-toggle') or @type='checkbox']", "0,0")
- end
+ def collapse
+ @selenium.click_at("//fieldset[@id='#{@id}']//*[contains(@class, 'x-tool-toggle')]", "0,0")
end
-
end
end
@@ -39,7 +39,46 @@ def wait_for_row_visible(label, timeout=10)
return false if (Time.now - t0) > timeout
end
end
- end
+
+ def wait_for_row_present(index, timeout=10)
+ xpath = node() + "//div[contains(@class, 'x-grid3-row') and position() = #{index}]"
+ t0 = Time.now
+ while true
+ begin
+ return true if @selenium.is_element_present(xpath)
+ rescue
+ end
+ return false if (Time.now - t0) > timeout
+ end
+ end
+
+ def row_lists_values(valueArray)
+ row_index = 1
+ row = node() + "//div[contains(@class, 'x-grid3-row') and position() = 1]"
+ while (@selenium.is_element_present(row) == true)
+ cell_content_index = 1
+ for value in valueArray
+ cell_content = row + "//td[contains(@class,'x-grid3-cell') and position() = #{cell_content_index}]//div[contains(@class, 'x-grid3-cell-inner') and text() = '#{value}']"
+ if @selenium.is_element_present(cell_content) == false and value != nil
+ row_found = false
+ break
+ else
+ row_found = true
+ end
+
+ cell_content_index+=1
+ end
+
+ if row_found == true
+ return row_index
+ end
+
+ row_index+=1
+ row = node() + "//div[contains(@class, 'x-grid3-row') and position() = #{row_index}]"
+ end
+ return false
+ end
+end
class EditorGrid < Grid
# number of lines of Grid (store!)

0 comments on commit 19d43d9

Please sign in to comment.