def cerrar_sesion_dropbox(webdriver_test_ux: WebDriver, json_eval):
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:
            boton_imagen_perfil = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 12, class_name='dig-Menu')

            HtmlActions.click_html_element(boton_imagen_perfil,
                                           class_name='dig-Menu')

            boton_salir_sesion = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                12,
                xpath='//div[@class="dig-Menu-row-title"][text()="Salir"]')

            HtmlActions.click_html_element(
                boton_salir_sesion,
                xpath='//div[@class="dig-Menu-row-title"][text()="Salir"]')

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_email')
            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_password')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_CIERRE_SESION_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 5, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def ingreso_pagina_principal_claro_drive(webdriver: WebDriver, json_eval):
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:
            url_claro_drive = FormatUtils.lector_archivo_ini().get(
                'Driver', 'url_claro_drive')
            webdriver.get(url_claro_drive)

            # localiza boton de inicio en la pagina principal
            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver,
                15,
                id=const_claro_drive.INGRESO_PAGINA_PRINCIPAL_ID_INPUT_LOGIN)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, True,
                const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.\
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except InvalidArgumentException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except WebDriverException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 0, tiempo_step_inicio, fecha_inicio)

        return json_eval
Example #3
0
    def establecer_vista_de_archivos_como_lista(webdriver: WebDriver):

        boton_vista = webdriver.find_element_by_xpath(
            '//div[@class="icon view-toggle"]')
        tool_tip = boton_vista.find_element_by_class_name('amx-tooltip')
        tool_tip = tool_tip.get_attribute('innerHTML')
        tool_tip = tool_tip.strip()

        if tool_tip == 'Vista lista':
            HtmlActions.webdriver_wait_until_not_presence_of_element_located(
                webdriver, 15, xpath='//div[@class="row type-success"]')
            boton_vista.click()
    def cargar_archivo_dropbox(self, webdriver_test_ux: WebDriver, json_eval,
                               json_args, nombre_archivo_sin_ext,
                               nombre_archivo_con_ext):
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 2,
                constantes_evaluaciones_claro_drive.
                MSG_CARGA_ARCHIVO_FALLIDA_POR_INICIO_DE_SESION)

            return json_eval

        try:
            ValidacionesHtml.verificar_remover_ventana_configuracion(
                webdriver_test_ux)
            ValidacionesHtml.verificar_archivo_ya_existente_en_portal(
                webdriver_test_ux, nombre_archivo_sin_ext)

            # seingresa a la pagina principal del portal
            webdriver_test_ux.get('https://www.dropbox.com/h?role=personal')

            # se obtienen los input de tipo file para la carga del archivo, si sobrepasa mas de 20 segundos,
            # se sigue el flujo del script
            while True:
                segundos = 0
                lista_inputs_type_file = webdriver_test_ux.find_elements_by_xpath(
                    '//input[@type="file"]')

                if len(lista_inputs_type_file) > 0:
                    break
                elif segundos > 20:
                    break
                else:
                    segundos += 1
                    time.sleep(1)

            # se intentara realizar la carga de archivo en un lapso de 10 seg, si sobrepasa el tiempo sin exito,
            # se continua el flujo del script
            while True:
                segundos = 0

                if len(lista_inputs_type_file) > 0:

                    HtmlActions.enviar_data_keys(
                        lista_inputs_type_file[0],
                        json_args['pathImage'],
                        xpath='//input[@type="file"][0]')

                    # for input_file in lista_inputs_type_file:
                    #     HtmlActions.enviar_data_keys(
                    #         input_file, json_args['pathImage'], xpath='//input[@type="file"][0]')

                    if ValidacionesHtml.verificar_elemento_html_por_class_name(
                            'dig-Modal-footer', webdriver_test_ux):
                        break

                time.sleep(1)
                segundos += 1

                if segundos > 10:
                    break

            footer = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 5, class_name='dig-Modal-footer')

            btn_carga = HtmlActions.webdriver_wait_element_to_be_clickable(
                footer, 5, class_name='dig-Button--primary')

            HtmlActions.click_html_element(btn_carga,
                                           class_name='dig-Button--primary')

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                720,
                xpath=
                '//span[@class="dig-Snackbar-message "][text()="Se carg\u00F3 {}."]'
                .format(nombre_archivo_con_ext))

            btn_cerrar_progreso_carga = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                10,
                xpath='//span[@class="dig-Button-content"][text()="Cerrar"]')

            HtmlActions.click_html_element(
                btn_cerrar_progreso_carga,
                xpath='//span[@class="dig-Button-content"][text()="Cerrar"]')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_CARGA_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 2, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def inicio_sesion_claro_drive(webdriver_test_ux: WebDriver, json_eval,
                                  argumentos_json):

        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_pagina_principal(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 1,
                const_claro_drive.
                MSG_OUTPUT_INICIO_SESION_MSG_ERROR_INGRESO_PAGINA_PRINCIPAL)

            return json_eval

        try:
            btn_inicio_sesion = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                6,
                id=const_claro_drive.INICIO_SESION_ID_INPUT_LOGIN)
            HtmlActions.click_html_element(
                btn_inicio_sesion,
                id=const_claro_drive.INICIO_SESION_ID_INPUT_LOGIN)

            input_email = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                6,
                class_name=const_claro_drive.
                INICIO_SESION_CLASS_NAME_INPUT_EMAIL)
            HtmlActions.enviar_data_keys(
                input_email,
                data_key=argumentos_json[const_claro_drive.JSON_ARG_USER],
                class_name=const_claro_drive.
                INICIO_SESION_CLASS_NAME_INPUT_EMAIL)

            input_password = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                6,
                class_name=const_claro_drive.
                INICIO_SESION_CLASS_NAME_INPUT_PASSWORD)
            input_password.send_keys(
                argumentos_json[const_claro_drive.JSON_ARG_PASSWORD])

            btn_ingreso_cuenta = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                6,
                xpath=const_claro_drive.INICIO_SESION_XPATH_BTN_INICIAR_SESION)
            HtmlActions.click_html_element(
                btn_ingreso_cuenta,
                xpath=const_claro_drive.INICIO_SESION_XPATH_BTN_INICIAR_SESION)

            # inicia el tiempo de inicio
            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                120,
                class_name=const_claro_drive.
                INICIO_SESION_CLASS_NAME_BTN_CREATE_RESOURCE)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, True,
                const_claro_drive.MSG_OUTPUT_INICIO_SESION_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO. \
                format(e.msg)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 1, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def cerrar_sesion_claro_drive(webdriver_test_ux: WebDriver, json_eval):
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 5,
                const_claro_drive.
                MSG_OUTPUT_CIERRE_SESION_MSG_ERROR_INICIO_SESION)

            return json_eval

        try:
            boton_cerrar_sesion = HtmlActions.webdriver_wait_invisibility_of_element_located(
                webdriver_test_ux,
                20,
                xpath=const_claro_drive.CERRAR_SESION_XPATH_LI_LOGOUT)

            link_cierre_de_sesion = boton_cerrar_sesion.get_attribute(
                const_claro_drive.CERRAR_SESION_ATTR_HREF)

            webdriver_test_ux.get(link_cierre_de_sesion)

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                20,
                id=const_claro_drive.CERRAR_SESION_ID_LOGIN)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, True,
                const_claro_drive.MSG_OUTPUT_CIERRE_SESION_EXITOSO)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CIERRE_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 5, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 5, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def borrar_archivo_claro_drive(webdriver_test_ux: WebDriver, json_eval,
                                   nombre_archivo_sin_ext: str,
                                   ext_archivo: str):

        nombre_completo_de_la_imagen = '{}{}'.format(nombre_archivo_sin_ext,
                                                     ext_archivo)
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 4,
                const_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_MSG_ERROR_INICIO_SESION)

            return json_eval

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_cargo_correctamente_el_fichero(json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 4,
                const_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_MSG_ERROR_CARGA_ARCHIVO)

            return json_eval

        try:
            action = ActionChains(webdriver_test_ux)

            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            UtilsEvaluaciones.esperar_aparicion_modal_de_exito(
                webdriver_test_ux)
            UtilsEvaluaciones.esperar_desaparicion_modal_exito(
                webdriver_test_ux)

            archivo_localizado_por_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath=const_claro_drive.
                BORRAR_ARCHIVO_XPATH_ARCHIVO_POR_DESCARGAR.format(
                    nombre_archivo_sin_ext))

            action.move_to_element(archivo_localizado_por_descargar)

            action.perform()

            lista_de_divs_de_archivos = webdriver_test_ux.find_elements_by_class_name(
                const_claro_drive.BORRAR_ARCHIVO_CLASS_NAME_FILENAME)

            if len(lista_de_divs_de_archivos) != 0:
                for div in lista_de_divs_de_archivos:

                    nombre_archivo_sin_extension_obtenido = div.find_element_by_class_name(
                        const_claro_drive.
                        BORRAR_ARCHIVO_CLASS_NAME_NAME_WITHOUT_EXT
                    ).get_attribute(
                        const_claro_drive.BORRAR_ARCHIVO_ATTR_INNER_TEXT)

                    nombre_archivo_sin_extension_obtenido = nombre_archivo_sin_extension_obtenido.strip(
                    )

                    extension_del_archivo_obtenido = webdriver_test_ux.find_element_by_class_name(
                        const_claro_drive.BORRAR_ARCHIVO_EXT).get_attribute(
                            const_claro_drive.BORRAR_ARCHIVO_ATTR_INNER_TEXT)

                    extension_del_archivo_obtenido = extension_del_archivo_obtenido.strip(
                    )

                    nombre_archivo_formateado = '{}{}'.format(
                        nombre_archivo_sin_extension_obtenido,
                        extension_del_archivo_obtenido)

                    if nombre_archivo_formateado == nombre_completo_de_la_imagen:

                        lista_botones = div.find_elements_by_class_name(
                            const_claro_drive.BORRAR_ARCHIVO_CLASS_NAME_ACTION)

                        HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                            webdriver_test_ux)

                        if len(lista_botones) > 0:

                            boton_borrar_archivo = lista_botones[-7]

                            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                                webdriver_test_ux)

                            tiempo_step_inicio = Temporizador.obtener_tiempo_timer(
                            )

                            HtmlActions.click_en_elemento_html_con_intentos(
                                boton_borrar_archivo,
                                5,
                                class_name=const_claro_drive.
                                BORRAR_ARCHIVO_CLASS_NAME_ACTION)

                            # HtmlActions.click_html_element(
                            #     boton_borrar_archivo, class_name=const_claro_drive.BORRAR_ARCHIVO_CLASS_NAME_ACTION)

                            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                                webdriver_test_ux)

                            UtilsEvaluaciones.esperar_aparicion_modal_de_exito(
                                webdriver_test_ux)
                            UtilsEvaluaciones.esperar_desaparicion_modal_exito(
                                webdriver_test_ux)
                            break

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, True,
                const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_EXITOSO)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 4, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def cargar_archivo_dropbox(webdriver_test_ux: WebDriver, json_eval,
                               json_args, nombre_archivo_sin_ext,
                               nombre_archivo_con_ext):
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:
            ValidacionesHtml.verificar_remover_ventana_configuracion(
                webdriver_test_ux)
            ValidacionesHtml.verificar_archivo_ya_existente_en_portal(
                webdriver_test_ux, nombre_archivo_sin_ext)

            input_carga_de_archivo = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, xpath='//body/div/div/input[1]')

            HtmlActions.enviar_data_keys(input_carga_de_archivo,
                                         data_key=json_args['pathImage'],
                                         xpath='//body/div/div/input[1]')

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                12,
                xpath=
                '//div[@class="ReactModal__Content ReactModal__Content--after-open '
                'dig-Modal folder-picker-modal"]')

            btn_cargar = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                12,
                xpath=
                '//button[@class="dig-Button dig-Button--primary dig-Button--standard"]'
            )

            HtmlActions.webdriver_wait_until_not_presence_of_element_located(
                webdriver_test_ux,
                12,
                class_name='folder-picker__empty-message')

            WebDriverWait(webdriver_test_ux, 12).until(
                EC.presence_of_element_located(
                    (By.CLASS_NAME, 'folder-picker__empty-message')))

            HtmlActions.click_html_element(
                btn_cargar,
                xpath='//button[@class="dig-Button dig-Button--primary '
                'dig-Button--standard"]')

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_visibility_of_element_located(
                webdriver_test_ux,
                720,
                xpath=
                '//span[@class="dig-Snackbar-message "][text()="Se carg\u00F3 {}."]'
                .format(nombre_archivo_con_ext))

            btn_cerrar_progreso_carga = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                10,
                xpath='//span[@class="dig-Button-content"][text()="Cerrar"]')

            HtmlActions.click_html_element(
                btn_cerrar_progreso_carga,
                xpath='//span[@class="mc-button-content"][text()="Cerrar"]')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_CARGA_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 2, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def eliminar_archivo_dropbox(self, webdriver_test_ux: WebDriver, json_eval,
                                 nombre_archivo_con_ext):
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 4,
                constantes_evaluaciones_claro_drive.
                MSG_ELIMINACION_ARCHIVO_FALLIDA_POR_CARGA_ARCHIVO_FALLIDA)

            return json_eval

        try:

            archivo_por_eliminar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//tr[@data-filename="{}"]'.format(
                    nombre_archivo_con_ext))

            # HtmlActions.click_html_element(archivo_por_eliminar, xpath='//tr[@data-filename="{}"]')
            #
            btn_mas_acciones = HtmlActions.webdriver_wait_element_to_be_clickable(
                archivo_por_eliminar,
                20,
                xpath='//button[@data-testid="action-bar-overflow"]')

            HtmlActions.click_html_element(
                btn_mas_acciones,
                xpath='//button[@data-testid="action-bar-overflow"]')

            btn_eliminar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//div[@class="dig-Menu-row-title"][text()="Eliminar"]')

            HtmlActions.click_html_element(
                btn_eliminar,
                xpath='//div[@class="dig-Menu-row-title"][text()="Eliminar"]')

            btn_eliminar_modal = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//span[@class="dig-Button-content"][text()="Eliminar"]')

            HtmlActions.click_html_element(
                btn_eliminar_modal,
                xpath='//span[@class="dig-Button-content"][text()="Eliminar"]')

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                30,
                xpath=
                '//span[@class="dig-Snackbar-message "][text()="Se elimin\u00F3 1 elemento."]'
            )

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 4, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def borrar_archivo_claro_drive(webdriver_test_ux: WebDriver, json_eval,
                                   nombre_archivo_sin_ext: str,
                                   ext_archivo: str):

        nombre_completo_de_la_imagen = '{}{}'.format(nombre_archivo_sin_ext,
                                                     ext_archivo)
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 4,
                const_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_MSG_ERROR_INICIO_SESION)

            return json_eval

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_cargo_correctamente_el_fichero(json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 4,
                const_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_MSG_ERROR_CARGA_ARCHIVO)

            return json_eval

        try:

            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            # localiza el archivo a eliminar en el portal
            archivo_localizado_por_descargar = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 20, class_name='filename')

            # verifica que ya no se presente una modal de exito, para no interrumpir los clics en el portal
            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            # se localiza el boton de sub menu del archivo a borrar
            boton_sub_menu_actions = HtmlActions.webdriver_wait_presence_of_element_located(
                archivo_localizado_por_descargar, 20, class_name='open-menu')

            # se realiza un clic en el boton del submenu (en caso de fallar, se hacen dos intentos mas)
            HtmlActions.click_en_elemento_html_con_intentos(
                boton_sub_menu_actions,
                numero_de_intentos=3,
                class_name='open-menu')
            #HtmlActions.click_html_element(boton_sub_menu_actions, class_name='open-menu')

            # se busca el boton de eliminar, el cual contiene el submenu
            boton_eliminar = HtmlActions.webdriver_wait_presence_of_element_located(
                boton_sub_menu_actions,
                20,
                xpath='//li[@class="delete action"]')

            # se verifica que no este presente la modal de algun mensaje, para que no
            # intervenga en el clic al boton de eliminar
            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            # se realiza un clic al boton de eliminar
            HtmlActions.click_html_element(
                boton_eliminar, xpath='//li[@class="delete action"]')

            # se empieza a tomar el tiempo de duracion de la eliminacion del archivo
            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
            UtilsEvaluaciones.esperar_aparicion_modal_de_exito(
                webdriver_test_ux)

            # se establecen los resultados exitosos en el json
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, True,
                const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_EXITOSO)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 4, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def descarga_archivo_claro_drive(webdriver_test_ux: WebDriver,
                                     nombre_archivo_sin_ext: str, json_eval,
                                     ext_archivo: str):

        nombre_completo_de_la_imagen = '{}{}'.format(nombre_archivo_sin_ext,
                                                     ext_archivo)
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 3,
                const_claro_drive.
                MSG_OUTPUT_DESCARGA_ARCHIVO_MSG_ERROR_INICIO_SESION)

            return json_eval

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_cargo_correctamente_el_fichero(json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 3,
                const_claro_drive.
                MSG_OUTPUT_DESCARGA_ARCHIVO_MSG_ERROR_CARGA_ARCHIVO)

            return json_eval

        try:
            # verifica que ya no se presente una modal de exito, para no interrumpir los clics en el portal
            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            # busqueda del input o barra de busqueda
            input_busqueda = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                id=const_claro_drive.DESCARGA_ARCHIVO_ID_SEARCH_BOX)

            # se ingresa cada caracter a la barra de busqueda con un lapso de tiempo
            for character in nombre_completo_de_la_imagen:
                HtmlActions.enviar_data_keys(
                    input_busqueda,
                    character,
                    id=const_claro_drive.DESCARGA_ARCHIVO_ID_SEARCH_BOX)
                time.sleep(.25)

            # se envia una tecla Enter, para que realice la busqueda del archivo
            HtmlActions.enviar_data_keys(
                input_busqueda,
                Keys.RETURN,
                id=const_claro_drive.DESCARGA_ARCHIVO_ID_SEARCH_BOX)

            # se establece un sleep de 5 segundos para que refresque la pantalla y muestre los
            # archivos localizados
            time.sleep(5)

            # localiza el archivo a descargar en el portal
            archivo_localizado_por_descargar = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 20, class_name='filename')

            # verifica que ya no se presente una modal de exito, para no interrumpir los clics en el portal
            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            boton_sub_menu_actions = HtmlActions.webdriver_wait_presence_of_element_located(
                archivo_localizado_por_descargar, 20, class_name='open-menu')

            HtmlActions.click_html_element(boton_sub_menu_actions,
                                           class_name='open-menu')

            boton_descargar = HtmlActions.webdriver_wait_presence_of_element_located(
                boton_sub_menu_actions,
                20,
                xpath='//li[@class="download action"]')

            HtmlActions.click_html_element(
                boton_descargar, xpath='//li[@class="download action"]')

            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            UtilsEvaluaciones.verificar_descarga_en_ejecucion(
                nombre_archivo_sin_ext, ext_archivo)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, True,
                const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_EXITOSO)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except ElementNotInteractableException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 3, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def inicio_sesion_dropbox(webdriver_test_ux: WebDriver, json_eval,
                              json_args):
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()
        ventana_padre = None

        try:
            btn_inicio_sesion = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                6,
                xpath='//button[@class="auth-google button-primary"]')

            HtmlActions.click_html_element(
                btn_inicio_sesion,
                xpath='//button[@class="auth-google button-primary"]')

            if ValidacionesHtml.se_encuentran_mas_ventanas_en_sesion(
                    webdriver_test_ux, 6):
                ventana_padre = webdriver_test_ux.window_handles[0]
                ventana_hija = webdriver_test_ux.window_handles[1]

                webdriver_test_ux.switch_to.window(ventana_hija)

            modo_no_grafico = FormatUtils.lector_archivo_ini().getboolean(
                'Driver', 'headless')

            if modo_no_grafico:

                input_correo_gmail = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 6, id='Email')

                HtmlActions.enviar_data_keys(input_correo_gmail,
                                             json_args['user'],
                                             id='Email')

                btn_next_gmail_sec_email = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 6, id='next')

                HtmlActions.click_html_element(btn_next_gmail_sec_email,
                                               id='next')

                input_pass_gmail = HtmlActions.webdriver_wait_presence_of_element_located(
                    webdriver_test_ux, 6, id='password')

                HtmlActions.enviar_data_keys(input_pass_gmail,
                                             json_args['password'],
                                             id='password')

                btn_next_gmail_sec_password = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 6, id='submit')

                HtmlActions.click_html_element(btn_next_gmail_sec_password,
                                               id='submit')

            else:

                input_correo_gmail = HtmlActions.webdriver_wait_presence_of_element_located(
                    webdriver_test_ux, 10, id='identifierId')

                HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 10, id='identifierId')
                HtmlActions.click_html_element(input_correo_gmail,
                                               id='identifierId')
                HtmlActions.enviar_data_keys(input_correo_gmail,
                                             json_args['user'],
                                             id='identifierId')

                btn_next_gmail_sec_email = HtmlActions.webdriver_wait_presence_of_element_located(
                    webdriver_test_ux, 10, id='identifierNext')

                HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 10, id='identifierNext')
                HtmlActions.click_html_element(btn_next_gmail_sec_email,
                                               id='identifierNext')

                div_form = HtmlActions.webdriver_wait_presence_of_element_located(
                    webdriver_test_ux, 10, id='password')

                HtmlActions.webdriver_wait_presence_of_element_located(
                    div_form, 10, name='password')
                HtmlActions.webdriver_wait_presence_of_element_located(
                    div_form, 10, name='password')
                HtmlActions.webdriver_wait_presence_of_element_located(
                    div_form, 10, name='password')

                input_pass_gmail = HtmlActions.webdriver_wait_presence_of_element_located(
                    div_form, 10, name='password')
                HtmlActions.enviar_data_keys(input_pass_gmail,
                                             json_args['password'],
                                             name='password')

                btn_next_gmail_sec_password = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux, 10, id='passwordNext')

                HtmlActions.click_html_element(btn_next_gmail_sec_password,
                                               id='passwordNext')

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            webdriver_test_ux.switch_to.window(ventana_padre)

            HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 10, class_name='maestro-nav__contents')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_INICIO_SESION_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 1, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def eliminar_archivo_dropbox(webdriver_test_ux: WebDriver, json_eval,
                                 nombre_archivo_con_ext):
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:

            archivo_por_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//tr[@data-filename="{}"]'.format(
                    nombre_archivo_con_ext))

            btn_mas_acciones = HtmlActions.webdriver_wait_element_to_be_clickable(
                archivo_por_descargar, 20, class_name='browse-overflow-menu')

            HtmlActions.click_html_element(btn_mas_acciones,
                                           class_name='browse-overflow-menu')

            btn_eliminar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 20, class_name='action-delete')

            HtmlActions.click_html_element(btn_eliminar,
                                           class_name='action-delete')

            btn_eliminar_modal = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//span[@class="mc-button-content"][text()="Eliminar"]')

            HtmlActions.click_html_element(
                btn_eliminar_modal,
                xpath='//span[@class="mc-button-content"][text()="Eliminar"]')

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                30,
                xpath=
                '//span[@class="dig-Snackbar-message "][text()="Se elimin\u00F3 1 '
                'elemento."]')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_BORRADO_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_BORRADO_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 4, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 4, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def descargar_archivo_dropbox(webdriver_test_ux: WebDriver, json_eval,
                                  nombre_archivo_con_ext):

        extension_del_archivo = path.splitext(nombre_archivo_con_ext)[1]
        nombre_del_archivo_sin_extension = Path(nombre_archivo_con_ext).stem

        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:
            ValidacionesHtml.verificar_remover_ventana_configuracion(
                webdriver_test_ux)

            search_bar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 20, class_name='search__input')

            HtmlActions.enviar_data_keys(search_bar,
                                         nombre_archivo_con_ext,
                                         class_name='search__input')

            HtmlActions.enviar_data_keys(search_bar,
                                         Keys.RETURN,
                                         class_name='search__input')

            archivo_por_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//tr[@data-filename="{}"]'.format(
                    nombre_archivo_con_ext))

            btn_mas_acciones = HtmlActions.webdriver_wait_element_to_be_clickable(
                archivo_por_descargar, 20, class_name='browse-overflow-menu')

            HtmlActions.click_html_element(btn_mas_acciones,
                                           class_name='browse-overflow-menu')

            btn_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 20, class_name='action-download')

            HtmlActions.click_html_element(btn_descargar,
                                           class_name='action-download')

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            UtilsEvaluaciones.verificar_descarga_en_ejecucion(
                nombre_del_archivo_sin_extension, extension_del_archivo)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_DESCARGA_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 3, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def ingreso_pagina_principal_dropbox(webdriver_test_ux: WebDriver,
                                         json_eval):
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        try:
            url_pagina_principal = FormatUtils.lector_archivo_ini().get(
                'Dropbox_config', 'url_login')
            webdriver_test_ux.get(url_pagina_principal)

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_email')
            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_password')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except InvalidArgumentException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except WebDriverException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 0, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def ingreso_pagina_principal_dropbox(self, webdriver_test_ux: WebDriver,
                                         json_eval, url_login):
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        webdriver_test_ux.get(url_login)

        try:
            time.sleep(4)
            # verifica que no estemos loggeados desde un inicio, en caso contrario, cerramos sesion
            if ValidacionesHtml.verificar_elemento_html_por_id(
                    'maestro-portal', webdriver_test_ux):

                boton_imagen_perfil = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux,
                    12,
                    class_name='account-menu-v2__avatar')

                HtmlActions.click_html_element(
                    boton_imagen_perfil, class_name='account-menu-v2__avatar')

                boton_salir_sesion = HtmlActions.webdriver_wait_element_to_be_clickable(
                    webdriver_test_ux,
                    12,
                    xpath='//div[@class="dig-Menu-row-title"][text()="Salir"]')

                HtmlActions.click_html_element(
                    boton_salir_sesion,
                    xpath='//div[@class="dig-Menu-row-title"][text()="Salir')

            else:
                webdriver_test_ux.get(url_login)

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_email')
            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux, 10, name='login_password')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        except WebDriverException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INGRESO_PAGINA_PRINCIPAL_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 0, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 0, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def descargar_archivo_dropbox(self, webdriver_test_ux: WebDriver,
                                  json_eval, nombre_archivo_con_ext):

        extension_del_archivo = path.splitext(nombre_archivo_con_ext)[1]
        nombre_del_archivo_sin_extension = Path(nombre_archivo_con_ext).stem

        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 3,
                constantes_evaluaciones_claro_drive.
                MSG_DESCARGA_ARCHIVO_FALLIDA_POR_CARGA_ARCHIVO_FALLIDA)

            return json_eval

        try:
            ValidacionesHtml.verificar_remover_ventana_configuracion(
                webdriver_test_ux)

            search_bar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 20, class_name='search__input')

            HtmlActions.enviar_data_keys(search_bar,
                                         nombre_archivo_con_ext,
                                         class_name='search__input')
            #time.sleep(1)
            HtmlActions.enviar_data_keys(search_bar,
                                         Keys.RETURN,
                                         class_name='search__input')

            archivo_por_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//tr[@data-filename="{}"]'.format(
                    nombre_archivo_con_ext))

            checkbox = HtmlActions.webdriver_wait_element_to_be_clickable(
                archivo_por_descargar, 10, class_name='brws-checkbox-cell')

            HtmlActions.click_html_element(checkbox,
                                           class_name='brws-checkbox-cell')

            btn_mas_acciones = HtmlActions.webdriver_wait_element_to_be_clickable(
                archivo_por_descargar,
                20,
                xpath='//button[@data-testid="action-bar-overflow"]')

            HtmlActions.click_html_element(
                btn_mas_acciones,
                xpath='//button[@data-testid="action-bar-overflow"]')

            btn_descargar = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                20,
                xpath='//div[@class="dig-Menu-row-title"][text()="Descargar"]')

            HtmlActions.click_html_element(
                btn_descargar,
                xpath='//div[@class="dig-Menu-row-title"][text()="Descargar"]')

            UtilsEvaluaciones.verificar_descarga_en_ejecucion(
                nombre_del_archivo_sin_extension, extension_del_archivo)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_DESCARGA_ARCHIVO_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_DESCARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 3, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 3, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def carga_archivo_claro_drive(webdriver_test_ux: WebDriver,
                                  path_archivo_carga: str, json_eval):

        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        # verifica que se haya iniciado sesion correctamente
        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_sesion(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 2,
                const_claro_drive.
                MSG_OUTPUT_CARGA_ARCHIVO_MSG_ERROR_INICIO_SESION)

            return json_eval

        try:
            boton_crear = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                10,
                class_name=const_claro_drive.
                CARGA_ARCHIVO_CLASS_NAME_BTN_CREATE_RESOURCE)

            HtmlActions.click_html_element(
                boton_crear,
                class_name=const_claro_drive.
                CARGA_ARCHIVO_CLASS_NAME_BTN_CREATE_RESOURCE)

            HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                20,
                class_name=const_claro_drive.
                CARGA_ARCHIVO_CLASS_NAME_FILE_NAME_READER)

            input_file = HtmlActions.webdriver_wait_presence_of_element_located(
                webdriver_test_ux,
                20,
                id=const_claro_drive.CARGA_ARCHIVO_ID_INPUT_FILE_START)

            HtmlActions.enviar_data_keys(
                input_file,
                path_archivo_carga,
                id=const_claro_drive.CARGA_ARCHIVO_ID_INPUT_FILE_START)

            ValidacionesHtml.verificar_ventana_archivo_duplicado(
                webdriver_test_ux)

            UtilsEvaluaciones.esperar_carga_total_de_archivo(webdriver_test_ux)

            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            btn_cerrar_div_progreso_carga_archivo = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                6,
                class_name=const_claro_drive.CARGA_ARCHIVO_CLASS_NAME_UP_CLOSE)

            HtmlActions.verificar_display_flex_modal_mensaje_de_exito(
                webdriver_test_ux)

            HtmlActions.click_html_element(
                btn_cerrar_div_progreso_carga_archivo,
                class_name=const_claro_drive.CARGA_ARCHIVO_CLASS_NAME_UP_CLOSE)

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, True,
                const_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_EXITOSO)

        except NoSuchElementException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        except StaleElementReferenceException as e:
            msg_output = const_claro_drive.MSG_OUTPUT_CARGA_ARCHIVO_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 2, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 2, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def inicio_sesion_dropbox(self, webdriver_test_ux: WebDriver, json_eval,
                              json_args, url_login):
        intentos_ingreso_password_gmail = 0
        tiempo_step_inicio = None
        fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

        if not UtilsEvaluaciones.se_ingreso_correctamente_a_la_pagina_principal(
                json_eval):
            json_eval = UtilsEvaluaciones.generar_json_inicio_de_sesion_incorrecta(
                json_eval, tiempo_step_inicio, fecha_inicio, 1,
                constantes_evaluaciones_claro_drive.
                MSG_INICIO_SESION_FALLIDA_POR_INGRESO_DE_PAGINA)

            return json_eval

        try:
            btn_inicio_sesion = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                6,
                xpath='//button[@class="auth-google button-primary"]')

            HtmlActions.click_html_element(
                btn_inicio_sesion,
                xpath='//button[@class="auth-google button-primary"]')

            if ValidacionesHtml.se_encuentran_mas_ventanas_en_sesion(
                    webdriver_test_ux, 6):
                ventana_padre = webdriver_test_ux.window_handles[0]
                ventana_hija = webdriver_test_ux.window_handles[1]

                webdriver_test_ux.switch_to.window(ventana_hija)

            modo_no_grafico = FormatUtils.lector_archivo_ini().getboolean(
                'Driver', 'headless')

            # input_user = HtmlActions.webdriver_wait_element_to_be_clickable(webdriver_test_ux, 6, id='identifierId')
            #
            # HtmlActions.enviar_data_keys(input_user, json_args['user'])
            #
            # btn_siguiente = HtmlActions.webdriver_wait_element_to_be_clickable(webdriver_test_ux, 6, id='identifierNext')
            #
            # HtmlActions.click_html_element(btn_siguiente, id='identifierNext')
            #
            # time.sleep(10)

            btn_usuario = HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux,
                6,
                xpath='//div[@data-email="{}"]'.format(json_args['user']))

            time.sleep(2)

            HtmlActions.click_html_element(
                btn_usuario,
                xpath='//div[@data-email="{}"]'.format(json_args['user']))

            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

            webdriver_test_ux.switch_to.window(ventana_padre)

            HtmlActions.webdriver_wait_element_to_be_clickable(
                webdriver_test_ux, 18, class_name='maestro-portal')

            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, True, constantes_evaluaciones_claro_drive.
                MSG_OUTPUT_INICIO_SESION_EXITOSO)

        except ElementNotInteractableException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except NoSuchElementException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except TimeoutException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        except ElementClickInterceptedException as e:
            msg_output = constantes_evaluaciones_claro_drive.MSG_OUTPUT_INICIO_SESION_SIN_EXITO.format(
                e.msg)
            json_eval = UtilsEvaluaciones.establecer_output_status_step(
                json_eval, 1, 0, False, msg_output)

        json_eval = UtilsEvaluaciones.finalizar_tiempos_en_step(
            json_eval, 1, tiempo_step_inicio, fecha_inicio)

        return json_eval
    def esperar_carga_total_de_archivo(webdriver: WebDriver,
                                       tiempo_step_inicio,
                                       tiempo_de_espera: int = 720):
        tiempo_inicial_ejecucion_de_funcion = Temporizador.obtener_tiempo_timer(
        )
        tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
        tiempo_transcurrido = 0
        se_cargo_correctamente_el_fichero = False
        mensaje_exception = 'Han transcurrido mas de 12 minutos, sin cargar correctamente el archivo dentro del ' \
                            'portal de Claro Drive'
        numero_de_cancelaciones_de_descargas = 0

        while tiempo_transcurrido < tiempo_de_espera:
            # en cada iteracion espera al menos un segundo
            time.sleep(1)
            tiempo_transcurrido = Temporizador.obtener_tiempo_timer(
            ) - tiempo_inicial_ejecucion_de_funcion
            modal_de_exito = webdriver.find_elements_by_xpath(
                '//div[@class="up-file-actions isDone"]')
            modal_archivo_duplicado = webdriver.find_elements_by_class_name(
                'oc-dialog')

            if len(modal_de_exito) == 1:
                se_cargo_correctamente_el_fichero = True
                break
            elif len(modal_archivo_duplicado) > 0:
                try:
                    modal_archivo_duplicado = webdriver.find_element_by_class_name(
                        'oc-dialog')

                    check_box_all_files = HtmlActions.webdriver_wait_presence_of_element_located(
                        modal_archivo_duplicado,
                        5,
                        xpath=
                        '//label[@for="checkbox-allnewfiles"][text()="Archivos Nuevos"]'
                    )

                    HtmlActions.click_html_element(
                        check_box_all_files,
                        xpath=
                        '//label[@for="checkbox-allnewfiles"][text()="Archivos Nuevos"]'
                    )

                    boton_continuar = HtmlActions.webdriver_wait_element_to_be_clickable(
                        modal_archivo_duplicado, class_name='continue')

                    HtmlActions.click_html_element(boton_continuar,
                                                   class_name='continue')

                    HtmlActions.webdriver_wait_until_not_presence_of_element_located(
                        webdriver, class_name='oc-dialog')
                    continue
                except ElementNotInteractableException:
                    continue
                except NoSuchElementException:
                    continue
                except TimeoutException:
                    continue
                except ElementClickInterceptedException:
                    continue

            # print('entrando al header')
            header = webdriver.find_elements_by_class_name('up-header')

            if len(header) > 0:
                mensaje_de_carga = header[0]
                mensaje_de_carga = mensaje_de_carga.find_elements_by_tag_name(
                    'span')

                if len(mensaje_de_carga) > 0:
                    mensaje_de_carga = mensaje_de_carga[0]

                    if 'Se ha cancelado la carga' in mensaje_de_carga.text \
                            or '1 Subida en pausa' in mensaje_de_carga.text:

                        numero_de_cancelaciones_de_descargas = numero_de_cancelaciones_de_descargas + 1
                        # print('numero de cancelaciones: {}'.format(numero_de_cancelaciones_de_descargas))
                        #
                        # print('se procede a dar clic en el boton de reupload')

                        try:

                            boton_reupload = HtmlActions.webdriver_wait_element_to_be_clickable(
                                webdriver, class_name='ResumeUploadOption')

                            HtmlActions.click_html_element(
                                boton_reupload,
                                class_name='ResumeUploadOption')
                            # print('se dio click')
                            tiempo_step_inicio = Temporizador.obtener_tiempo_timer(
                            )
                            time.sleep(1)

                            continue
                        except ElementNotInteractableException:
                            continue
                        except NoSuchElementException:
                            continue
                        except TimeoutException:
                            continue
                        except ElementClickInterceptedException:
                            continue

                    if numero_de_cancelaciones_de_descargas > 10:
                        se_cargo_correctamente_el_fichero = False
                        mensaje_exception = 'Ha sucedido un error durante la carga del archivo, se presenta el ' \
                                            'siguiente mensaje: {}'.format(mensaje_de_carga.text)
                        # # DEBUG
                        # path_debug_img = '/home/trjlha/scripts/ux/clarodrive/debug_screenshots/debug.png'
                        # webdriver.save_screenshot(path_debug_img)
                        break

        if se_cargo_correctamente_el_fichero:
            UtilsEvaluaciones.esperar_desaparicion_modal_exito(webdriver)
        else:
            raise TimeoutException(msg=mensaje_exception)

        # print('tiempo step inicio dentro de la funcion: {}'.format(tiempo_step_inicio))
        return tiempo_step_inicio