コード例 #1
0
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)
コード例 #2
0
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()
コード例 #3
0
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()
コード例 #4
0
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)
コード例 #5
0
ファイル: admin_login.py プロジェクト: codedsk/hubcheck
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()
コード例 #6
0
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()
コード例 #7
0
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()
コード例 #8
0
ファイル: listpagenav.py プロジェクト: codedsk/hubcheck
    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"]
コード例 #9
0
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
コード例 #10
0
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()
コード例 #11
0
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()
コード例 #12
0
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()
コード例 #13
0
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
コード例 #14
0
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'])
コード例 #15
0
    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()
コード例 #16
0
class ToolsStatusWhatsNextCreated(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusWhatsNextCreated,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.forge              = Link(self,{'base':'forge'})
        self.wiki               = Link(self,{'base':'wiki'})
        self.getting_started    = Link(self,{'base':'getting_started'})
        self.uploaded           = Link(self,{'base':'uploaded'})

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


    def goto_forge(self):

        self.forge.click()


    def get_forge_name(self):

        return self.forge.text


    def goto_wiki(self):

        return self.wiki.click()


    def get_wiki_name(self):

        return self.wiki.text


    def goto_getting_started(self):

        return self.getting_started.click()


    def flip_status_to_uploaded(self):

        return self.uploaded.click()
コード例 #17
0
class ToolsStatusVersionListRow(ItemListItem):
    def __init__(self, owner, locatordict={},row_number=0):

        super(ToolsStatusVersionListRow,self)\
            .__init__(owner,locatordict,row_number)

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

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

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

        # setup page object's components
        self.version      = TextReadOnly(self,{'base':'version'})
        self.released     = TextReadOnly(self,{'base':'released'})
        self.subversion   = TextReadOnly(self,{'base':'subversion'})
        self.published    = TextReadOnly(self,{'base':'published'})
        self.edit         = Link(self,{'base':'edit'})

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


    def value(self):
        """return a dictionary of properties for this row"""

        published_classes = self.published.get_attribute('class')

        published = None
        if 'toolunpublished' in published_classes:
            published = False
        elif 'toolpublished' in published_classes:
            published = True

        properties = {
            'version'    : self.version.value,
            'released'   : self.released.value,
            'subversion' : self.subversion.value,
            'published'  : published,
        }

        return properties


    def goto_edit(self):

        self.edit.click()
コード例 #18
0
ファイル: support.py プロジェクト: codedsk/hubcheck
class Support2(Support):
    def __init__(self, owner, locatordict=None):
        super(Support2,self).__init__(owner,locatordict)

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

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


    def goto_quicklink_faq(self):
        """click the faq link"""

        self.quicklink_faq.click()
コード例 #19
0
    def goto_category_by_title(self,category):
        """click on category title"""

        c = self._is_category_displayed(category)

        if not c:
           raise ValueError("cannot find category: %s" % (category))

        key = "goto_category_%s" % c
        value = self.locators['cattitlelink'] % c
        self.locators[key] = value
        l = Link(self,key)
        l.detach_from_owner()
        l.click()
        del self.locators[key]
コード例 #20
0
ファイル: groups_title.py プロジェクト: codedsk/hubcheck
class GroupsTitle2(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(GroupsTitle2,self).__init__(owner,locatordict)

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

        # update this object's locator
        self.locators.update(GroupsTitle_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'})

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

    def get_title(self):
        """return the title of the group"""

        return self.title.text()

    def goto_title(self):
        """click the group title link"""

        return self.title.click()
コード例 #21
0
ファイル: storage_meter.py プロジェクト: codedsk/hubcheck
class StorageMeter(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(StorageMeter,self).__init__(owner,locatordict)

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

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

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

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

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


    def goto_manage(self):
        """navigate to the storage management page"""

        return self.manage.click()


    def storage_meter(self):
        """return the used percentage and total amount of storage in GB"""

        return self.meter.value
コード例 #22
0
class ToolsCreatePage(GenericPage):
    """page to create a new tool resource"""

    def __init__(self,browser,catalog):
        super(ToolsCreatePage,self).__init__(browser,catalog)
        self.path = "/tools/create"

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

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

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

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

    def submit_form(self,data={}):
        return self.form.submit_form(data)

    def goto_all_tools(self):
        return self.alltools.click()
コード例 #23
0
class TicketListSearchResultRow(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(TicketListSearchResultRow, self).__init__(owner, locatordict)

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

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

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

        # setup page object's components
        self.ticketnumber = TextReadOnly(self, {"base": "ticketnumber"})
        self.summary = Link(self, {"base": "summary"})
        self.status = TextReadOnly(self, {"base": "status"})
        self.group = TextReadOnly(self, {"base": "group"})
        self.tags = TagsList(self, {"base": "tags"})
        self.assignee = TextReadOnly(self, {"base": "assignee"})
        # self.age          = TextReadOnly(self,{'base':'age'})
        # self.comments     = TextReadOnly(self,{'base':'comments'})
        self.delete = Link(self, {"base": "delete"})

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

    def _checkLocatorsAdmin(self, widgets=None, cltype="Admin"):

        widgets = [self.ticketnumber, self.summary, self.status, self.group, self.assignee, self.delete]
        # self.assignee,self.age,self.comments,self.delete]
        self._checkLocators(widgets, cltype)

    def _checkLocatorsNonAdmin(self, widgets=None, cltype="NonAdmin"):

        widgets = [self.ticketnumber, self.summary, self.status, self.group, self.assignee]
        # self.assignee,self.age,self.comments]
        self._checkLocators(widgets, cltype)

    def open_ticket(self):

        self.summary.click()

    def delete_ticket(self):

        self.delete.click()
コード例 #24
0
ファイル: popular_item.py プロジェクト: codedsk/hubcheck
class PopularItem(BasePageWidget):

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

        # initialize variables
        self.__item_number = item_number

        super(PopularItem,self).__init__(owner,locatordict)

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

        # update this object's locator
        self.locators.update(object_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.description = TextReadOnly(self,{'base':'description'})

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

    def _updateLocators(self):

        super(PopularItem,self)._updateLocators()
        for k,v in self.locators.items():
            self.locators[k] = v % self.__item_number
        self.update_locators_in_widgets()


    def value(self):
        """return a dictionary with the properties of the group"""

        return({'title':self.title.text(),'description':self.description.value})


    def goto_group(self):
        """click the group title"""

        self.title.click()
コード例 #25
0
ファイル: admin_header.py プロジェクト: codedsk/hubcheck
class AdminHeader1(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(AdminHeader1,self).__init__(owner,locatordict)

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

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

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

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

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


    def goto_logout(self):
        self.logout.click()
        self.logout.wait_until_invisible()
コード例 #26
0
ファイル: wishlist_vote.py プロジェクト: codedsk/hubcheck
class WishlistVote(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(WishlistVote,self).__init__(owner,locatordict)

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

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

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

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

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


    def click(self):

        self.vote.click()
コード例 #27
0
class ToolsPipelineSortOptions(BasePageWidget):
    def __init__(self, owner, locatordict={}):
        super(ToolsPipelineSortOptions,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.status_change  = Link(self,{'base':'status_change'})
        self.priority       = Link(self,{'base':'priority'})
        self.name           = Link(self,{'base':'name'})
        self.date           = Link(self,{'base':'date'})
        self.status         = Link(self,{'base':'status'})

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


    def order_by_status_change(self):

        self.status_change.click()


    def order_by_priority(self):

        self.order_by_priority.click()


    def order_by_name(self):

        self.name.click()


    def order_by_date(self):

        self.date.click()


    def order_by_status(self):

        self.status.click()
コード例 #28
0
ファイル: header.py プロジェクト: codedsk/hubcheck
class Header3(Header):
    """
    represents header on hubs where the username and my account links
    lead to the my account/dashboard page, and there is no profile link.
    generally found in older templates. here we use the username link
    to get the account number
    """

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

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

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


    def _checkLocatorsLoggedIn(self):

        widgets = [self.logout,self.myaccount,self.username]
        self._checkLocators(widgets=widgets,cltype='LoggedIn')


    def goto_username(self):
        """click the username link to go to the member's account page"""

        return self.username.click()


    def get_account_number(self):
        """return the user's account number based on the "Username" link"""

        url = self.username.get_attribute('href')
        if not url:
            raise RuntimeError("link '%s' has no href" % (self.username.locator))

        path = urlparse.urlsplit(url)[2]
        if not path:
            raise RuntimeError("url '%s' has no path" % (url))

        matches = re.search("/members/(\d+)",path)
        if matches is None:
            raise RuntimeError("path '%s' does not contain an account number" % (path))

        account_number = matches.group(1)

        return account_number
コード例 #29
0
ファイル: po_tags_view_page.py プロジェクト: codedsk/hubcheck
class TagsViewPage(GenericPage):
    """tags view"""

    def __init__(self,browser,catalog):
        super(TagsViewPage,self).__init__(browser,catalog)
        self.path = "/tags/browse"

        TagsViewPage_Locators = self.load_class('TagsViewPage_Locators')
        TagsViewForm = self.load_class('TagsViewForm')

        self.locators.update(TagsViewPage_Locators.locators)

        self.form     = TagsViewForm(self,{'base':'form'})
        self.moretags = Link(self,{'base':'moretags'})

    def search_for(self,terms):
        return self.form.search_for(terms)

    def goto_page_number(self,pagenumber):
        return self.form.goto_page_number(pagenumber)

    def goto_page_relative(self,relation):
        return self.form.goto_page_relative(relation)

    def get_caption_counts(self):
        return self.form.get_caption_counts()

    def get_pagination_counts(self):
        return self.form.get_pagination_counts()

    def goto_more_tags(self):
        return self.moretags.click()

    def get_current_page_number(self):
        return self.form.get_current_page_number()

    def get_link_page_numbers(self):
        return self.form.get_link_page_numbers()

    def rows(reset=False):
        return self.form.rows
コード例 #30
0
ファイル: header.py プロジェクト: codedsk/hubcheck
class Header1(Header):
    def __init__(self, owner, locatordict={}):
        super(Header1,self).__init__(owner,locatordict)

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

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


    def _checkLocatorsLoggedIn(self):

        widgets = [self.logout,self.myaccount,self.profile]
        self._checkLocators(widgets=widgets,cltype='LoggedIn')


    def goto_profile(self):
        """click the link to go to the member's profile page"""

        return self.profile.click()