当前位置: 首页>>代码示例>>Python>>正文


Python Link.click方法代码示例

本文整理汇总了Python中hubcheck.pageobjects.basepageelement.Link.click方法的典型用法代码示例。如果您正苦于以下问题:Python Link.click方法的具体用法?Python Link.click怎么用?Python Link.click使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hubcheck.pageobjects.basepageelement.Link的用法示例。


在下文中一共展示了Link.click方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ToolsStatusApproveConfirmLicensePage

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class ToolsStatusApproveConfirmLicensePage(GenericPage):
    def __init__(self,browser,catalog,toolname=''):
        super(ToolsStatusApproveConfirmLicensePage,self)\
            .__init__(browser,catalog)
        self.path = '/tools/%s/license?action=confirm' % (toolname)

        # load hub's classes
        ToolsStatusApproveConfirmLicensePage_Locators = \
            self.load_class(
            'ToolsStatusApproveConfirmLicensePage_Locators')
        ToolsStatusApproveLicenseForm = \
            self.load_class('ToolsStatusApproveLicenseForm')

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

        # setup page object's components
        self.tool_status  = Link(self,{'base':'tool_status'})
        self.new_tool  = Link(self,{'base':'new_tool'})
        self.license_form = ToolsStatusApproveLicenseForm(self)

    def goto_tool_status(self):
        return self.tool_status.click()

    def goto_new_tool(self):
        return self.new_tool.click()

    def populate_form(self,data):
        return self.license_form.populate_form(data)

    def submit_form(self,data={}):
        return self.license_form.submit_form(data)
开发者ID:codedsk,项目名称:hubcheck,代码行数:35,代码来源:po_tools_status_approve_confirm_license_page.py

示例2: AdminDatabaseTableManageBatchUpdate1

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class AdminDatabaseTableManageBatchUpdate1(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(AdminDatabaseTableManageBatchUpdate1,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.download = Link(self,{'base':'download'})
        self.browse = Text(self,{'base':'browse'},click_focus=False)
        self.upload = Button(self,{'base':'upload'})

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


    def download_data(self):
        self.download.click()


    def upload_data(self,filename):
        self.browse.value = filename
        self.upload.click()
        self.upload.wait_until_invisible()
开发者ID:codedsk,项目名称:hubcheck,代码行数:33,代码来源:admin_database_table_manage_batch_update.py

示例3: AdminDatabaseTableListPage

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class AdminDatabaseTableListPage(AdminBasePage):
    """admin database table list page object"""

    def __init__(self,browser,catalog):
        super(AdminDatabaseTableListPage,self).__init__(browser,catalog)
        # this path needs a database associated with it
        # ex:
        # /administrator/index.php?option=com_databases&task=table_list&db=solarpv
        self.path = '/administrator/index.php?option=com_databases&task=table_list'

        # load hub's classes
        AdminDatabaseTableListPage_Locators = \
            self.load_class('AdminDatabaseTableListPage_Locators')
        AdminDatabaseTableList = self.load_class('AdminDatabaseTableList')

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

        # setup page object's components
        self.table_list = AdminDatabaseTableList(self,{'base':'tablelist'})
        self.back = Link(self,{'base':'back'})
        self.new_table = Link(self,{'base':'new_table'})


    def goto_back(self):

        self.back.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:29,代码来源:po_admin_database_table_list_page.py

示例4: TimeNewRecordForm

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class TimeNewRecordForm(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(TimeNewRecordForm,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.name            = TextReadOnly(self,{'base':'name'})
        self.hours           = Select(self,{'base':'hours'})
        self.minutes         = Select(self,{'base':'minutes'})
        self.date            = Text(self,{'base':'date'})
        self.hub             = Select(self,{'base':'hub'})
        self.task            = Select(self,{'base':'task'})
        self.description     = TextArea(self,{'base':'description'})
        self.submit          = Button(self,{'base':'submit'})
        self.cancel          = Link(self,{'base':'cancel'})

        self.fields = ['hours','minutes','date','hub','task','description']

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


    def submit_form(self,data):

        self.populate_form(data)
        self.submit.click()


    def cancel_form(self):

        self.cancel.click()


    def populate_form(self,data):

        # data is either a dictionary or string
        if isinstance(data,dict):
            for k,v in data.items():
                if v is None:
                    # no value to set
                    continue
                if not k in self.fields:
                    # bail, the key is not a field
                    raise ValueError("invalid form field: %s" % (k))
                # find the widget in the object's dictionary and set its value
                widget = getattr(self,k)
                widget.value = v
        else:
            self.problem.value = data

    def get_name(self):
        return re.sub('User: ','',self.name.value)
开发者ID:codedsk,项目名称:hubcheck,代码行数:62,代码来源:time_new_record_form.py

示例5: AdminLogin1

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class AdminLogin1(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(AdminLogin1,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.username  = Text(self,{'base':'username'})
        self.password  = Text(self,{'base':'password'})
        self.submit    = Link(self,{'base':'submit'})

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

    def login_as(self,username,password):
        self.username.value = username
        self.password.value = password
        self.submit.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:27,代码来源:admin_login.py

示例6: TagsViewResultsRow

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class TagsViewResultsRow(ItemListItem):
    def __init__(self, owner, locatordict={}, row_number=0):

        super(TagsViewResultsRow, self).__init__(owner, locatordict, row_number)

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

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

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

        # setup page object's components
        self.title = Link(self, {"base": "title"})
        self.text = TextReadOnly(self, {"base": "text"})
        self.href = TextReadOnly(self, {"base": "href"})

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

    def value(self):
        """return a dictionary with the title, text, and href properties of the tag"""

        return {"title": self.title.text(), "text": self.text.value, "href": self.href.value}

    def goto_resource(self):
        """click the resource link"""

        self.title.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:33,代码来源:tags_view_results_row.py

示例7: AdminDatabaseBackupPage

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class AdminDatabaseBackupPage(AdminBasePage):
    """admin database list page object"""

    def __init__(self,browser,catalog):
        super(AdminDatabaseBackupPage,self).__init__(browser,catalog)
        # this path needs a database associated with it
        # ex:
        # /administrator/index.php?option=com_databases&task=backup_list&db=solarpv
        self.path = '/administrator/index.php?option=com_databases'\
                    + '&task=backup_list'
#                    + '&db=%s' % (dbname)

        # load hub's classes
        AdminDatabaseBackupPage_Locators = \
            self.load_class('AdminDatabaseBackupPage_Locators')
        AdminDatabaseBackup = self.load_class('AdminDatabaseBackup')

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

        # setup page object's components
        self.back = Link(self,{'base':'back'})
        self.backup = AdminDatabaseBackup(self,{'base':'backup'})


    def goto_back(self):

        self.back.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:30,代码来源:po_admin_database_backup_page.py

示例8: goto_page_number

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
    def goto_page_number(self, pagenumber):
        """click on a specific page in the pagination list"""

        # perform input validation
        pagenumber = int(pagenumber)

        if pagenumber < 1:
            raise IndexError(
                "pagenumber out of range: expected value\
                >= 1, received %s"
                % (pagenumber)
            )

        available_pages = self.get_link_page_numbers()
        if len(available_pages) == 0:
            if pagenumber != 1:
                raise IndexError("no pages available, pagenumber must be == 1")

        max_page_number = max([int(i) for i in available_pages])

        if pagenumber > max_page_number:
            raise IndexError(
                "pagenumber out of range: expected value\
                <= %i, received %d"
                % (max_page_number, pagenumber)
            )

        # click the page number link
        loctxt = self.locators["page"] % int(pagenumber)
        self.locators["_pagelink"] = loctxt
        page = Link(self, {"base": "_pagelink"})
        page.detach_from_owner()
        page.click()
        del page
        del self.locators["_pagelink"]
开发者ID:codedsk,项目名称:hubcheck,代码行数:37,代码来源:listpagenav.py

示例9: ToolsStatusWhatsNextApproved

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class ToolsStatusWhatsNextApproved(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusWhatsNextApproved,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.tool_page = Link(self,{'base':'tool_page'})

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


    def goto_tool_page(self):

        self.tool_page.click()


    def get_tool_page_name(self):

        return self.tool_page.text


    def get_time_since_request(self):

        pass
开发者ID:codedsk,项目名称:hubcheck,代码行数:35,代码来源:tools_status_whats_next_approved.py

示例10: GroupsWikiEditForm3

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class GroupsWikiEditForm3(GroupsWikiNewForm3):
    """GroupsWikiEditForm

       TextArea widget for pagetext
       Upload3 file upload widget with embedded iframes
    """

    def __init__(self, owner, locatordict={}):
        super(GroupsWikiEditForm3,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.rename = Link(self,{'base':'rename'})

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


    def goto_rename(self):
        """click the rename link"""

        self.rename.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:32,代码来源:groups_wiki_edit_form.py

示例11: ToolsStatusWhatsNextPublished

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class ToolsStatusWhatsNextPublished(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusWhatsNextPublished, self).__init__(owner, locatordict)

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

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

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

        # setup page object's components
        self.tool_page = Link(self, {"base": "tool_page"})
        self.updated = Link(self, {"base": "updated"})

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

    def goto_tool_page(self):

        self.tool_page.click()

    def get_tool_page_name(self):

        return self.tool_page.text

    def flip_status_to_updated(self):

        self.updated.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:33,代码来源:tools_status_whats_next_published.py

示例12: TagsBrowseResultsRow1

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class TagsBrowseResultsRow1(ItemListItem):

    def __init__(self, owner, locatordict={}, row_number=0):

        super(TagsBrowseResultsRow1,self).__init__(owner,locatordict,row_number)

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

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

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

        # setup page object's components
        self.name     = Link(self,{'base':'name'})
        self.count    = TextReadOnly(self,{'base':'count'})

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


    def value(self):
        """return a dictionary with the name and count properties of the tag"""

        return({'name':self.name.text(), 'count':int(self.count.value)})


    def goto_tag(self):
        """click the tag"""

        self.name.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:35,代码来源:tags_browse_results_row.py

示例13: TimeNewTaskForm

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class TimeNewTaskForm(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(TimeNewTaskForm,self).__init__(owner,locatordict)

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

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

        # setup page object's components
        self.name            = Text(self,{'base':'name'})
        self.active          = Radio(self,{'Yes':'active_yes','No':'active_no'})
        self.hub             = Select(self,{'base':'hub'})
        self.start_date      = Text(self,{'base':'start_date'})
        self.end_date        = Text(self,{'base':'end_date'})
        self.priority        = Select(self,{'base':'priority'})
        self.assignee        = Select(self,{'base':'assignee'})
        self.liaison         = Select(self,{'base':'liaison'})
        self.description     = TextArea(self,{'base':'description'})
        self.submit          = Button(self,{'base':'submit'})
        self.cancel          = Link(self,{'base':'cancel'})

        self.fields = ['name','active','hub','start_date','end_date',
                       'priority','assignee','liaison','description']

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


    def submit_form(self,data):

        self.populate_form(data)
        self.submit.click()


    def cancel_form(self,data):

        self.cancel.click()


    def populate_form(self,data):

        # data is either a dictionary or string
        if isinstance(data,dict):
            for k,v in data.items():
                if v is None:
                    # no value to set
                    continue
                if not k in self.fields:
                    # bail, the key is not a field
                    raise ValueError("invalid form field: %s" % (k))
                # find the widget in the object's dictionary and set its value
                widget = getattr(self,k)
                widget.value = v
        else:
            self.problem.value = data
开发者ID:codedsk,项目名称:hubcheck,代码行数:59,代码来源:time_new_task_form.py

示例14: MembersProfileElement

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
class MembersProfileElement(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(MembersProfileElement,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.sectionkey     = TextReadOnly(self,{'base':'sectionkey'})
        self.sectionvalue   = TextReadOnly(self,{'base':'sectionvalue'})
        self.openlink       = Link(self,{'base':'open'})
        self.closelink      = Link(self,{'base':'close'})
        self.save           = Button(self,{'base':'save'},self._onClickSave)
        self.cancel         = Button(self,{'base':'cancel'},self._onClickCancel)

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


    def _checkLocators(self, widgets=None, cltype=''):

        self.open()
        super(MembersProfileElement,self)._checkLocators(widgets,cltype)


    def _onClickSave(self):

        self.save.wait_until_invisible()


    def _onClickCancel(self):

        self.cancel.wait_until_invisible()


    def open(self):
        """open the slide to reveal the widget"""

        self.openlink.click()

        # wait until the save and cancel buttons are displayed in the DOM
        self.wait_until_visible(locator=self.locators['save'])


    def close(self):
        """close the slide to hide the widget"""

        self.closelink.click()

        # wait until the save and cancel buttons are not displayed in the DOM
        self.wait_until_invisible(locator=self.locators['save'])
开发者ID:codedsk,项目名称:hubcheck,代码行数:59,代码来源:members_profile_element.py

示例15: select

# 需要导入模块: from hubcheck.pageobjects.basepageelement import Link [as 别名]
# 或者: from hubcheck.pageobjects.basepageelement.Link import click [as 别名]
    def select(self,option):

        if not option in self.locators.keys():
            raise ValueError("invalid button: %s" % (option))
        if option == 'base':
            raise ValueError("invalid button: %s" % (option))

        link = Link(self,self.locators[option])
        link.detach_from_owner()
        link.click()
开发者ID:codedsk,项目名称:hubcheck,代码行数:12,代码来源:sort_order_options.py


注:本文中的hubcheck.pageobjects.basepageelement.Link.click方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。