Class: EntityPicker

Inherits:
BasePage
  • Object
show all
Defined in:
lib/sambal-cle/page_objects/entity_picker.rb

Instance Method Summary collapse

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#close_pickerObject



20
21
22
23
24
# File 'lib/sambal-cle/page_objects/entity_picker.rb', line 20

def close_picker
  self.window.close
  self.window(:index=>0).use
  self.frame(:index=>2).button(:id=>"btnCancel").click
end

#select_assignment(title) ⇒ Object



13
14
15
16
17
18
# File 'lib/sambal-cle/page_objects/entity_picker.rb', line 13

def select_assignment(title)
  view_assignment_details(title)
  self.link(:text=>"Select this item").click
  self.window(:index=>0).use
  self.frame(:index=>2).button(:id=>"btnOk").click
end

#view_assignment_details(title) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/sambal-cle/page_objects/entity_picker.rb', line 3

def view_assignment_details(title)
  unless self.div(:class=>"title", :text=>title).present?
    self.link(:text=>"Assignments").wait_until_present(5)
    self.link(:text=>"Assignments").click
    self.link(:text=>title).wait_until_present(15)
    self.link(:text=>title).click
  end
  self.div(:class=>"title", :text=>title).wait_until_present(5)
end

#view_forum_details(title) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/sambal-cle/page_objects/entity_picker.rb', line 26

def view_forum_details(title)
  unless self.span(:class=>"entity-item-label icon-sakai-entity-forum", :text=>title).present?
    self.link(:class=>/entity-item-label icon-sakai-entity-forum/).wait_until_present(10)
    self.link(:class=>/entity-item-label icon-sakai-entity-forum/).click
    self.link(:text=>title).wait_until_present(10)
    self.link(:text=>title).click
  end
  self.div(:class=>"title", :text=>title).wait_until_present
end

#view_topic_details(forum, topic) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sambal-cle/page_objects/entity_picker.rb', line 36

def view_topic_details(forum, topic)
  unless self.span(:class=>"entity-item-label icon-sakai-entity-forum", :text=>title).present?
    self.link(:class=>/entity-item-label icon-sakai-entity-forum/).wait_until_present(10)
    self.link(:class=>/entity-item-label icon-sakai-entity-forum/).click
    self.link(:text=>forum).wait_until_present(10)
    self.link(:text=>forum).click
    self.link(:text=>topic).wait_until_present(10)
    self.link(:text=>topic).click
  end
  self.div(:class=>"title", :text=>topic).wait_until_present(10)
end