def visit(cls): # TODO: Remove hard when config ready # https://win-ko2af9k2doa.mtdev.mozypro.local/adfs/ls/?SAMLRequest=7b0HYBxJliUmL23Ke39K9UrX4HShCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995777333nvvvfe6O51OJ%2fff%2fz9cZmQBbPbOStrJniGAqsgfP358Hz8iHjfZolw9Ol638%2bWr%2fBet86ZNz55%2b9tHv%2f%2bk0m9w%2ff3iwfX%2fv%2fqfb%2b7uTe9sH%2bw92ts%2f3Pp083Ls%2fme4fHHyU%2fmReN0W1%2fOyjvfHOR%2blZ06zzs2XTZsuWPtrZfbC98%2bn27t6bnb1He7v0v%2fHDnf2f%2bih9Sr0Uy6zlN%2bdtu2oe3b17VSy331Z72fnDt3uzKhsv2ll%2bOV5UP7he1dW4rKZZeTebnTd3y%2bbuR%2blJtWxy9LKul4%2bqrCmaR8tskTeP2umj18dfPH9ECD2aSqNH62WzyqfFeZHPPkrfLcpl84iHvflt6ratplX50dFjHlgtr25%2bKWuavMbAPjrCwGhc3z17sf17fbl3%2fOzh77X39Mvj4XHRi5fFNG%2futvW6aR%2fflU6PHtNQZwVANu%2bJwOPj9azIl9P8FdG7Lqb41H14ZAif0dzvMULjabW4%2b4uy3b1ltazyxWpdlndBqMd37Uvu1wDoXYck%2fdHnqaP%2fBw%3d%3d&Signature=PE5xudj2pJEbvkfVY%2bBDCwOVIyLW0USobV%2bgONyZgAbTuJgrZ1ab62bFUksGexqIgP8SnecXjXcgSWCghDuXqdZxdxwmnW1TBnGwNPrEWuPvm0VTCYpsENUT3XxplC45Rrt8SGczowwKTBG1EFF8G9bdfd5cDF5ulNiJzxUDve58UBLzEOFo4NXsvChIcaWUgBZOhf07ietvEBagnZzPNOd2B0i8juxdF%2fXYqlrekIzED4tno0FvHUiMnhYMOsG4NH1K3dKhclordj4Bq787YQzrwZegf3WOllaq%2fPB6%2fapEoakI3b1mk54MMK2EWDrR1i0dJbiV%2bLl1YRX204T7Tg%3d%3d&SigAlg=http%3a%2f%2fwww.w3.org%2f2001%2f04%2fxmldsig-more%23rsa-sha256 #fedidpage_url = "https://win-ko2af9k2doa.mtdev.mozypro.local/adfs/ls/IdpInitiatedSignOn.aspx" fedidpage_url = "https://10.29.103.120/adfs/ls/IdpInitiatedSignOn.aspx" cls.driver = Page.create_browser() cls.driver.get(fedidpage_url)
def visit(self): self.dashboardpage_driver = Page.current_driver() env = RUNNER_CONFIG.get('ENVIRONMENT') or 'QA12' bushost = GLOBAL_CONFIG.get('QA_ENVIRONMENT').get(env).get('mozy.bushost') or 'www.mozypro.com' dashboardpage_url = "{bushost}/dashboard".format(bushost=bushost) if not bushost.startswith('https://'): dashboardpage_url = "https://{page}".format(page=dashboardpage_url) try: self.dashboardpage_driver.get(dashboardpage_url) except: self.dashboardpage_driver = Page.create_browser(force=True) self.dashboardpage_driver.get(dashboardpage_url)
def visit(self, machineid): self.machinepage_driver = Page.current_driver() env = RUNNER_CONFIG.get('ENVIRONMENT') or 'QA12' bushost = GLOBAL_CONFIG.get('QA_ENVIRONMENT').get(env).get('mozy.bushost') or 'www.mozypro.com' if not bushost.startswith('https://'): machinepage_url = "https://{bushost}/admin/view_restores/{machineid}".format(bushost=bushost, machineid=machineid) else: machinepage_url = "{bushost}/admin/view_restores/{machineid}".format(bushost=bushost, machineid=machineid) # self.machinepage_driver = Page.create_browser() try: self.machinepage_driver.get(machinepage_url) except: self.machinepage_driver = Page.create_browser(force=True) self.machinepage_driver.get(machinepage_url)
def direct_download(self, table): try: self.driver = Page.create_browser() self.driver.switch_to.window(self.driver.window_handles[-1]) self.locate_element(self.xpaths['deviceTab']).click() machine_xpath = "//span[text()='" + table[0].get( 'restore_machine') + "']" self.wait_for_element_list(machine_xpath, 1).click() self.dig_to_folder(table[0].get('folder_hierarchy')) for row in table: xpath = "//tr[contains(@id, '" + row.get( 'restore_item' ) + "')]/td[@class='center col col-checkbox']//span" self.delayed_click(xpath) self.delayed_click(self.xpaths['downloadBtn']) self.delayed_click(self.xpaths['noticeDialog'], -1) result = self.wait_for_download_complete() return result except Exception: LogHelper.error("Fail to direct download.") return False
def visit(self): env = RUNNER_CONFIG.get('ENVIRONMENT') or 'QA12' bushost = GLOBAL_CONFIG.get('QA_ENVIRONMENT').get(env).get('mozy.bushost') or 'www.mozypro.com' if not bushost.startswith('https://'): bus_url = "https://{bushost}/login/admin?old_school=1".format(bushost=bushost) else: bus_url = "{bushost}/login/admin?old_school=1".format(bushost=bushost) self.bus_driver = Page.create_browser() self.bus_driver.set_page_load_timeout(30) result = False try: self.bus_driver.get(bus_url) except Exception: LogHelper.error("Can't access BUS.") # Page.quit() return result else: # If page is opened successfully result = Page.is_element_exist(self.xpaths['loginfield'], wait_time=40) return result
def openbrowser(self): try: self.bus_driver = Page.create_browser() except Exception: LogHelper.error("Can't open browser.") return False
def visit_cas(self): env = RUNNER_CONFIG.get('ENVIRONMENT') or 'QA12' if "QA" in env: cas_host = GLOBAL_CONFIG.get('QA_ENVIRONMENT').get(env).get('mozy.cashost') self.bus_driver = Page.create_browser() self.bus_driver.get(cas_host)