Module: Workflows

Overview

Workflows is a module containing helper navigation methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



4
5
6
7
8
# File 'lib/sambal-cle/workflows.rb', line 4

def self.menu_link name, title, opts={}
  define_method name.to_s do
      @browser.link(opts).click unless @browser.title=~/#{title}/
  end
end

Instance Method Details

#open_my_site_by_name(name) ⇒ Object

Opens “My Sites” and then clicks on the matching Site name–unless the specified site is what you’re already in. Shortens the name used for search so that truncated names are not a problem.



14
15
16
17
18
19
# File 'lib/sambal-cle/workflows.rb', line 14

def open_my_site_by_name(name)
  unless @browser.title=~/#{name}/
    @browser.link(:text, "My Sites").click
    @browser.link(:text, /#{Regexp.escape(name[0..19])}/).click
  end
end

#resetObject

The Page Reset button, found on all Site pages



216
217
218
# File 'lib/sambal-cle/workflows.rb', line 216

def reset
  @browser.link(:href=>/tool-reset/).click
end