def _start_scan(self, timeout=180): """ Start and execute scan 1. Go throught initial scan wizard without verification till screen where "Start scan" is possible. 2. Start scan 3. Verifay that scan is started. 4. Wait during timeout that scan is finnished. Args: timeout -- timeout of scan result waiting in sec Returns: True scan is executed, False is scan is not executed as expectd by any reason """ self._go_through_wizard(CAM_SCAN_WIZARD.LNB_FREQ) send_key("FWD") println("Wait for scan result screen.") result, status = wait_for(CAM_SCAN_WIZARD.SCAN_RESULT, timeout, 5) if result: println("VERIFICATION PASSED: Scan is executed.") return result and True else: println(("VERIFICATION FAILED: Scan is not finished during {} " "sec.\n \t - UI sate is {}").format(timeout, status)) return result and False
def _open_scan_wizard(self): println("\nWait for Interactive DCM request.") result, status = wait_for("Immediately", 2, 2) if result: selected, status = select_on_screen(DCM_OPTIONS, "Immediately") if selected: send_key("OK") return True else: print("DEBUG: Open Scan Wizard Failed") return False
def _open_scan_wizard(self): println("\nWait for CAM scan request.") result, status = wait_for("Immediately", 2, 2) print(FRONTEND.SEARCH_CAM_SCREEN) if result: selected, status = select_on_screen(DCM_OPTIONS, "Immediately") if selected: send_key("OK") return True else: print("DEBUG: Open Scan Wizard Failed") return False
def _set_presettings(self, settings): println("\nSet scan settings.") self._go_through_wizard(AUTO_SCAN_WIZARD.FIRST_SCREEN) result, status = select_on_screen(START_AUTO_SCAN, 'Change search settings') send_key("OK") result, status = wait_for(AUTO_SCAN_WIZARD.SIGNAL_SOURCE, 5, 1) if result: return self._set_settings(settings) else: println("VERIFICATION FAILED: Scan settings cannot be set.") self._close_scan_wizard() return False
def _close_scan_wizard(self): """ Close initial scan wizard in fastest way. Intial scan wizard can be closed in different way: 1. Cancel scan 2. Close wizard from scan result screen 3. Close wizard from network configuration screen 4. Close wizard from software update screen If current screen is not a screen where wizard can be closed, then >> will be pressed. Reset_to_initial_state() will be called if wizard is not closed from firts attempt, if wizard id cycled, if tV doesn't react on key pressing. Returns: True if wizard is closed/ False otherwise """ forward = True println("\nClose cam scan wizard") initial_status = get_status() while forward: current_status = get_status() if CAM_SCAN_WIZARD.SCAN_RESULT in current_status: time.sleep(2) send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) forward = False elif CAM_SCAN_WIZARD.STATIONS_SORTING in current_status: result, status = wait_for(CAM_SCAN_WIZARD.SCAN_RESULT, 30, 5) if result: time.sleep(2) send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) forward = False else: println( "VERIFICATION FAILED: Scan is not finished during 30sec." ) return False else: if not send_key_with_verification('FWD'): println("#ERROR: TV doesn't react on key >>.") forward = False elif get_status() == initial_status: println("#ERROR: UI is cycled.") forward = False result = check_all_wizard_closed() println("DEBUG: RESULT IS {}".format(result)) if not result: println("#VERIFICATION FAILED: wizard is not closed") return False else: return True
def _close_scan_wizard(self): """ Close auto scan wizard in fastest way. Returns: True if wizard is closed/ False otherwise """ forward = True println("\nClose auto scan wizard") initial_status = get_status() while forward: current_status = get_status() if AUTO_SCAN_WIZARD.FIRST_SCREEN in current_status: forward = False #one 'exit' is workaround to close additional messages send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) elif AUTO_SCAN_WIZARD.SCAN in current_status: forward = False #one 'exit' is workaround to close additional messages send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) else: if not send_key_with_verification('FWD'): println("#ERROR: TV doesn't react on key >>.") forward = False elif get_status() == initial_status: println("#ERROR: UI is cycled.") forward = False if not check_all_wizard_closed(): println("#VERIFICATION FAILED: wizard is not closed") return False else: return True
def _start_scan(self, timeout=180): """ Start and execute scan 1. Go throught initial scan wizard without verification till screen where "Start scan" is possible. 2. Start scan 3. Verifay that scan is started. 4. Wait during timeout that scan is finnished. Args: timeout -- timeout of scan result waiting in sec Returns: True scan is executed, False is scan is not executed as expectd by any reason """ self._go_through_wizard(AUTO_SCAN_WIZARD.FIRST_SCREEN) result, status = select_on_screen(START_AUTO_SCAN, 'Start search/update') if not result: println("VERIFICATION FAILED: Auto scan cannot be started.") return False send_key("OK") result, status = wait_for(AUTO_SCAN_WIZARD.SCAN, 10, 2) if result: result = True println("VERIFICATION PASSED: Auto scan is started.") else: result = False println(("VERIFICATION FAILED: Auto scan is not started during " "10sec.\n \t - UI sate is {}").format(status)) result, status = wait_for(AUTO_SCAN_WIZARD.SCAN_RESULT, timeout, 2) if result: println("VERIFICATION PASSED: Scan is executed.") return result and True else: println(("VERIFICATION FAILED: Scan is not finished during {} " "sec.\n \t - UI sate is {}").format(timeout, status)) return result and False
def _close_scan_wizard(self): """ Close initial scan wizard in fastest way. Intial scan wizard can be closed in different way: 1. Cancel scan 2. Close wizard from scan result screen 3. Close wizard from network configuration screen 4. Close wizard from software update screen If current screen is not a screen where wizard can be closed, then >> will be pressed. Reset_to_initial_state() will be called if wizard is not closed from firts attempt, if wizard id cycled, if tV doesn't react on key pressing. Returns: True if wizard is closed/ False otherwise """ forward = True println("\nClose initial scan wizard") initial_status = get_status() println("DEBUG: PRINTING GET STATUS %s" % initial_status) while forward: current_status = get_status() if INITIAL_SCAN_WIZARD.LICENCE in current_status: println("INFO: Licence agreement is displayed.") send_key_with_verification('OK') elif INITIAL_SCAN_WIZARD.NETWORK_CONFIGURATION in current_status: forward = False selected, status = select_on_screen( NETWORK_CONFIGURATION, 'Do not configure or configure later') if selected: send_key("OK") time.sleep(2) send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) else: println(("#ERROR: Initial scan wizard cannot be closed " "from '{}' screen.").format( INITIAL_SCAN_WIZARD.NETWORK_CONFIGURATION)) println("INFO: UI status - {}".format(status)) elif INITIAL_SCAN_WIZARD.START_SCAN in current_status: forward = False selected, status = select_on_screen(START_SCAN, 'Cancel') if selected: send_key("OK") time.sleep(2) send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) else: println(("#ERROR: Initial scan wizard cannot be closed " "from '{}' screen.").format( INITIAL_SCAN_WIZARD.START_SCAN)) print("INFO: UI status - {}".format(status)) open_main_menu() elif INITIAL_SCAN_WIZARD.SCAN_RESULT in current_status: forward = False println("DEBUG: BEFORE GET STATUS") send_key("EXIT") time.sleep(2) send_key("EXIT") time.sleep(2) elif INITIAL_SCAN_WIZARD.INFORM_ABOUT_NEW_SOFTWARE in current_status: forward = False send_key("EXIT") time.sleep(2) #workaround: additional pressing 'back' to close any message if displayed send_key("EXIT") time.sleep(2) else: if not send_key_with_verification('FWD'): println("#ERROR: TV doesn't react on key >>.") forward = False elif get_status() == initial_status: println("#ERROR: UI is cycled.") forward = False println("DEBUG: AFTER GET_STATUS") result = check_all_wizard_closed() println("DEBUG: RESULT IS {}".format(result)) if not result: println("#VERIFICATION FAILED: wizard is not closed") return False else: return True