Module: Workflows
- Included in:
- AnnouncementObject, AssessmentObject, AssignmentObject, CitationListObject, ContentSectionObject, EventObject, FileObject, FolderObject, ForumObject, HTMLPageObject, MessageFolderObject, MessageObject, ModuleObject, SiteObject, SyllabusObject, TextDocumentObject, WebContentObject, WebLinkObject, WikiObject
- Defined in:
- lib/sakai-cle-test-api/workflows.rb
Overview
Workflows is a module containing helper navigation methods
Class Method Summary collapse
Instance Method Summary collapse
-
#open_my_site_by_name(name) ⇒ Object
Opens “My Sites” and then clicks on the matching Site name.
Class Method Details
.menu_link(name, opts = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/sakai-cle-test-api/workflows.rb', line 4 def self. 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 |