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 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 inicio_sesion_dropbox(webdriver_test_ux: WebDriver, json_eval, json_args,
                          url_login):
    tiempo_step_inicio = Temporizador.obtener_tiempo_timer()
    fecha_inicio = Temporizador.obtener_fecha_tiempo_actual()

    try:
        webdriver_test_ux.get(url_login)

        btn_inicio_sesion = WebDriverWait(webdriver_test_ux, 6).until(
            EC.element_to_be_clickable(
                (By.XPATH, '//button[@class="auth-google button-primary"]')))
        btn_inicio_sesion.click()

        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)

        input_correo_gmail = WebDriverWait(webdriver_test_ux, 6).until(
            EC.element_to_be_clickable((By.ID, 'Email')))
        input_correo_gmail.send_keys(json_args['user'])

        btn_next_gmail_sec_email = WebDriverWait(webdriver_test_ux, 6).until(
            EC.element_to_be_clickable((By.ID, 'next')))
        btn_next_gmail_sec_email.click()

        input_pass_gmail = WebDriverWait(webdriver_test_ux, 60).until(
            EC.presence_of_element_located((By.ID, 'password')))
        input_pass_gmail.send_keys(json_args['password'])

        btn_next_gmail_sec_password = WebDriverWait(
            webdriver_test_ux,
            6).until(EC.element_to_be_clickable((By.ID, 'submit')))
        btn_next_gmail_sec_password.click()

        # input_correo_gmail = WebDriverWait(webdriver_test_ux, 6).until(
        #     EC.element_to_be_clickable((By.ID, 'identifierId')))
        # input_correo_gmail.send_keys(json_args['user'])
        #
        # btn_next_gmail_sec_email = WebDriverWait(webdriver_test_ux, 6).until(
        #     EC.element_to_be_clickable((By.ID, 'identifierNext')))
        # btn_next_gmail_sec_email.click()
        #
        # input_pass_gmail = WebDriverWait(webdriver_test_ux, 60).until(
        #     EC.presence_of_element_located((By.NAME, 'password')))
        # input_pass_gmail.send_keys(json_args['password'])
        #
        # btn_next_gmail_sec_password = WebDriverWait(webdriver_test_ux, 6).until(
        #     EC.element_to_be_clickable((By.ID, 'passwordNext')))
        # btn_next_gmail_sec_password.click()

        webdriver_test_ux.switch_to.window(ventana_padre)

        WebDriverWait(webdriver_test_ux, 10).until(
            EC.element_to_be_clickable(
                (By.CLASS_NAME, 'maestro-nav__contents')))

        json_eval["steps"][0]["output"][0]["status"] = jsonConst.SUCCESS
        json_eval["steps"][0]["status"] = jsonConst.SUCCESS
        json_eval["steps"][0]["output"][0][
            "output"] = 'Se ingresa correctamente al portal Drop Box'

    except ElementNotInteractableException as e:
        json_eval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["output"][0][
            "output"] = 'fue imposible ingresar al portal Drop Box: {}'.format(
                e.msg)
    except NoSuchElementException as e:
        json_eval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["output"][0][
            "output"] = 'fue imposible ingresar al portal Drop Box: {}'.format(
                e.msg)
    except TimeoutException as e:
        json_eval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["output"][0][
            "output"] = 'fue imposible ingresar al portal Drop Box: {}'.format(
                e.msg)
    except ElementClickInterceptedException as e:
        json_eval["steps"][0]["output"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["status"] = jsonConst.FAILED
        json_eval["steps"][0]["output"][0][
            "output"] = 'fue imposible ingresar al portal Drop Box: {}'.format(
                e.msg)

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

    return json_eval