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/sakai-cle-test-api/workflows.rb', line 4

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

Instance Method Details

#open_my_site_by_name(name) ⇒ Object

Opens “My Sites” and then clicks on the matching Site name. Shortens the name used for search so that truncated names are not a problem. Should be followed by the Home class.

Will error out if there are not matching links.



16
17
18
19
20
# File 'lib/sakai-cle-test-api/workflows.rb', line 16

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