On 7/3/06, George Flaherty <[EMAIL PROTECTED]> wrote:
Is there a preferred way to map out Watir UI components/features before test execution, then possibly "bind" them later? I know there have been some conversations regarding a Watir::Map class, but is there some other way until that feature is added? My main goal is to not duplicate UI features throughout various Test Suites.

Thanks
-george

I know that i was talking about creating a Map class, but recently  i've found that it was easier to just create small methods that returned various elements. Here's some of my code:

  class AddMatterDialogMap
    def initialize (modal)
      @browser = modal
    end
   
    def matter_name; @browser.text_field(:id, 'txtMatterName'); end
    def matter_no; @browser.text_field (:id, 'txtMatterNo'); end
    def work_group; @browser.select_list(:id, 'ddWorkGroup'); end
    def professional_in_charge; @browser.select_list(:id, 'ddPic'); end
    def city; @browser.text_field(:id, 'txtCity'); end
    def zip; @browser.text_field(:id, 'txtZip'); end
    def country; @browser.select_list(:id, 'ddlCountry'); end
    def open_date; @browser.text_field(:id, 'txtOpenDate'); end
    def matter_type; @browser.select_list (:id, 'ddMatterType'); end
    def close_date; @browser.text_field(:id, 'txtCloseDate'); end
    def litigation; @browser.select_list(:id, 'ddLitigation'); end
    def closed; @browser.checkbox(:id, 'chkClosed'); end
    def notes; @browser.text_field(:id, 'txtNotes'); end
  end 


So to use this ...

  map = AddMatterDialogMap.new ie
  map.open_date.set '1/1/06'

Bret
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to