Module: ChangePicturePopUp

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

Overview

Page Objects and Custom Methods related to the “Select your profile picture” pop-up dialog

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

#save_new_selectionObject

Clicks the Save button for the Change Picture Pop Up.



573
574
575
576
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 573

def save_new_selection
  self.save_element.when_visible { self.save }
  self.wait_for_ajax
end

#thumbnail_sourceObject



578
579
580
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 578

def thumbnail_source
  self.thumbnail_element.src
end

#upload_a_new_picture(file_name, file_path = "") ⇒ Object

Uploads the specified file name for the Avatar photo. The method takes an optional file_path parameter that allows the file_name and its file_path to be distinct variables.



564
565
566
567
568
569
570
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 564

def upload_a_new_picture(file_name, file_path="")
  self.back_to_top
  #puts(File.expand_path(file_path + file_name)
  self.pic_file_element.when_visible { self.pic_file=(file_path + file_name) }
  self.upload
  self.linger_for_ajax(5)
end