Skip to content

A framework in ruby to test your extjs applications with selenium

Notifications You must be signed in to change notification settings

cathoderay/selenium-extjs

Repository files navigation

Selenium-extjs

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:

Roadmap

  • ComboBox Support

  • Supporting all Fields

  • Full Grid editor support

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.

Installation

  • gem install selenium-extjs

Installation (from the source code)

Prerequisites

You need a Selenium Server and its Official Ruby Client. Luckily, there is a Selenium RC included as a .jar.

  • gem install selenium-client

Steps to install

# 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

Run your first test

  • rake selenium:rc:start

  • cd ../test

  • RUBYOPT=-rubygems ruby combobox_test.rb

Contributing

Send us a message!

Some Examples

Please, take a look at the “/test” folder.

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 Forms

# 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?

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)

# Click at cell x,y editorgrid.click_at_cell(2, 5)

Problems?

Contact us!

About

A framework in ruby to test your extjs applications with selenium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •