Module: DocumentWidget
- Includes:
- PageObject
- Defined in:
- lib/sakai-oae-test-api/widgets.rb
Overview
Methods associated with documents that use the TinyMCE Editor.
Instance Method Summary collapse
-
#add_content=(text) ⇒ Object
Appends the specified string to the contents of the TinyMCE Editor.
-
#insert_text ⇒ Object
Clicks the Text Box of the TinyMCE Editor so that the edit cursor will become active in the Editor.
-
#save ⇒ Object
Clicks the Save button.
-
#select_all ⇒ Object
Selects all the contents of the TinyMCE Editor.
-
#set_content=(text) ⇒ Object
Erases the entire contents of the TinyMCE Editor, then enters the specified string into the Editor.
Methods included from PageObject
#method_missing, #name_li, #name_link
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PageObject
Instance Method Details
#add_content=(text) ⇒ Object
Appends the specified string to the contents of the TinyMCE Editor.
67 68 69 70 |
# File 'lib/sakai-oae-test-api/widgets.rb', line 67 def add_content=(text) self.frame(:id=>"elm1_ifr").body(:id=>"tinymce").fire_event("onclick") self.frame(:id=>"elm1_ifr").send_keys(text) end |
#insert_text ⇒ Object
Clicks the Text Box of the TinyMCE Editor so that the edit cursor will become active in the Editor.
79 80 81 |
# File 'lib/sakai-oae-test-api/widgets.rb', line 79 def insert_text self.frame(:id=>"elm1_ifr").body(:id=>"tinymce").fire_event("onclick") end |
#save ⇒ Object
Clicks the Save button. Waits for Ajax calls to fall off.
52 53 54 55 56 |
# File 'lib/sakai-oae-test-api/widgets.rb', line 52 def save self. sleep 1 self.wait_for_ajax end |
#select_all ⇒ Object
Selects all the contents of the TinyMCE Editor
73 74 75 |
# File 'lib/sakai-oae-test-api/widgets.rb', line 73 def select_all self.frame(:id=>"elm1_ifr").send_keys( [:command, 'a'] ) end |
#set_content=(text) ⇒ Object
Erases the entire contents of the TinyMCE Editor, then enters the specified string into the Editor.
60 61 62 63 64 |
# File 'lib/sakai-oae-test-api/widgets.rb', line 60 def set_content=(text) self.frame(:id=>"elm1_ifr").body(:id=>"tinymce").fire_event("onclick") self.frame(:id=>"elm1_ifr").send_keys( [:command, 'a'] ) self.frame(:id=>"elm1_ifr").send_keys(text) end |