class TicketListFilterOptions2(BasePageWidget): def __init__(self, owner, locatordict={}): super(TicketListFilterOptions2,self).__init__(owner,locatordict) # load hub's classes TicketListFilterOptions_Locators = self.load_class('TicketListFilterOptions_Locators') # update this object's locator self.locators.update(TicketListFilterOptions_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.find = Text(self,{'base':'find'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def _checkLocatorsAdmin(self, widgets=None, cltype='Admin'): self._checkLocators(widgets,cltype) def filter_by_keyword(self,value): self.find.value = value self.submit.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 HubUCourseLogin(BasePageWidget): def __init__(self, owner, locatordict={}): super(HubUCourseLogin,self).__init__(owner,locatordict) # load hub's classes HubUCourseLogin_Locators = self.load_class('HubUCourseLogin_Locators') # update this object's locator self.locators.update(HubUCourseLogin_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.remember = Checkbox(self,{'base':'remember'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def login_as(self,username,password,remember=False): """login to the website as the specified user""" self.username.value = username self.password.value = password self.remember.value = remember self.submit.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 TagSearchBox(BasePageWidget): def __init__(self, owner, locatordict={}): super(TagSearchBox,self).__init__(owner,locatordict) # load hub's classes TagSearchBox_Locators = self.load_class('TagSearchBox_Locators') # update this object's locator self.locators.update(TagSearchBox_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.tags = TextAC(self,{'base':'tags', 'aclocatorid':'tagsac', 'choicelocatorid':'tagsacchoices', 'tokenlocatorid':'tagsactoken', 'deletelocatorid':'tagsacdelete'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def search_for(self,terms): """perform a search for resources tagged with terms""" self.tags.remove_all() for t in terms: self.tags.send_keys(t+'\n',timeout=-1) self.submit.click()
class TextSearchBox(BasePageWidget): def __init__(self, owner, locatordict={}): super(TextSearchBox,self).__init__(owner,locatordict) # load hub's classes TextSearchBox_Locators = self.load_class('TextSearchBox_Locators') # update this object's locator self.locators.update(TextSearchBox_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.text = Text(self,{'base':'text'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def search_for(self,keyword): """search for a resource by keyword""" self.text.value = keyword self.submit.click()
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'])
class AdminDatabaseBackup1(BasePageWidget): def __init__(self, owner, locatordict={}): super(AdminDatabaseBackup1, self).__init__(owner, locatordict) # load hub's classes AdminDatabaseBackup_Locators = self.load_class("AdminDatabaseBackup_Locators") # ItemList = self.load_class('ItemList') # update this object's locator defaults self.locators.update(AdminDatabaseBackup_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.backup = Button(self, {"base": "backup"}) self.backup_log = TextArea(self, {"base": "backup_log"}) # self.download_list = ItemList(self, # { # 'base' : 'listbase', # 'row' : 'item', # }, Link, # {'base':'download_link'}) # update the component's locators with this objects overrides self._updateLocators() def do_backup(self): """perform a database backup""" oldlog = self.backup_log.value self.backup.click() # wait for the alert to show up self.logger.debug("waiting for database backup confirmation") WebDriverWait(self._browser, 10).until( EC.alert_is_present(), "while waiting for the database backup confirmation" ) self.logger.debug("found confirmation") alert = self._browser.switch_to_alert() alert.accept() self.logger.debug("accepted confirmation") self._browser.switch_to_default_content() def has_new_log_info(driver): driver.refresh() newlog = self.backup_log.value logdiff = newlog[0 : -len(oldlog)] if len(logdiff) > 0: return logdiff else: return False logdiff = WebDriverWait(self._browser, 10).until(has_new_log_info, "while waiting for new backup log info") # return the new log text return logdiff
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 HubUCourseManageEmailForm(BasePageWidget): """hub u course manager email""" def __init__(self,owner,locatordict={}): super(HubUCourseManageEmailForm,self).__init__(owner,locatordict) # load hub's classes HubUCourseManageEmailForm_Locators = self.load_class('HubUCourseManageEmailForm_Locators') # update this object's locator self.locators.update(HubUCourseManageEmailForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.discard = Link(self,{'base':'discard'}) self.toaddr = TextAC(self,{'base':'to', 'aclocatorid':'toac', 'choicelocatorid':'toacchoices', 'tokenlocatorid':'toactoken', 'deletelocatorid':'toacdelete'}) self.fromaddr = TextReadOnly(self,{'base':'from'}) self.replyto = TextReadOnly(self,{'base':'replyto'}) self.template = Select(self,{'base':'template'}) self.subject = TextReadOnly(self,{'base':'subject'}) self.body = TextReadOnly(self,{'base':'body'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def _checkLocators(self,widgets=None,cltype=''): # to see all of the widgets, you need to choose a template first options = self.template.options() self.template.choose(options[0]) super(HubUCourseManageEmailForm,self)._checkLocators(widgets,cltype) def send_email(self,tolist,templateName): """send an email to the addresses in tolist using the template templateName""" if tolist != None: self.toaddr.value = tolist if templateName != None: self.template.value = templateName self.submit.click()
def __init__(self, owner, locatordict={}, refreshCaptchaCB=None): super(WishlistNewWishForm,self).__init__(owner,locatordict) # load hub's classes WishlistNewWishForm_Locators = self.load_class('WishlistNewWishForm_Locators') # update this object's locator self.locators.update(WishlistNewWishForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.anonymous = Checkbox(self,{'base':'anonymous'}) self.private = Checkbox(self,{'base':'private'}) self.subject = Text(self,{'base':'subject'}) self.problem = TextArea(self,{'base':'problem'}) self.tags = TextAC(self,{'base':'tags', 'aclocatorid':'tagsac', 'choicelocatorid':'tagsacchoices', 'tokenlocatorid':'tagsactoken', 'deletelocatorid':'tagsacdelete'}) self.submit = Button(self,{'base':'submit'}) self.fields = ['anonymous','private','subject','problem','tags'] # update the component's locators with this objects overrides self._updateLocators()
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 __init__(self, owner, locatordict={}): super(AdminDatabaseBackup1, self).__init__(owner, locatordict) # load hub's classes AdminDatabaseBackup_Locators = self.load_class("AdminDatabaseBackup_Locators") # ItemList = self.load_class('ItemList') # update this object's locator defaults self.locators.update(AdminDatabaseBackup_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.backup = Button(self, {"base": "backup"}) self.backup_log = TextArea(self, {"base": "backup_log"}) # self.download_list = ItemList(self, # { # 'base' : 'listbase', # 'row' : 'item', # }, Link, # {'base':'download_link'}) # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}): super(ToolSessionShare, self).__init__(owner, locatordict) # load hub's classes ToolSessionShare_Locators = self.load_class("ToolSessionShare_Locators") ToolSessionSharedWithItem = self.load_class("ToolSessionSharedWithItem") ItemList = self.load_class("ItemList") # update this object's locator self.locators.update(ToolSessionShare_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.name = TextAC( self, { "base": "name", "aclocatorid": "nameac", "choicelocatorid": "nameacchoices", "tokenlocatorid": "nameactoken", "deletelocatorid": "nameacdelete", }, ) self.group = Select(self, {"base": "group"}) self.read_only = Checkbox(self, {"base": "readonly"}) self.share = Button(self, {"base": "share"}) self.share_list = ItemList(self, {"base": "listbase", "row": "item"}, ToolSessionSharedWithItem, {}) # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}): super(HubUCourseMembershipListing,self).__init__(owner,locatordict) # load hub's classes HubUCourseMembershipListing_Locators = self.load_class('HubUCourseMembershipListing_Locators') HubUCourseMembershipListingMemberRow = self.load_class('HubUCourseMembershipListingMemberRow') HubUCourseMembershipListingDetailRow = self.load_class('HubUCourseMembershipListingDetailRow') # update this object's locator self.locators.update(HubUCourseMembershipListing_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.member_row = HubUCourseMembershipListingMemberRow(self,{'base':'enrollee_row'}) self.detail_row = HubUCourseMembershipListingDetailRow(self,{'base':'detail_row'}) self.action = Select(self,{'base':'action'}) self.action_submit = Button(self,{'base':'action_submit'}) self.get_enroll = Link(self,{'base':'get_enroll'},self._onClick) self.export_enroll = Link(self,{'base':'export_enroll'}) self.members = TextReadOnly(self,{'base':'members'}) self.total = TextReadOnly(self,{'base':'total'}) self.member_data = {} # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}, refreshCaptchaCB=None): super(TroubleReportForm,self).__init__(owner,locatordict) # load hub's classes TroubleReportForm_Locators = self.load_class('TroubleReportForm_Locators') Captcha2 = self.load_class('Captcha2') # update this object's locator self.locators.update(TroubleReportForm_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.name = Text(self,{'base':'name'}) self.email = Text(self,{'base':'email'}) self.problem = TextArea(self,{'base':'problem'}) self.upload = Upload(self,{'base':'upload','browselocatorid':'upload'}) self.submit = Button(self,{'base':'submit'},self._onClick) self.ticketlink = Link(self,{'base':'ticket_link'}) self.captcha = Captcha2(self,{'base':'captcha'},refreshCaptchaCB) self.fields = ['username','name','email','problem','upload','captcha'] # update the component's locators with this objects overrides self._updateLocators()
def __init__(self,owner,locatordict={}): super(HubUCourseManageEmailForm,self).__init__(owner,locatordict) # load hub's classes HubUCourseManageEmailForm_Locators = self.load_class('HubUCourseManageEmailForm_Locators') # update this object's locator self.locators.update(HubUCourseManageEmailForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.discard = Link(self,{'base':'discard'}) self.toaddr = TextAC(self,{'base':'to', 'aclocatorid':'toac', 'choicelocatorid':'toacchoices', 'tokenlocatorid':'toactoken', 'deletelocatorid':'toacdelete'}) self.fromaddr = TextReadOnly(self,{'base':'from'}) self.replyto = TextReadOnly(self,{'base':'replyto'}) self.template = Select(self,{'base':'template'}) self.subject = TextReadOnly(self,{'base':'subject'}) self.body = TextReadOnly(self,{'base':'body'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators()
class PreviewFormBase(FormBase): def __init__(self, owner, locatordict={}): super(PreviewFormBase,self).__init__(owner,locatordict) # load hub's classes PreviewFormBase_Locators = self.load_class('PreviewFormBase_Locators') # update this object's locator self.locators.update(PreviewFormBase_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.preview = Button(self,{'base':'preview'}) self.submit = Button(self,{'base':'submit'}) self.fields = [] # update the component's locators with this objects overrides self._updateLocators() def preview_page(self): """preview the page before submitting""" return self.preview.click()
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 __init__(self, owner, locatordict={}): super(TimeNewHubForm,self).__init__(owner,locatordict) # load hub's classes TimeNewHubForm_Locators = self.load_class('TimeNewHubForm_Locators') WikiTextArea = self.load_class('WikiTextArea') # update this object's locator self.locators.update(TimeNewHubForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.hubname = Text(self,{'base':'hubname'}) self.contact_name = Text(self,{'base':'contact_name'}) self.contact_phone = Text(self,{'base':'contact_phone'}) self.contact_email = Text(self,{'base':'contact_email'}) self.contact_role = Text(self,{'base':'contact_role'}) self.liaison = Text(self,{'base':'liaison'}) self.anniversary = Text(self,{'base':'anniversary'}) self.support = Select(self,{'base':'support'}) self.notes = WikiTextArea(self,{'base':'notes'}) self.submit = Button(self,{'base':'submit'}) self.cancel = Link(self,{'base':'cancel'}) self.fields = ['hubname','contact_name','contact_phone', 'contact_email','contact_role','liaison', 'anniversary','support','notes'] # 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()
def __init__(self, owner, locatordict={}): super(ResourcesNewAuthorsForm,self).__init__(owner,locatordict) # load hub's classes ResourcesNewAuthorsForm_Locators = self.load_class('ResourcesNewAuthorsForm_Locators') ResourcesNewAuthorsAuthorsForm = self.load_class('ResourcesNewAuthorsAuthorsForm') ResourcesNewAuthorsAuthorsList = self.load_class('ResourcesNewAuthorsAuthorsList') # update this object's locator self.locators.update(ResourcesNewAuthorsForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.group = Select(self,{'base':'group'}) self.access = Select(self,{'base':'access'}) self.authorform = IframeWrap( ResourcesNewAuthorsAuthorsForm( self,{'base':'authorsform'}), ['authorsframe']) self.authorlist = IframeWrap( ResourcesNewAuthorsAuthorsList( self,{'base':'authorslist'}), ['authorsframe']) self.submit = Button(self,{'base':'submit'}) self.fields = ['group','access'] # update the component's locators with this objects overrides self._updateLocators()
class FilexferImportfilePage(BasePageObject): """ Filexfer upload page """ def __init__(self, owner, locatordict={}): super(FilexferImportfilePage,self).__init__(owner,locatordict) # load hub's classes FilexferImportfilePage_Locators = \ self.load_class('FilexferImportfilePage_Locators') # update this object's locator self.locators = FilexferImportfilePage_Locators.locators # setup page object's components self.upload_type = Radio(self,{'File' : 'upload_type_file', 'Text' : 'upload_type_text'}) self.browse = Text(self,{'base':'browse'},click_focus=False) self.filetext = TextArea(self,{'base':'filetext'}) self.upload = Button(self,{'base':'upload'}) def upload_file(self,filename,timeout=60): """choose a file to upload into the workspace""" self.upload_type.value = 'File' self.browse.value = filename self.upload.click() WebDriverWait(self._browser,timeout)\ .until(EC.title_is('Upload Complete')) def upload_text(self,text,timeout=60): """upload text to a file in the workspace""" self.upload_type.value = 'Text' self.filetext.value = text self.upload.click() WebDriverWait(self._browser,timeout)\ .until(EC.title_is('Upload Complete'))
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()
class ResourcesNewAttachForm(BasePageWidget): def __init__(self, owner, locatordict=None): super(ResourcesNewAttachForm,self).__init__(owner,locatordict) # load hub's classes ResourcesNewAttachForm_Locators = self.load_class('ResourcesNewAttachForm_Locators') UploadList1 = self.load_class('UploadList1') # update this object's locator self.locators.update(ResourcesNewAttachForm_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.upload = IframeWrap( Upload(self,{'browselocatorid':'browse', 'uploadlocatorid':'upload',}), ['uploadframe']) self.uploadlist = UploadList1(self,{'base':'iframe'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators() def upload_files(self,flist): """upload the files in the list flist""" for fname in flist: self.upload.value = fname def get_uploaded_files(self): """return the list of uploaded files""" return self.uploadlist.get_uploaded_files() def delete_file(self,filename): """delete an uploaded file""" return self.uploadlist.delete_file(filename) def submit_form(self,flist): """upload and attach the list of files in flist""" self.upload_files(flist) return self.submit.click()
def __init__(self, owner, locatordict={}): super(FilexferImportfilePage,self).__init__(owner,locatordict) # load hub's classes FilexferImportfilePage_Locators = \ self.load_class('FilexferImportfilePage_Locators') # update this object's locator self.locators = FilexferImportfilePage_Locators.locators # setup page object's components self.upload_type = Radio(self,{'File' : 'upload_type_file', 'Text' : 'upload_type_text'}) self.browse = Text(self,{'base':'browse'},click_focus=False) self.filetext = TextArea(self,{'base':'filetext'}) self.upload = Button(self,{'base':'upload'})
def __init__(self, owner, locatordict={}): super(TextSearchBox,self).__init__(owner,locatordict) # load hub's classes TextSearchBox_Locators = self.load_class('TextSearchBox_Locators') # update this object's locator self.locators.update(TextSearchBox_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.text = Text(self,{'base':'text'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}): super(TicketListFilterOptions2,self).__init__(owner,locatordict) # load hub's classes TicketListFilterOptions_Locators = self.load_class('TicketListFilterOptions_Locators') # update this object's locator self.locators.update(TicketListFilterOptions_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.find = Text(self,{'base':'find'}) self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}): super(ResourcesNewAuthorsAuthorsList,self).__init__(owner,locatordict) # load hub's classes ResourcesNewAuthorsAuthorsList_Locators = \ self.load_class('ResourcesNewAuthorsAuthorsList_Locators') # update this object's locator self.locators.update(ResourcesNewAuthorsAuthorsList_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.submit = Button(self,{'base':'submit'}) # update the component's locators with this objects overrides self._updateLocators()
def __init__(self, owner, locatordict={}): super(FormBase,self).__init__(owner,locatordict) # load hub's classes FormBase_Locators = self.load_class('FormBase_Locators') # update this object's locator self.locators.update(FormBase_Locators.locators) # update the locators with those from the owner self.update_locators_from_owner() # setup page object's components self.submit = Button(self,{'base':'submit'}) self.fields = [] # update the component's locators with this objects overrides self._updateLocators()