def test_003(self): # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "spotify_registro") # ACCEDER A LAS KEYS (ENTIDADES) DEL JSON #Selenium.get_entity(self, "Titulo") assert "No coinciden", Selenium.get_text( self, "Titulo") == Registro.tituloPagina # assert "No coinciden", Selenium.get_elements(self, "Titulo").text == Registro.tituloPagina # Selenium.get_text(self, "Titulo") == Registro.tituloPagina Selenium.esperar_elemento(self, "Email") Selenium.esperar_elemento(self, "emailConfirm") Selenium.get_elements(self, "Email").send_keys(Registro.emailUsuario) Selenium.get_elements(self, "emailConfirm").send_keys( Registro.emailUsuarioConfirm) Selenium.get_elements(self, "Password").send_keys(Registro.passwordUsuario) Selenium.get_elements(self, "Perfil").send_keys(Registro.aliasUsuario) Selenium.get_select_element( self, "Mes de nacimiento").select_by_visible_text("Enero") time.sleep(5)
def test_004(self): #cARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "Spotify_registro") #ACCEDER A LAS KEYS (ENTIDADES) DEL JSON Selenium.get_entity(self, "Logo") assert Selenium.get_text( self, "Titulo") == "Regístrate con tu dirección de email" Selenium.esperar_elemento(self, "Email") Selenium.get_elements(self, "Email").send_keys("*****@*****.**") Selenium.esperar_elemento(self, "Email Confirmacion") Selenium.get_elements( self, "Email Confirmacion").send_keys("*****@*****.**") Selenium.get_elements(self, "Pass").send_keys("skajdfhlksdjfhdsjfajskd") Selenium.get_elements(self, "Nombre").send_keys("Mervin Díaz") Selenium.get_select_elements( self, "Mes de Nacimiento").select_by_visible_text("enero") time.sleep(5)
def setUp(self): Selenium.abrir_navegador( self, URL= "https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert" ) Selenium.get_json_file(self, "frames")
def test_002(self): #cargar el JSON con los valores de los ID de la APP Selenium.get_json_file(self, "Spotify") #Acceder a las keys (entidades) del JSON Selenium.get_entity(self, "lbl_titulo") assert Selenium.get_elements( self, "lbl_titulo").text == "Regístrate gratis para escuchar" Selenium.esperar_elemento(self, "txt_correo") Selenium.get_elements(self, "txt_correo").send_keys("*****@*****.**") Selenium.get_elements( self, "txt_confirmarcorre").send_keys("*****@*****.**") Selenium.get_elements(self, "txt_contrasena").send_keys("ul33333") Selenium.get_select_elements(self, "dpd_mes").select_by_value('10') Selenium.get_elements(self, "btn_registrate").click() time.sleep(5)
def test_005(self): Selenium.get_json_file(self, "Amazon") Selenium.scroll_to(self, "lnk_trabaja_amazon") Selenium.esperar(5) Selenium.js_clic(self, "lnk_trabaja_amazon")
def test_006(self): # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "Amazon") Selenium.scroll_to(self, "Liga Amazon") Selenium.esperar(5) Selenium.js_clic(self, "Liga Amazon") Selenium.page_has_loaded(self) Selenium.esperar(5)
def setUp(self): with allure.step(u'Paso 1: Ingresar a Google'): Selenium.pyodbc_query(self, "SELECT * FROM BD_SDFT_INS_WEB.PORTAFOLIO") print("Se obtienen los portafolios.") Selenium.abrir_navegador(self, "https://www.google.com/") # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "Google")
def test_007(self): # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "frames") Selenium.switch_to_iframe(self, "Frame4 Alerta") Selenium.get_elements(self, "Alerta").click() Selenium.esperar(5) Selenium.alert_windows(self, "accept") Selenium.esperar(5)
def test_007(self): Selenium.get_json_file(self, "alphasig") Selenium.send_key_text(self, "txt_USUARIO", "alpha") Selenium.send_especific_keys(self,"txt_USUARIO", "Tab") Selenium.send_key_text(self, "txt_CLAVE", "homero") Selenium.send_especific_keys(self,"txt_CLAVE", "Enter") Selenium.esperar(5)
def test_008(self): Selenium.get_json_file(self, "Spotify") Selenium.send_key_text(self, "txt_correo", "*****@*****.**") Selenium.send_especific_keys(self, "txt_correo", "Tab") Selenium.assert_text( self, "lbl_errorcorreo", "Este correo electrónico ya está conectado a una cuenta. Inicia sesión." ) Selenium.esperar(5)
def test_004(self): #cargar el JSON con los valores de los ID de la APP Selenium.get_json_file(self, "iframe") Selenium.new_window( self, "https://www.mercadolibre.com.co/gz/home/navigation#nav-header") Selenium.switch_to_windows_name(self, "Historial") Selenium.switch_to_windows_name(self, "Principal") time.sleep(10)
def test_004(self): #cARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "frames") Selenium.switch_to_iframe(self, "Frame2") Selenium.select_by_text(self, "Frame2 Select", "Avatar") Selenium.switch_to_parentFrame(self) Selenium.switch_to_iframe(self, "Frame1") Selenium.send_key_text(self, "Frame1 input", "Hola Chicos de Udemy") Selenium.switch_to_iframe(self, "Frame3") Selenium.get_elements(self, "Frame3 input").click() time.sleep(5)
def test_011(self): Selenium.get_json_file(self, "Spotify") Selenium.save_variable_scenary(self, "lbl_titulo", "Titulo")#obtengo el valor del elemento lbl_titulo y lo guardo en el directorio Selenium.new_window(self, "https://www.spotify.com/co/signup/")#ABRIR UNA NUEVA VENTANA Selenium.get_json_file(self, "Spotify")#TRAER EL JSON DE GOOGLE Selenium.switch_to_windows_name(self, "spotify")# ME UBICO EN LA VENTANA DE GOOGLE Selenium.compare_with_variable_scenary(self, "lbl_titulo", "Titulo") Selenium.esperar(5)
def test_006(self): Selenium.get_json_file(self, "helpdesk") Selenium.send_key_text(self, "txt_agente", "alpha") Selenium.send_key_text(self, "txt_contrasena", "alaaa") Selenium.get_elements(self, "btn_aceptar").click() Selenium.esperar(4) Selenium.alert_windows(self, "accept") Selenium.esperar(5)
def test_012(self): Selenium.save_variable_scenary(self, "Already", "Already") Selenium.save_variable_scenary(self, "Titulo", "Titulo") Selenium.new_window(self, "https://www.google.com/") Selenium.get_json_file(self, "Google") Selenium.switch_to_windows_name(self, "Google") texto = Selenium.get_variable_scenary(self, "Already") Selenium.get_elements(self, "txt_busqueda").send_keys(texto) Selenium.esperar(self, 10)
def test_009(self): Selenium.get_json_file(self, "Spotify") Selenium.get_elements( self, "txt_correo").send_keys("*****@*****.**") Selenium.send_especific_keys(self, "txt_correo", "Tab") verificar = Selenium.check_element(self, "lbl_errorcorreo") if verificar == True: #Selenium.get_elements(self, "txt_correo").clear() Selenium.send_key_text(self, "txt_correo", "*****@*****.**") Selenium.send_especific_keys(self, "txt_correo", "Tab") #unittest.TestCase.skipTest(self, "El email ya existe") Selenium.esperar(5)
def test_010(self): Selenium.get_json_file(self, "Spotify") Selenium.save_variable_scenary( self, "lbl_titulo", "Titulo" ) #obtengo el valor del elemento lbl_titulo y lo guardo en el directorio Selenium.new_window( self, "https://www.google.com/?hl=es") #ABRIR UNA NUEVA VENTANA Selenium.get_json_file(self, "google") #TRAER EL JSON DE GOOGLE Selenium.switch_to_windows_name( self, "google") # ME UBICO EN LA VENTANA DE GOOGLE texto = Selenium.get_variable_scenary(self, "Titulo") Selenium.send_key_text(self, "txt_buscar", texto) Selenium.esperar(5)
def test_003(self): #cargar el JSON con los valores de los ID de la APP Selenium.get_json_file(self, "iframe") Selenium.switch_to_iframe(self, "fra_frame2") Selenium.select_by_text(self, "dpd_animales", "Avatar") Selenium.switch_to_parentFrame(self) Selenium.switch_to_iframe(self, "fra_frame1") Selenium.send_key_text(self, "txt_topic", "Hola soy Luisa") Selenium.switch_to_iframe(self, "fra_frame3") Selenium.get_elements(self, "chk_options").click() time.sleep(10)
def test_004(self): # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "frames") # -------------------- IR A FRAME 2 -------------------- Selenium.switch_to_iframe(self, "Frame2") Selenium.select_by_text(self, "Frame2 Select", "Avatar") time.sleep(5) # -------------------- VOLVER AL FRAME PRINCIPAL -------------------- Selenium.switch_to_parentFrame(self) # -------------------- IR A FRAME 1 -------------------- Selenium.switch_to_iframe(self, "Frame1") Selenium.send_key_text(self, "Frame1 Input", "Hola Chicos Udemy") time.sleep(5) # -------------------- IR A FRAME 3 -------------------- Selenium.switch_to_iframe(self, "Frame3") Selenium.get_elements(self, "Frame3 Input").click()
def test_011(self): assert "No coinciden", Selenium.get_text( self, "Titulo") == Registro.tituloPagina # assert "No coinciden", Selenium.get_elements(self, "Titulo").text == Registro.tituloPagina # Selenium.get_text(self, "Titulo") == Registro.tituloPagina Selenium.save_variable_scenary(self, "verifica_cuenta", "verifica_cuenta") Selenium.save_variable_scenary(self, "Titulo", "Titulo") Selenium.new_window(self, "https://www.google.com/") Selenium.get_json_file(self, "Google") Selenium.switch_to_windows_name(self, "Google") texto = Selenium.get_variable_scenary(self, "verifica_cuenta") Selenium.get_elements(self, "txt_busqueda").send_keys(texto) Selenium.esperar(self, 10) time.sleep(3)
def test_014(self): with allure.step(u'Paso 2: pasarse a la ventana de google'): Selenium.save_variable_scenary(self, "lbl_titulo", "Titulo")#obtengo el valor del elemento lbl_titulo y lo guardo en el directorio Selenium.new_window(self, "https://www.google.com/?hl=es")#ABRIR UNA NUEVA VENTANA Selenium.get_json_file(self, "google")#TRAER EL JSON DE GOOGLE Selenium.switch_to_windows_name(self, "google")# ME UBICO EN LA VENTANA DE GOOGLE Selenium.esperar(5) with allure.step(u'Paso 3: Recuperar datos del excel'): #RECUPERAR DATOS DESD EXCEL. NOMBRE = Selenium.leer_celda(self, "A1") Selenium.create_variable_scenary(self, "nombre", NOMBRE) Selenium.create_variable_scenary(self, "apellido", Selenium.leer_celda(self, "B1")) Selenium.create_variable_scenary(self, "cedula", Selenium.leer_celda(self, "C1")) texto = Selenium.get_variable_scenary(self, "nombre") Selenium.send_key_text(self, "txt_buscar", texto) Selenium.esperar(5)
def setUp(self): with allure.step(u'PASO 1: Ingresar a Google'): Selenium.abrir_navegador(self, "https://www.google.com/") Selenium.get_json_file(self, "Google")
def setUp(self): Selenium.abrir_navegador(self) Selenium.get_json_file(self, "Spotify_registro")
def setUp(self): with allure.step(u'Paso 1: Ingresar a la pagina de spotify'): Selenium.abrir_navegador(self, "https://www.spotify.com/co/signup/") Selenium.get_json_file(self, "Spotify")
def setUp(self): with allure.step(u'Paso 1: Ingresar a Google'): Selenium.abrir_navegador(self, "https://www.google.com/") # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "Google")
def setUp(self): Selenium.abrir_navegador(self, "https://www.google.com/?hl=es") Selenium.get_json_file(self, "google")
def setUp(self): Selenium.abrir_navegador(self) # CARGAR EL JSON CON LOS VALORES DE LOS ID DE LA APP Selenium.get_json_file(self, "spotify_registro")
def setUp(self): Selenium.abrir_navegador(self, URL="https://www.google.com/") Selenium.get_json_file(self, "Google")
def setUp(self): Selenium.abrir_navegador(self, "https://www.spotify.com/co/signup/") Selenium.get_json_file(self, "Spotify")
def setUp(self): self.CURSOR = Selenium.pyodbc_query(self, "SELECT * FROM usuarios") Selenium.abrir_navegador(self, "https://www.google.com/?hl=es") Selenium.get_json_file(self, "google")