Module: FCKEditor

Instance Method Summary collapse

Instance Method Details

#enter_source_text(editor, text) ⇒ Object



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

def enter_source_text(editor, text)
  source(editor)
  source_field(editor).wait_until_present
  source_field(editor).set text
end

#entity_picker(editor) ⇒ Object



27
28
29
30
31
32
# File 'lib/sakai-cle-test-api/rich_text.rb', line 27

def entity_picker(editor)
  editor.div(:title=>"Sakai_Entity_Link").wait_until_present
  editor.div(:title=>"Sakai_Entity_Link").click
  @browser.frame(:index=>2).frame(:id=>"frmMain").button(:value=>"Browse Server").click
  @browser.window(:url=>/sakai-entitybrowser-tool/).use
end

#get_source_text(editor) ⇒ Object



21
22
23
24
25
# File 'lib/sakai-cle-test-api/rich_text.rb', line 21

def get_source_text(editor)
  source(editor)
  source_field(editor).wait_until_present
  source_field(editor).value
end

#select_all(editor) ⇒ Object



10
11
12
13
# File 'lib/sakai-cle-test-api/rich_text.rb', line 10

def select_all(editor)
  editor.div(:title=>"Select All").wait_until_present
  editor.div(:title=>"Select All").click
end

#source(editor) ⇒ Object

This has to be defined this way because there several pages that have multiple rich text editors.



5
6
7
8
# File 'lib/sakai-cle-test-api/rich_text.rb', line 5

def source(editor)
  editor.div(:title=>/Source/).wait_until_present
  editor.div(:title=>/Source/).click
end

#source_field(editor) ⇒ Object



34
35
36
# File 'lib/sakai-cle-test-api/rich_text.rb', line 34

def source_field(editor)
  editor.text_field(:class=>"SourceField")
end