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 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()
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)
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()
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 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()
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"]
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
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()
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 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()
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'])
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()
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()
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()
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]
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()
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
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()
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()
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()
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()
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()
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()
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
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
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()