Example #1
0
class TagSearchBox(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(TagSearchBox,self).__init__(owner,locatordict)

        # load hub's classes
        TagSearchBox_Locators = self.load_class('TagSearchBox_Locators')

        # update this object's locator
        self.locators.update(TagSearchBox_Locators.locators)

        # update the locators with those from the owner
        self.update_locators_from_owner()

        # setup page object's components
        self.tags            = TextAC(self,{'base':'tags',
                                            'aclocatorid':'tagsac',
                                            'choicelocatorid':'tagsacchoices',
                                            'tokenlocatorid':'tagsactoken',
                                            'deletelocatorid':'tagsacdelete'})
        self.submit          = Button(self,{'base':'submit'})

        # update the component's locators with this objects overrides
        self._updateLocators()


    def search_for(self,terms):
        """perform a search for resources tagged with terms"""

        self.tags.remove_all()
        for t in terms:
            self.tags.send_keys(t+'\n',timeout=-1)
        self.submit.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()
Example #3
0
    def __init__(self, owner, locatordict={}):
        super(TagSearchBox,self).__init__(owner,locatordict)

        # load hub's classes
        TagSearchBox_Locators = self.load_class('TagSearchBox_Locators')

        # update this object's locator
        self.locators.update(TagSearchBox_Locators.locators)

        # update the locators with those from the owner
        self.update_locators_from_owner()

        # setup page object's components
        self.tags            = TextAC(self,{'base':'tags',
                                            'aclocatorid':'tagsac',
                                            'choicelocatorid':'tagsacchoices',
                                            'tokenlocatorid':'tagsactoken',
                                            'deletelocatorid':'tagsacdelete'})
        self.submit          = Button(self,{'base':'submit'})

        # update the component's locators with this objects overrides
        self._updateLocators()
    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()