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
def ejecucion_validaciones_drop_box(webdriver, argumento_script_json):
    nombre_de_imagen_sin_extension = Path(
        argumento_script_json['pathImage']).stem
    nombre_de_imagen_con_extension = path.basename(
        argumento_script_json['pathImage'])
    config_constantes.NOMBRE_IMAGEN_POR_CARGAR_CON_EXTENSION = path.basename(
        argumento_script_json['pathImage'])
    archivo_config = FormatUtils.lector_archivo_ini()
    url_login = archivo_config.get('Dropbox_config', 'url_login')

    # establece los datetime de inicio para la prueba UX
    tiempo_inicial_ejecucion_prueba = Temporizador.obtener_tiempo_timer()
    fecha_prueba_inicial = Temporizador.obtener_fecha_tiempo_actual()

    # se genera el json de evaluacion
    json_evaluacion_drop_box = GeneradorJsonBaseEvaluacion.generar_nuevo_template_json(
    )

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.ingreso_pagina_principal_dropbox(
        webdriver, json_evaluacion_drop_box)

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.inicio_sesion_dropbox(
        webdriver, json_evaluacion_drop_box, argumento_script_json)

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.cargar_archivo_dropbox(
        webdriver, json_evaluacion_drop_box, argumento_script_json,
        nombre_de_imagen_sin_extension, nombre_de_imagen_con_extension)

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.descargar_archivo_dropbox(
        webdriver, json_evaluacion_drop_box, nombre_de_imagen_con_extension)

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.eliminar_archivo_dropbox(
        webdriver, json_evaluacion_drop_box, nombre_de_imagen_con_extension)

    json_evaluacion_drop_box = EvaluacionesDropBoxDriveSteps.cerrar_sesion_dropbox(
        webdriver, json_evaluacion_drop_box)

    tiempo_final_ejecucion_prueba = Temporizador.obtener_tiempo_timer(
    ) - tiempo_inicial_ejecucion_prueba
    fecha_prueba_final = Temporizador.obtener_fecha_tiempo_actual()

    json_evaluacion_drop_box['start'] = fecha_prueba_inicial
    json_evaluacion_drop_box['end'] = fecha_prueba_final
    json_evaluacion_drop_box['time'] = tiempo_final_ejecucion_prueba
    json_evaluacion_drop_box['status'] = verificacion_estatus_final(
        json_evaluacion_drop_box)

    json_padre = {}
    json_padre.update({'body': json_evaluacion_drop_box})

    time.sleep(2)

    webdriver.close()
    webdriver.quit()

    return json_padre
Beispiel #4
0
def ejecucion_validaciones_claro_drive(webdriver, argumento_script_json):
    """

    :param webdriver:
    :param argumento_script_json:
    :return:
    """
    nombre_de_imagen_sin_extension = Path(argumento_script_json['pathImage']).stem
    nombre_de_imagen_con_extension = path.basename(argumento_script_json['pathImage'])
    config_constantes.NOMBRE_IMAGEN_POR_CARGAR_CON_EXTENSION = path.basename(argumento_script_json['pathImage'])
    extension_de_la_imagen = path.splitext(nombre_de_imagen_con_extension)[1]

    # establece los datetime de inicio para la prueba UX
    tiempo_inicial_ejecucion_prueba = Temporizador.obtener_tiempo_timer()
    fecha_prueba_inicial = Temporizador.obtener_fecha_tiempo_actual()

    # se genera el json de evaluacion
    json_evaluacion_claro_drive = GeneradorJsonBaseEvaluacion.generar_nuevo_template_json()

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.ingreso_pagina_principal_claro_drive(
        webdriver, json_evaluacion_claro_drive)

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.inicio_sesion_claro_drive(
        webdriver, json_evaluacion_claro_drive, argumento_script_json)

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.carga_archivo_claro_drive(
        webdriver, argumento_script_json['pathImage'], json_evaluacion_claro_drive)

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.descarga_archivo_claro_drive(
        webdriver, nombre_de_imagen_sin_extension, json_evaluacion_claro_drive, extension_de_la_imagen)

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.borrar_archivo_claro_drive(
        webdriver, json_evaluacion_claro_drive, nombre_de_imagen_sin_extension, extension_de_la_imagen)

    json_evaluacion_claro_drive = EvaluacionesClaroDriveSteps.cerrar_sesion_claro_drive(
        webdriver, json_evaluacion_claro_drive)

    tiempo_final_ejecucion_prueba = Temporizador.obtener_tiempo_timer() - tiempo_inicial_ejecucion_prueba
    fecha_prueba_final = Temporizador.obtener_fecha_tiempo_actual()

    json_evaluacion_claro_drive['start'] = fecha_prueba_inicial
    json_evaluacion_claro_drive['end'] = fecha_prueba_final
    json_evaluacion_claro_drive['time'] = tiempo_final_ejecucion_prueba
    json_evaluacion_claro_drive['status'] = verificacion_estatus_final(json_evaluacion_claro_drive)

    json_padre = {}
    json_padre.update({'body': json_evaluacion_claro_drive})

    time.sleep(2)

    webdriver.close()
    webdriver.quit()

    return json_padre
def carga_archivo_claro_drive(webdriver_test_ux: webdriver,
                              path_archivo_carga: str,
                              nombre_archivo_sin_ext: str, jsonEval):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        btn_crear = webdriver_test_ux.find_element_by_class_name(
            'button-create-resource')
        btn_crear.click()
        time.sleep(10)

        WebDriverWait(webdriver_test_ux, 20).until(
            EC.presence_of_element_located((By.ID, 'file_upload_start')))

        input_file = webdriver_test_ux.find_element_by_id('file_upload_start')

        time.sleep(4)
        input_file.send_keys(path_archivo_carga)

        WebDriverWait(webdriver_test_ux, 720).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//span[@class="name-without-extension"][text()="{} "]'.
                 format(nombre_archivo_sin_ext))))

        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][1]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][1]["output"][0][
            "output"] = 'Se realiza correctamente la carga del archivo'

    except selExcep.NoSuchElementException:
        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["output"][0][
            "output"] = 'No fue posible realizar la carga del archivo'

    except selExcep.ElementClickInterceptedException:
        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["output"][0][
            "output"] = 'No fue posible realizar la carga del archivo'

    tiempo_step_final = Temporizador.obtener_tiempo_timer(
    ) - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][1]["time"] = FormatUtils.truncar_float_cadena(
        tiempo_step_final)
    jsonEval["steps"][1]["start"] = fecha_inicio
    jsonEval["steps"][1]["end"] = fecha_fin

    return jsonEval
    def verificar_elemento_html_hasta_no_existir_en_el_dom_html(
            web_driver: WebDriver,
            time=5,
            id=None,
            xpath=None,
            link_text=None,
            partial_link_text=None,
            name=None,
            tag_name=None,
            class_name=None,
            css_selector=None):

        msg_selector_html_a_localizar = HtmlActions.generar_identificador_excepcion(
            id, xpath, link_text, partial_link_text, name, tag_name,
            class_name, css_selector)

        tiempo_inicial = Temporizador.obtener_tiempo_timer()

        while True:
            try:
                if id is not None:
                    web_driver.find_element_by_id(id)
                elif xpath is not None:
                    web_driver.find_element_by_xpath(xpath)
                elif link_text is not None:
                    web_driver.find_element_by_link_text(link_text)
                elif partial_link_text is not None:
                    web_driver.find_element_by_partial_link_text(
                        partial_link_text)
                elif name is not None:
                    web_driver.find_element_by_name(name)
                elif tag_name is not None:
                    web_driver.find_element_by_tag_name(tag_name)
                elif class_name is not None:
                    web_driver.find_element_by_class_name(class_name)
                elif css_selector is not None:
                    web_driver.find_element_by_css_selector(css_selector)

                segundos_transcurridos = Temporizador.obtener_tiempo_timer(
                ) - tiempo_inicial

                if segundos_transcurridos > time:
                    e = TimeoutException()
                    e.msg = webdriver_actions_constantes.WEBDRIVER_WAIT_UNTIL_NOT_TIMEOUT_EXCEPTION.format(
                        time, msg_selector_html_a_localizar, e.msg)

                    raise e
                else:
                    pass

            except NoSuchElementException:
                break
Beispiel #7
0
    def esperar_desaparicion_modal_exito(webdriver: WebDriver,
                                         tiempo_de_espera: int = 10):
        tiempo_de_inicio = Temporizador.obtener_tiempo_timer()
        tiempo_transcurrido = 0

        while tiempo_transcurrido < tiempo_de_espera:
            tiempo_transcurrido = Temporizador.obtener_tiempo_timer(
            ) - tiempo_de_inicio
            modal_de_exito = webdriver.find_elements_by_xpath(
                '//div[@class="row type-success"]')

            if len(modal_de_exito) == 0:
                break
def carga_archivo_claro_drive(webdriver_test_ux: webdriver, path_archivo_carga: str, nombre_archivo_sin_ext: str,
                              jsonEval):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        carpeta_folder = WebDriverWait(webdriver_test_ux, 20).until(
            EC.element_to_be_clickable((By.XPATH, '//span[text()="Folder "][@class="name-without-extension"]')))
        carpeta_folder.click()

        WebDriverWait(webdriver_test_ux, 10).until(
            EC.element_to_be_clickable((By.XPATH, '//span[text()=" Folder "][@class="last"]')))

        input_file = WebDriverWait(webdriver_test_ux, 10).until(
            EC.presence_of_element_located((By.ID, 'file_upload_start')))

        input_file.send_keys(path_archivo_carga)

        ValidacionesHtml.verificar_ventana_archivo_duplicado(webdriver_test_ux)

        WebDriverWait(webdriver_test_ux, 720).until(EC.presence_of_element_located(
            (By.XPATH, '//span[@class="name-without-extension"][text()="{} "]'.format(nombre_archivo_sin_ext))))

        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][1]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][1]["output"][0]["output"] = 'Se realiza correctamente la carga del archivo'

    except NoSuchElementException:
        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["output"][0]["output"] = 'No fue posible realizar la carga del archivo'

    except ElementClickInterceptedException:
        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["output"][0]["output"] = 'No fue posible realizar la carga del archivo'

    except TimeoutException:
        jsonEval["steps"][1]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["status"] = jsonConst.FAILED
        jsonEval["steps"][1]["output"][0]["output"] = 'No fue posible realizar la carga del archivo'

    tiempo_step_final = Temporizador.obtener_tiempo_timer() - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][1]["time"] = FormatUtils.truncar_float_cadena(tiempo_step_final)
    jsonEval["steps"][1]["start"] = fecha_inicio
    jsonEval["steps"][1]["end"] = fecha_fin

    return jsonEval
Beispiel #9
0
    def finalizar_tiempos_en_step(json_eval, indice: int, tiempo_step_inicio,
                                  fecha_inicio):

        if tiempo_step_inicio is None:
            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

        tiempo_step_final = Temporizador.obtener_tiempo_timer(
        ) - tiempo_step_inicio
        fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
        json_eval["steps"][indice]["time"] = FormatUtils.truncar_float_cadena(
            tiempo_step_final)
        json_eval["steps"][indice]["start"] = fecha_inicio
        json_eval["steps"][indice]["end"] = fecha_fin

        return json_eval
def inicio_sesion_claro_drive(webdriver_test_ux: webdriver, jsonEval, jsonArgs):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        webdriver_test_ux.get('https://www.clarodrive.com/')
        btn_inicio_sesion = WebDriverWait(webdriver_test_ux, 6).until(EC.presence_of_element_located((By.ID, 'login')))
        btn_inicio_sesion.click()

        input_email = WebDriverWait(webdriver_test_ux, 6).until(
            EC.presence_of_element_located((By.CLASS_NAME, 'InputEmail')))
        input_email.send_keys(jsonArgs['user'])

        input_password = WebDriverWait(webdriver_test_ux, 6).until(
            EC.presence_of_element_located((By.CLASS_NAME, 'InputPassword')))
        input_password.send_keys(jsonArgs['password'])

        btn_ingreso_cuenta = WebDriverWait(webdriver_test_ux, 6).until(
            EC.presence_of_element_located((By.XPATH, '//button[text()="INICIAR SESI\u00D3N"]')))
        btn_ingreso_cuenta.click()

        WebDriverWait(webdriver_test_ux, 120).until(
            EC.element_to_be_clickable((By.XPATH, '//span[text()="Folder "][@class="name-without-extension"]')))

        jsonEval["steps"][0]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][0]["output"][0]["output"] = 'Se ingresa correctamente al portal Claro Drive'

    except ElementNotInteractableException as e:
        jsonEval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["output"][0]["output"] = 'fue imposible ingresar al portal Claro Drive'
    except NoSuchElementException as e:
        jsonEval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["output"][0]["output"] = 'fue imposible ingresar al portal Claro Drive'
    except TimeoutException as e:
        jsonEval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][0]["output"][0]["output"] = 'fue imposible ingresar al portal Claro Drive'

    tiempo_step_final = Temporizador.obtener_tiempo_timer() - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][0]["time"] = FormatUtils.truncar_float_cadena(tiempo_step_final)
    jsonEval["steps"][0]["start"] = fecha_inicio
    jsonEval["steps"][0]["end"] = fecha_fin

    return jsonEval
Beispiel #11
0
    def esperar_carga_total_de_archivo(webdriver: WebDriver,
                                       tiempo_de_espera: int = 720):
        tiempo_de_inicio = Temporizador.obtener_tiempo_timer()
        tiempo_transcurrido = 0
        se_cargo_correctamente_el_fichero = False

        while tiempo_transcurrido < tiempo_de_espera:
            tiempo_transcurrido = Temporizador.obtener_tiempo_timer(
            ) - tiempo_de_inicio
            modal_de_exito = webdriver.find_elements_by_xpath(
                '//div[@class="up-file-actions isDone"]')

            if len(modal_de_exito) == 1:
                se_cargo_correctamente_el_fichero = True
                break

            span_texto_subida_de_archivo = webdriver.find_elements_by_xpath(
                '//span[text()="Se ha cancelado la carga"]')

            if len(span_texto_subida_de_archivo) > 0:
                lista_mensajes_error_carga_archivo = webdriver.find_elements_by_xpath(
                    '//span[@class="ng-tns-c3-0"][text()="Error en la carga"]')

                if len(lista_mensajes_error_carga_archivo) > 0:
                    div_botones_actions = webdriver.find_elements_by_class_name(
                        'up-file-actions')

                    if len(div_botones_actions) > 0:
                        lista_botones_action = div_botones_actions[
                            0].find_elements_by_tag_name('app-svg-icon')

                        if len(lista_botones_action) > 0:
                            boton_reintentar_carga_archivo = lista_botones_action[
                                0]

                            try:
                                boton_reintentar_carga_archivo.click()
                            except ElementClickInterceptedException:
                                pass

        if se_cargo_correctamente_el_fichero:
            UtilsEvaluaciones.esperar_desaparicion_modal_exito(webdriver)
        else:
            raise TimeoutException(
                msg=
                'Han transcurrido mas de 12 minutos, sin cargar correctamente el archivo '
                'dentro del portal de Claro Drive')
def borrar_archivo_claro_drive(webdriver_test_ux: webdriver, jsonEval, nombre_archivo_sin_ext: str, ext_archivo: str):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:

        webdriver_test_ux.refresh()

        archivo_por_eliminar = WebDriverWait(webdriver_test_ux, 20).until(
            EC.element_to_be_clickable(
                (By.XPATH, '//span[@class="name-without-extension"][text()="{} "]'.format(nombre_archivo_sin_ext))))

        archivo_por_eliminar.click()

        btn_borrar = WebDriverWait(webdriver_test_ux, 20).until(EC.element_to_be_clickable(
            (By.XPATH, '//input[@type="button"][@class="menuItem svg deleteImage icon-delete icon-32"]')))

        btn_borrar.click()

        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][3]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][3]["output"][0]["output"] = 'Se realiza el borrado del archivo correctamente'
    except NoSuchElementException as e:
        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["output"][0][
            "output"] = 'No fue posible realizar el borrado del archivo correctamente: {}'.format(e.msg)

    except ElementClickInterceptedException as e:
        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["output"][0][
            "output"] = 'No fue posible realizar el borrado del archivo correctamente: {}'.format(e.msg)

    except TimeoutException as e:
        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["output"][0][
            "output"] = 'No fue posible realizar el borrado del archivo correctamente: {}'.format(e.msg)

    tiempo_step_final = Temporizador.obtener_tiempo_timer() - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][3]["time"] = FormatUtils.truncar_float_cadena(tiempo_step_final)
    jsonEval["steps"][3]["start"] = fecha_inicio
    jsonEval["steps"][3]["end"] = fecha_fin

    return jsonEval
def cerrar_sesion_claro_drive(webdriver_test_ux: webdriver, jsonEval):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        webdriver_test_ux.refresh()
        boton_ajustes = WebDriverWait(webdriver_test_ux, 10).until(EC.element_to_be_clickable((By.ID, 'expand')))
        boton_ajustes.click()

        boton_cerrar_sesion = WebDriverWait(webdriver_test_ux, 20).until(
            EC.element_to_be_clickable((By.XPATH, '//li[@data-id="logout"]/a')))

        boton_cerrar_sesion.click()
        WebDriverWait(webdriver_test_ux, 10).until(EC.presence_of_element_located((By.ID, 'login')))

        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][4]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][4]["output"][0]["output"] = 'Se cierra sesion correctamente'

    except NoSuchElementException as e:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0]["output"] = 'No fue posible realizar el cierre de sesion: {}'.format(e.msg)

    except ElementClickInterceptedException as e:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0]["output"] = 'No fue posible realizar el cierre de sesion: {}'.format(e.msg)

    except TimeoutException as e:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0]["output"] = 'No fue posible realizar el cierre de sesion: {}'.format(e.msg)

    except ElementNotInteractableException as e:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0]["output"] = 'No fue posible realizar el cierre de sesion: {}'.format(e.msg)

    tiempo_step_final = Temporizador.obtener_tiempo_timer() - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][4]["time"] = FormatUtils.truncar_float_cadena(tiempo_step_final)
    jsonEval["steps"][4]["start"] = fecha_inicio
    jsonEval["steps"][4]["end"] = fecha_fin

    return jsonEval
    def esperar_aparicion_modal_de_exito(webdriver: WebDriver,
                                         tiempo_de_espera: int = 10):

        tiempo_de_inicio = Temporizador.obtener_tiempo_timer()
        tiempo_transcurrido = 0

        while tiempo_transcurrido < tiempo_de_espera:
            tiempo_transcurrido = Temporizador.obtener_tiempo_timer(
            ) - tiempo_de_inicio
            modal_de_exito = webdriver.find_elements_by_xpath(
                '//div[@class="row type-success"]')

            if len(modal_de_exito) == 1:

                modal = modal_de_exito[0]

                if modal.is_displayed() and modal.is_enabled():
                    break
def descarga_archivo_claro_drive(webdriver_test_ux: webdriver,
                                 nombre_archivo_sin_ext: str, jsonEval):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        time.sleep(5)
        img_por_descargar = webdriver_test_ux.find_element_by_xpath(
            '//span[@class="name-without-extension"][text()="{} "]'.format(
                nombre_archivo_sin_ext))
        img_por_descargar.click()
        time.sleep(4)

        btn_descarga = webdriver_test_ux.find_element_by_xpath(
            '//input[@class="menuItem svg downloadImage icon-download icon-32"]'
        )
        btn_descarga.click()
        time.sleep(4)

        jsonEval["steps"][2]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][2]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][2]["output"][0][
            "output"] = 'Se realiza la descarga del archivo correctamente'
    except selExcep.NoSuchElementException:
        jsonEval["steps"][2]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][2]["status"] = jsonConst.FAILED
        jsonEval["steps"][2]["output"][0][
            "output"] = 'No fue posible realizar la descarga del archivo correctamente'
    except selExcep.ElementClickInterceptedException:
        jsonEval["steps"][2]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][2]["status"] = jsonConst.FAILED
        jsonEval["steps"][2]["output"][0][
            "output"] = 'No fue posible realizar la descarga del archivo correctamente'

    tiempo_step_final = Temporizador.obtener_tiempo_timer(
    ) - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][2]["time"] = FormatUtils.truncar_float_cadena(
        tiempo_step_final)
    jsonEval["steps"][2]["start"] = fecha_inicio
    jsonEval["steps"][2]["end"] = fecha_fin

    return jsonEval
Beispiel #16
0
    def verificar_descarga_en_ejecucion(nombre_del_archivo,
                                        extension_del_archivo):
        tiempo_inicio = Temporizador.obtener_tiempo_timer()
        se_descargo_el_archivo_exitosamente = False
        archivo_a_localizar = '{}{}'.format(nombre_del_archivo,
                                            extension_del_archivo)

        while (Temporizador.obtener_tiempo_timer() - tiempo_inicio) < 180:
            lista_archivos = UtilsMain.obtener_lista_ficheros_en_directorio(
                config_constantes.PATH_CARPETA_DESCARGA)

            if archivo_a_localizar in lista_archivos:
                se_descargo_el_archivo_exitosamente = True
                break

        if not se_descargo_el_archivo_exitosamente:
            raise TimeoutException(
                msg=
                'Han transcurrido 3 minutos sin finalizar la descarga del archivo {} desde '
                'el portal Claro Drive'.format(archivo_a_localizar))
Beispiel #17
0
    def generar_json_inicio_de_sesion_incorrecta(json_eval, tiempo_step_inicio,
                                                 fecha_inicio, indice: int,
                                                 msg_output: str):

        if tiempo_step_inicio is None:
            tiempo_step_inicio = Temporizador.obtener_tiempo_timer()

        json_eval["steps"][indice]["output"][0]["status"] = json_const.FAILED
        json_eval["steps"][indice]["status"] = json_const.FAILED
        json_eval["steps"][indice]["output"][0]["output"] = msg_output

        tiempo_step_final = Temporizador.obtener_tiempo_timer(
        ) - tiempo_step_inicio
        fecha_fin = Temporizador.obtener_fecha_tiempo_actual()

        json_eval["steps"][indice]["time"] = FormatUtils.truncar_float_cadena(
            tiempo_step_final)
        json_eval["steps"][indice]["start"] = fecha_inicio
        json_eval["steps"][indice]["end"] = fecha_fin

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

    try:
        boton_ajustes = webdriver_test_ux.find_element_by_id('expand')
        boton_ajustes.click()

        time.sleep(4)
        boton_cerrar_sesion = webdriver_test_ux.find_element_by_xpath(
            '//li[@data-id="logout"]')
        boton_cerrar_sesion.click()
        time.sleep(10)

        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][4]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][4]["output"][0][
            "output"] = 'Se cierra sesion correctamente'

    except selExcep.NoSuchElementException:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0][
            "output"] = 'No fue posible realizar el cierre de sesion'

    except selExcep.ElementClickInterceptedException:
        jsonEval["steps"][4]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["status"] = jsonConst.FAILED
        jsonEval["steps"][4]["output"][0][
            "output"] = 'No fue posible realizar el cierre de sesion'

    tiempo_step_final = Temporizador.obtener_tiempo_timer(
    ) - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][4]["time"] = FormatUtils.truncar_float_cadena(
        tiempo_step_final)
    jsonEval["steps"][4]["start"] = fecha_inicio
    jsonEval["steps"][4]["end"] = fecha_fin

    return jsonEval
def borrar_archivo_claro_drive(webdriver_test_ux: webdriver, jsonEval):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        btn_borrar = webdriver_test_ux.find_element_by_xpath(
            '//input[@class="menuItem svg deleteImage icon-delete icon-32"]')
        btn_borrar.click()
        time.sleep(10)
        btn_cerrar = webdriver_test_ux.find_element_by_xpath(
            '//input[@class="svg exit icon-close icon-32"]')
        time.sleep(4)
        btn_cerrar.click()
        time.sleep(4)

        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][3]["status"] = jsonConst.SUCCESS
        jsonEval["steps"][3]["output"][0][
            "output"] = 'Se realiza el borrado del archivo correctamente'
    except selExcep.NoSuchElementException:
        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["output"][0][
            "output"] = 'No fue posibles realizar el borrado del archivo correctamente'

    except selExcep.ElementClickInterceptedException:
        jsonEval["steps"][3]["output"][0]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["status"] = jsonConst.FAILED
        jsonEval["steps"][3]["output"][0][
            "output"] = 'No fue posibles realizar el borrado del archivo correctamente'

    tiempo_step_final = Temporizador.obtener_tiempo_timer(
    ) - tiempo_step_inicio
    fecha_fin = Temporizador.obtener_fecha_tiempo_actual()
    jsonEval["steps"][3]["time"] = FormatUtils.truncar_float_cadena(
        tiempo_step_final)
    jsonEval["steps"][3]["start"] = fecha_inicio
    jsonEval["steps"][3]["end"] = fecha_fin

    return jsonEval
    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 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 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 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 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 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 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 main():

    file_config = FormatUtils.lector_archivo_ini()

    path_web_driver = file_config.get('Driver', 'ruta')
    web_driver_por_usar = file_config.get('Driver', 'driverPorUtilizar')

    tiempo_inicial_ejecucion_prueba = Temporizador.obtener_tiempo_timer()
    fecha_prueba_inicial = Temporizador.obtener_fecha_tiempo_actual()

    # verifica que el usuario haya establecido el path de la imagen a subir
    args = sys.argv[1:]

    if len(args) == 0:
        print('Favor de establecer el parametro json')
        sys.exit()

    json_args = args[0]

    if not FormatUtils.cadena_a_json_valido(json_args):
        sys.exit()
    else:
        json_args = json.loads(json_args)

    if not FormatUtils.verificar_keys_json(json_args):
        sys.exit()

    if not path.exists(json_args['pathImage']):
        print(
            'La imagen/archivo por cargar no existe o no se localiza, favor de corregir el path del archivo'
        )
        sys.exit()
    elif not path.isfile(json_args['pathImage']):
        print(
            'La ruta establecida no corresponde a un archivo o imagen valido, favor de corregir el path del archivo'
        )
        sys.exit()

    nombre_archivo_imagen_sin_ext = Path(json_args['pathImage']).stem

    # se establece el navegador (por defecto firefox)
    webdriver_config = ConfiguracionWebDriver(path_web_driver,
                                              web_driver_por_usar)
    webdriver_ux_test = webdriver_config.configurar_obtencion_web_driver()

    # se genera el json de evaluacion
    json_evaluacion_claro_drive = GeneradorJsonBaseEvaluacion.generar_nuevo_template_json(
    )

    json_evaluacion_claro_drive = inicio_sesion_claro_drive(
        webdriver_ux_test, json_evaluacion_claro_drive, json_args)

    json_evaluacion_claro_drive = carga_archivo_claro_drive(
        webdriver_ux_test, json_args['pathImage'],
        nombre_archivo_imagen_sin_ext, json_evaluacion_claro_drive)

    json_evaluacion_claro_drive = descarga_archivo_claro_drive(
        webdriver_ux_test, nombre_archivo_imagen_sin_ext,
        json_evaluacion_claro_drive)
    json_evaluacion_claro_drive = borrar_archivo_claro_drive(
        webdriver_ux_test, json_evaluacion_claro_drive)

    json_evaluacion_claro_drive = cerrar_sesion_claro_drive(
        webdriver_ux_test, json_evaluacion_claro_drive)

    tiempo_final_ejecucion_prueba = Temporizador.obtener_tiempo_timer(
    ) - tiempo_inicial_ejecucion_prueba
    fecha_prueba_final = Temporizador.obtener_fecha_tiempo_actual()

    json_evaluacion_claro_drive['start'] = fecha_prueba_inicial
    json_evaluacion_claro_drive['end'] = fecha_prueba_final
    json_evaluacion_claro_drive['time'] = tiempo_final_ejecucion_prueba
    json_evaluacion_claro_drive['status'] = verificacion_estatus_final(
        json_evaluacion_claro_drive)

    #json_evaluacion_claro_drive = GeneradorJsonBaseEvaluacion. \
    #    establecer_estructura_principal_json(json_args['user'], json_evaluacion_claro_drive)

    time.sleep(2)

    webdriver_ux_test.close()
    webdriver_ux_test.quit()

    print(json.dumps(json_evaluacion_claro_drive))