Selenium-extjs
Please, it’s work in progress - wait for complete features or help us :)
More information about extjs and selenium tests:
How it works?
It’s used the ‘get_eval’ to get Ext’s components information (like id) using the window.Ext object and common selenium methods (like: type, click_at) to change the application status.
Instalation
# TODO: deploy gem
-
git clone git://github.com/cathoderay/selenium-extjs.git
-
cd selenium-extjs
-
rake package
-
cd pkg
-
gem install selenium-extjs-0.0.1.gem
Contributing
Send us a message!
Some Examples
Please, take a look at “/test” files.
Simple
@selenium = [..your selenium object..]
appfeedgrid = @selenium.find_ext(:xtype => “appfeedgrid”)
button = @selenium.find_ext(:xtype => “button”, :text => ‘Open All’, :xparent => appfeedgrid) # click method wait for any request complete button.click
Working with Form
# search for form. form = @selenium.find_ext(:xtype => “form”, :title_has => ‘Simple’)
form.field.value = “NotAEmail”
# convert to “isValid” and run at client. assert_false form.field.valid?
form.fields.value = ‘[email protected]’ assert_true form.field.valid?
Working with Grid and Ajax Content.
# :wait blocks test, waiting for window window = @selenium.find_ext(:xtype => ‘window’, :wait => true, :title => ‘Store Load Callback’) # close the window window.close
# search for editorgrid component. editorgrid = @selenium.find(:xtype => “editorgrid”)
# number of lines print editorgrid.num_rows()
# set row 1 with data editorgrid.edit_row(1, [“Jorge”, “Shade”, “10.10”, “24/03/06”, true]);
# get row (hash) print editorgrid.get_row(3)
# clica at cell x,y editorgrid.click_at_cell(2, 5)