コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
ファイル: auto_scan.py プロジェクト: papachappa/lw_javascript
 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
コード例 #4
0
ファイル: scan.py プロジェクト: papachappa/lw_javascript
    def __select(self, item):
        """ Privat function for scan_interpritator
        Select item on screen and print pretty log

        Raises: ValueError if unable to get response. 
        """
        result, status = select_on_screen(item[0], item[1])
        if result:
            println("VERIFICATION PASSED: Requested element '{}' is selected".
                    format(item[1]))
        else:
            println(
                "#VERIFICATION FAILED: Requested element '{}' is NOT selected".
                format(item[1]))
            println("INFO: UI status - {}".format(status))
            println("Test will be terminated.")
            raise ValueError("Expected element cannot be selected.")
コード例 #5
0
ファイル: auto_scan.py プロジェクト: papachappa/lw_javascript
    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
コード例 #6
0
    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