コード例 #1
0
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()
コード例 #2
0
class MembersProfileMailPreference1(MembersProfileElement):
    def __init__(self, owner, locatordict={}):
        super(MembersProfileMailPreference1,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 = Radio(self,{'Yes':'mail_yes','No':'mail_no'})
        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()