Module: Workflows
- Included in:
- AnnouncementObject, AssessmentObject, AssessmentSubmissionObject, AssignmentObject, AssignmentPermissionsObject, AssignmentSubmissionObject, AudioRecordingQuestion, BlogEntryObject, BloggerPostObject, CalculatedQuestion, CellObject, ChatRoomObject, CitationListObject, ContentSectionObject, CourseSiteObject, EventObject, FileObject, FileUploadQuestion, FillInBlankQuestion, FolderObject, ForumObject, GlossaryTermObject, HTMLPageObject, MatchingQuestion, MatrixObject, MessageFolderObject, MessageObject, ModuleObject, MultipleChoiceQuestion, NumericResponseQuestion, PartObject, PollObject, PoolObject, PortfolioSiteObject, ShortAnswerQuestion, SurveyQuestion, SyllabusObject, TextDocumentObject, TopicObject, TrueFalseQuestion, UserObject, WebContentObject, WebLinkObject, WikiObject
- Defined in:
- lib/sambal-cle/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–unless the specified site is what you’re already in.
-
#reset ⇒ Object
The Page Reset button, found on all Site pages.
Class Method Details
.menu_link(name, title, opts = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/sambal-cle/workflows.rb', line 4 def self. 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 |
#reset ⇒ Object
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 |