class MembersProfileCitizenship(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileCitizenship,self).__init__(owner,locatordict) # load hub's classes MembersProfileCitizenship_Locators = self.load_class('MembersProfileCitizenship_Locators') # update this object's locator self.locators.update(MembersProfileCitizenship_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.coriginus = Radio(self,{'Yes':'coriginus_yes','No':'coriginus_no'}) self.corigin = Select(self,{'base':'corigin'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary with the values of coriginus, corigin, and access""" return {'coriginus' : self.coriginus.value(), 'corigin' : self.corigin.value(), 'access' : self.access.value()} def update(self,coriginus=None,corigin=None,access=None): """update the values of coriginus, corigin, and access""" if coriginus != None: self.coriginus.value = coriginus if corigin != None: self.corigin.value = corigin if access != None: self.access.value = access self.save.click()
class MembersProfileOrganization(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileOrganization,self).__init__(owner,locatordict) # load hub's classes MembersProfileOrganization_Locators = self.load_class('MembersProfileOrganization_Locators') # update this object's locator self.locators.update(MembersProfileOrganization_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.organization = Select(self,{'base':'organization'}) self.orgtext = Text(self,{'base':'orgtext'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary of the organization, orgtext, and access values""" return {'organization' : self.organization.value(), 'orgtext' : self.orgtext.value(), 'access' : self.access.value()} def update(self,organization=None,orgtext=None,access=None): """update the organization, orgtext, and access values""" if organization != None: self.organization.value = organization if orgtext != None: self.orgtext.value = orgtext if access != None: self.access.value = access self.save.click()
class MembersProfileEmployment(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileEmployment,self).__init__(owner,locatordict) # load hub's classes MembersProfileEmployment_Locators = self.load_class('MembersProfileEmployment_Locators') # update this object's locator self.locators.update(MembersProfileEmployment_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.employment = Select(self,{'base':'employment'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary with employment and access values""" return {'employment' : self.employment.value(), 'access' : self.access.value()} def update(self,employment=None,access=None): """update the employment and access values""" if employment != None: self.employment.value = employment if access != None: self.access.value = access self.save.click()
class MembersProfileMailPreference2(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileMailPreference2,self).__init__(owner,locatordict) # load hub's classes MembersProfileMailPreference_Locators = self.load_class('MembersProfileMailPreference_Locators') # update this object's locator self.locators.update(MembersProfileMailPreference_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.mailpreference = Select(self,{'base':'mailpref'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary of the mailpreference and access values""" return {'mailpreference' : self.mailpreference.value(), 'access' : self.access.value()} def update(self,mailpreference=None,access=None): """update the mailpreference and access values""" if mailpreference != None: self.mailpreference.value = mailpreference if access != None: self.access.value = access self.save.click()
class MembersProfileInterests(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileInterests,self).__init__(owner,locatordict) # load hub's classes MembersProfileInterests_Locators = self.load_class('MembersProfileInterests_Locators') # update this object's locator self.locators.update(MembersProfileInterests_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.interests = TextAC(self,{'base':'interests', 'aclocatorid':'interestsac', 'choicelocatorid':'interestsacchoices', 'tokenlocatorid':'interestsactoken', 'deletelocatorid':'interestsacdelete'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary of the interests and access values""" return {'interests' : self.interests.value(), 'access' : self.access.value()} def update(self,interests=None,access=None): """update the value of the interests and access values""" if interests != None: self.interests.value = interests if access != None: self.access.value = access self.save.click()
class MembersProfileEmail(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileEmail,self).__init__(owner,locatordict) # load hub's classes MembersProfileEmail_Locators = self.load_class('MembersProfileEmail_Locators') # update this object's locator self.locators.update(MembersProfileEmail_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.email = Text(self,{'base':'email'}) self.confirmemail = Text(self,{'base':'confirmemail'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary of email, confirmemail, and access values""" return {'email' : self.email.value(), 'confirmemail' : self.confirmemail.value(), 'access' : self.access.value()} def update(self,email=None,confirmemail=None,access=None): """update values for email, confirmemail, and access values""" if email != None: self.email.value = email if confirmemail != None: self.confirmemail.value = confirmemail if access != None: self.access.value = access self.save.click()
def author_role(self,author,role=None): """adjust the role for an author, returning the old role""" rowEle = self._get_author_row(author) roleEle = self.find_element(self.locators['role'],rowEle) #FIXME: shenanigans begin roleid = roleEle.get_attribute('id') key = "roleid-%s" % (roleid) self.locators[key] = "css=#%s" % (roleid) obj = Select(self,{'base':key}) obj.detach_from_owner() #FIXME: shenanigans end oldrole = obj.selected() if role: obj.value = role # click the "save changes" button self.submit.click() del obj del self.locators[key] return oldrole
class MembersProfileBiography(MembersProfileElement): def __init__(self, owner, locatordict={}): super(MembersProfileBiography,self).__init__(owner,locatordict) # load hub's classes MembersProfileBiography_Locators = self.load_class('MembersProfileBiography_Locators') # update this object's locator self.locators.update(MembersProfileBiography_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.biography = TextArea(self,{'base':'biography'}) self.access = Select(self,{'base':'access'}) # update the component's locators with this objects overrides self._updateLocators() def value(self): """return a dictionary with the biography and access value settings""" return {'biography' : self.biography.value(), 'access' : self.access.value()} def update(self,biography=None,access=None): """update the biography and access settings""" if biography != None: self.biography.value = biography if access != None: self.access.value = access self.save.click()