Example #1
0
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()
Example #2
0
    def __init__(self, owner, locatordict={}):
        super(Header2,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.login          = Link(self,{'base':'login'})
        self.register       = Link(self,{'base':'register'})
        self.logout         = Link(self,{'base':'logout'})
        self.details        = Link(self,{'base':'details'})
        self.dashboard      = Link(self,{'base':'dashboard'})
        self.messages       = Link(self,{'base':'messages'})
        self.profile        = Link(self,{'base':'profile'})

        # self.search    = Search(self,'search')

        self._links = ['details','dashboard','messages','profile','logout']

        # update the component's locators with this objects overrides
        self._updateLocators()
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
    def __init__(self, owner, locatordict={},row_number=0):

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

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

        # update this object's locator
        self.locators.update(AdminDatabaseTableListItem_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.created    = TextReadOnly(self,{'base':'created'})
        self.updated    = TextReadOnly(self,{'base':'updated'})
        self.records    = TextReadOnly(self,{'base':'records'})
        self.schema     = Link(self,{'base':'schema'})
        self.view_data  = Link(self,{'base':'view_data'})
        self.manage_data = Link(self,{'base':'manage_data'})

        # update the component's locators with this objects overrides
        self._updateLocators()
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()
Example #6
0
    def __init__(self, owner, locatordict={}):
        super(ToolSessionApp,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.title      = Text(self,{'base':'title'})
        self.terminate  = Link(self,{'base':'terminate'})
        self.keep       = Link(self,{'base':'keep'})
        self.storage    = ToolSessionAppStorage(self,{'base':'storage'})
        self.popout     = Link(self,{'base':'popout'})
        self.refresh    = Link(self,{'base':'refresh'})
        self.resize     = Link(self,{'base':'resize'})
        self.size       = TextReadOnly(self,{'base':'size'})

        # update the component's locators with this objects overrides
        self._updateLocators()
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusApproveToolInfoForm,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.tool_info          = Link(self,{'base':'tool_info'})
        self.title              = TextReadOnly(self,{'base':'title'})
        self.version            = TextReadOnly(self,{'base':'version'})
        self.version_edit       = Link(self,{'base':'version_edit'})
        self.description        = TextReadOnly(self,{'base':'description'})
        self.tool_access        = TextReadOnly(self,{'base':'tool_access'})
        self.code_access        = TextReadOnly(self,{'base':'code_access'})
        self.project_access     = TextReadOnly(self,{'base':'project_access'})
        self.screen_size        = TextReadOnly(self,{'base':'screen_size'})
        self.developers         = TextReadOnly(self,{'base':'developers'})
        self.authors            = TextReadOnly(self,{'base':'authors'})
        self.resource_preview   = Link(self,{'base':'resource_preview'})
        self.license_edit       = Link(self,{'base':'license_edit'})
        self.license            = TextReadOnly(self,{'base':'license'})
        self.approve            = Button(self,{'base':'approve'})


        # update the component's locators with this objects overrides
        self._updateLocators()
Example #8
0
    def __init__(self, owner, locatordict={}):
        super(Login2,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.change_account = Link(self,{'base':'change_account'})
        self.hub_signin = Link(self,{'base':'hub_signin'})
        self.username  = Text(self,{'base':'username'})
        self.password  = Text(self,{'base':'password'})
        self.remember  = Checkbox(self,{'base':'remember'})
        self.remind    = Link(self,{'base':'remind'})
        self.reset     = Link(self,{'base':'reset'})
        self.register  = Link(self,{'base':'register'})

        self.fields += ['username','password','remember']

        # update the component's locators with this objects overrides
        self._updateLocators()
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()
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()
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)
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()
Example #13
0
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()
    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()
Example #15
0
    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"]
Example #16
0
    def __init__(self, owner, locatordict={}):
        super(Courses,self).__init__(owner,locatordict)

        # load hub's classes
        object_locators = self.load_class('Courses_Locators')
        PopularList = self.load_class('PopularList')
        PopularItem = self.load_class('PopularItem')
        TextSearchBox = self.load_class('TextSearchBox')

        # update this object's locator defaults
        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.faq              = Link(self,{'base':'faq'})
        self.guidelines       = Link(self,{'base':'guidelines'})
        self.create           = Link(self,{'base':'create'})
        self.browse           = Link(self,{'base':'browse'})
        self.course_search    = TextSearchBox(self,
                                    {'base'   : 'searchcourses',
                                     'text'   : 'searchi',
                                     'submit' : 'searchb'})
        self.popular_courses  = PopularList(self,
                                    {'base' : 'popularitem',
                                     'item' : 'popularitem'},
                                    PopularItem,
                                    {'title'        : 'pi_title',
                                     'description'  : 'pi_description',
                                     'logo'         : 'pi_logo'})

        # update the component's locators with this objects overrides
        self._updateLocators()
Example #17
0
    def __init__(self, owner, locatordict={}):
        super(Tags,self).__init__(owner,locatordict)

        # load hub's classes
        Tags_Locators = self.load_class('Tags_Locators')
        TagSearchBox = self.load_class('TagSearchBox')
        TextSearchBox = self.load_class('TextSearchBox')
        TagsList = self.load_class('TagsList')

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

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

        # setup page object's components
        self.faq              = Link(self,{'base':'faq'})
        self.alltags          = Link(self,{'base':'alltags'})
        self.searchcontentbox = TagSearchBox(self,
                                    {'base'   : 'searchcontentbox',
                                     'submit' : 'searchcontentsubmit'})
        self.searchtagsbox    = TextSearchBox(self,
                                    {'base'   : 'searchtagsbox',
                                     'text'   : 'searchtagstext',
                                     'submit' : 'searchtagssubmit'})

        self.recenttags       = TagsList(self,{'base':'recenttags',
                                               'taglink':'recenttags_link'})
        self.top100tags       = TagsList(self,{'base':'top100tags',
                                               'taglink':'top100tags_link'})

        # update the component's locators with this objects overrides
        self._updateLocators()
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusToolInfo,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.edit               = Link(self,{'base':'edit'})
        self.title              = TextReadOnly(self,{'base':'title'})
        self.version            = TextReadOnly(self,{'base':'version'})
        self.glance             = TextReadOnly(self,{'base':'glance'})
        self.toolpage_preview   = Link(self,{'base':'toolpage_preview'})
        self.toolpage_edit      = Link(self,{'base':'toolpage_edit'})
        self.vncgeometry        = TextReadOnly(self,{'base':'vncgeometry'})
        self.toolaccess         = TextReadOnly(self,{'base':'toolaccess'})
        self.codeaccess         = TextReadOnly(self,{'base':'codeaccess'})
        # self.codeaccesslink     = Link(self,{'base':'codeaccesslink'})
        self.wikiaccess         = TextReadOnly(self,{'base':'wikiaccess'})
        self.devteam            = TextReadOnly(self,{'base':'devteam'})

        # update the component's locators with this objects overrides
        self._updateLocators()
Example #19
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)
Example #20
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()
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()
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()
    def __init__(self,browser,catalog):
        super(AdminDatabaseTableManagePage,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
        AdminDatabaseTableManagePage_Locators = \
            self.load_class('AdminDatabaseTableManagePage_Locators')
        AdminDatabaseList = self.load_class('AdminDatabaseTableList')
#        AdminDatabaseTableManageTableData = \
#            self.load_class('AdminDatabaseTableManageTableData')
#        AdminDatabaseTableManageAddRecord = \
#            self.load_class('AdminDatabaseTableManageAddRecord')
        AdminDatabaseTableManageBatchUpdate = \
            self.load_class('AdminDatabaseTableManageBatchUpdate')
#        AdminDatabaseTableManageRemoveTable = \
#            self.load_class('AdminDatabaseTableManageRemoveTable')

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

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

        self.message = TextReadOnly(self,{'base':'message'})
        self.menu_table_data = Link(self,{'base':'menu_table_data'})
        self.menu_add_record = Link(self,{'base':'menu_add_record'})
        self.menu_batch_update = Link(self,{'base':'menu_batch_update'})
        self.menu_remove_table = Link(self,{'base':'menu_remove_table'})

#        self.table_data = AdminDatabaseTableManageTableData(self,{'base':'table_data'})
#        self.add_record = AdminDatabaseTableManageAddRecord(self,{'base':'ble_data'})
        self.batch_update = AdminDatabaseTableManageBatchUpdate(self,{'base':'batch_update'})
Example #24
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
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'])
Example #26
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()
Example #27
0
    def __init__(self, owner, locatordict={}):
        super(MembersPageMenu,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.dashboardlink      = Link(self,{'base':'dashboard'})
        self.profilelink        = Link(self,{'base':'profile'})
        self.contributionslink  = Link(self,{'base':'contributions'})
        self.groupslink         = Link(self,{'base':'groups'})
        self.favoriteslink      = Link(self,{'base':'favorites'})
        self.messageslink       = Link(self,{'base':'messages'})
        self.resumelink         = Link(self,{'base':'resume'})
        self.bloglink           = Link(self,{'base':'blog'})
        self.projectslink       = Link(self,{'base':'projects'})

        # update the component's locators with this objects overrides
        self._updateLocators()
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()
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()
    def __init__(self, owner, locatordict={}):
        super(ToolsStatusRemainingSteps,self).__init__(owner,locatordict)

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

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

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

        # setup page object's components
        self.register           = TextReadOnly(self,{'base':'register'})
        self.upload             = TextReadOnly(self,{'base':'upload'})
        self.upload_done        = Link(self,{'base':'upload_done'})
        self.upload_howto       = Link(self,{'base':'upload_howto'})
        self.toolpage           = TextReadOnly(self,{'base':'toolpage'})
        self.toolpage_create    = Link(self,{'base':'toolpage_create'})
        self.toolpage_preview   = Link(self,{'base':'toolpage_preview'})
        self.toolpage_edit      = Link(self,{'base':'toolpage_edit'})
        self.test_approve       = TextReadOnly(self,{'base':'test_approve'})
        self.approve_it         = Link(self,{'base':'approve_it'})
        self.updated_approve    = Link(self,{'base':'updated_approve'})
        self.publish            = TextReadOnly(self,{'base':'publish'})
        self.updated_publish    = Link(self,{'base':'updated_publish'})

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