This is a tasty Ruby DSL to test ExtJS applications using Selenium.
Please, it’s work in progress - wait for complete features or help us :)
Read more about testing ExtJS using Selenium:
-
ComboBox Support
-
Supporting all Fields
-
Full Grid editor support
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.
-
gem install selenium-extjs
You need a Selenium Server and its Official Ruby Client. Luckily, there is a Selenium RC included as a .jar.
-
gem install selenium-client
# 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
-
rake selenium:rc:start
-
cd ../test
-
RUBYOPT=-rubygems ruby combobox_test.rb
Send us a message!
Please, take a look at the “/test” folder.
@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
# 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 = ‘myemail@domain.br’ assert_true form.field.valid?
# :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)
# Click at cell x,y editorgrid.click_at_cell(2, 5)
Contact us!