module Demo module Elements class Tabs include RSpec::Core::DSL def initialize define_me(:base) {@browser.link(:href, '#tab_base')} define_me(:registration) {@browser.link(:href, '#tab_user_reg')} end end class Dialogs include RSpec::Core::DSL def initialize define_me(:modal_dialog) { @browser.div(:id => 'test_modal_dialog') } define_me(:dialog) { @browser.div(:id => 'test_dialog') } define_me(:close_modal_dialog) { @browser.link(:class => /ui-dialog-titlebar-close/) } define_me(:close_dialog) { @browser.links(:class => /ui-dialog-titlebar-close/).last } define_me(:close_modal_dialog) { @browser.links(:class => /ui-dialog-titlebar-close/).first } end end class Menu include RSpec::Core::DSL def initialize define_me(:full_menu_div) {@browser.div(:id, 'main_menu')} define_me(:actions) { full_menu_div.link(:text, 'Actions') } define_me(:test_alert) { actions.mouseover full_menu_div.link(:text, 'Test Alert') } define_me(:test_dialog) { actions.mouseover full_menu_div.link(:text, 'Test Dialog') } define_me(:test_modal_dialog) { actions.mouseover full_menu_div.link(:text, 'Test Modal Dialog') } end end end end