Class: Glossary

Inherits:
BasePage show all
Defined in:
lib/sakai-cle-test-api/page_objects/glossary.rb

Overview

Glossary Pages - for a Portfolio Site

Instance Method Summary collapse

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageMaker

Instance Method Details

#addObject



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

def add
  frm.link(:text=>"Add").click
  frm.frame(:id, "longDescription___Frame").td(:id, "xEditingArea").wait_until_present
  AddEditTerm.new(@browser)
end

#delete(term) ⇒ Object



25
26
27
28
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 25

def delete(term)
  frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(term)}/).link(:text=>"Delete").click
  AddEditTerm.new(@browser)
end

#edit(term) ⇒ Object



20
21
22
23
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 20

def edit(term)
  frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(term)}/).link(:text=>"Edit").click
  AddEditTerm.new(@browser)
end

#importObject



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

def import
  frm.link(:text=>"Import").click
  GlossaryImport.new(@browser)
end

#open(term) ⇒ Object



30
31
32
33
34
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 30

def open(term)
  frm.link(:text=>term).click
  #FIXME!
  # Need to do special handling here because of the new window.
end

#termsObject

Returns an array containing the string values of the terms displayed in the list.



38
39
40
41
42
43
44
45
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 38

def terms
  term_list = []
  frm.table(:class=>"listHier lines nolines").rows.each do |row|
    term_list << row[0].text
  end
  term_list.delete_at(0)
  return term_list
end