Module: AddRemoveCategories

Includes:
PageObject
Defined in:
lib/sakai-oae-test-api/pop_up_dialogs.rb

Overview

Page Objects and Methods related to the Pop Up for Categories.

Instance Method Summary collapse

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

#check_category(text) ⇒ Object

Checks the specified category.



421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 421

def check_category(text)
  if self.link(:title=>text).exists? == false
    puts "\nCategory...\n#{text}\n...not found in list!\n\nPlease check for typos in your test data.\n"
  end
  if self.link(:title=>text).visible? == false
    self.link(:title=>text).parent.parent.parent.ins.click
  end
  if self.link(:title=>text).parent.class_name =~ /jstree-unchecked/
    self.link(:title=>text).click
  end
  sleep 0.3
end

#open_tree(text) ⇒ Object

Opens the specified category tree.



416
417
418
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 416

def open_tree(text)
  self.link(:title=>text).parent.ins.fire_event("onclick")
end

#selected_categoriesObject

Returns an array of the categories selected in the pop-up container.



435
436
437
438
439
440
441
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 435

def selected_categories
  list = []
  self.div(:id=>"assignlocation_jstree_selected_container").lis.each do |li|
    list << li.text
  end
  return list
end