def test_013(self): fecha = Selenium.textDateEnvironmentReplace(self, "today") Selenium.get_elements(self, "txt_buscar").send_keys(fecha) Selenium.esperar(5)
def test_015(self): with allure.step(u'PASO 2: Ingresar termino de Busqueda'): date = Selenium.textDateEnvironmentReplace(self, "Last Month") Selenium.get_elements(self, "txt_busqueda").send_keys(date) Selenium.esperar(self, 10)
def step_impl(self, keyword): Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).click() Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).send_keys(keyword) Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).send_keys( Keys.ENTER) Selenium.Esperar_Xpath(self, Inicio.txt_resultStats_xpath)
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_020(self): Selenium.get_elements(self, "Email").send_keys("*****@*****.**") Selenium.get_elements(self, "Email Confirmacion").click() #Mensaje_Email = Selenium.validar_elemento(self, "Mensaje Email") Captcha = Selenium.validar_elemento(self, "Contenedor Captcha") #print(Mensaje_Email) if Captcha: pytest.skip("No se ejecuto la prueba, captcha esta visible")
def step_impl(self, QResult): Selenium.Captura(self, u'Then Query results are under 1000', self.driver) Resultados = Selenium.Xpath_Elements(self, Inicio.txt_resultStats_xpath).text print(Resultados) RAET = Resultados.split(" ")[2] print("RAET obtuvo: " + str(RAET) + " Resultados de busqueda") Resultado = RAET.replace(",", "") unittest.TestCase.assertTrue( int(Resultado) > int(QResult), "Es mayor a 10000")
def test_001(self): assert Selenium.xpath_element(self, Registro.lbl_titulo_xpath).text == "Regístrate gratis para escuchar" print (Selenium.xpath_element(self, Registro.lbl_titulo_xpath).text) Selenium.xpath_element(self, Registro.txt_correo_xpath).send_keys("*****@*****.**") Selenium.xpath_element(self, Registro.txt_confirmarcorreo_xpath).send_keys("*****@*****.**") Selenium._id_element(self, Registro.txt_contrasena_id).send_keys("*****@*****.**") Selenium.xpath_element(self, Registro.btn_registrate_xpath).click() time.sleep(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_011(self): Selenium.get_elements(self, "Email").send_keys("*****@*****.**") Selenium.send_especific_keys(self, "Email", "Tab") verificar = Selenium.validar_elemento(self, "Email Error") if verificar == True: #Selenium.send_key_text(self, "Email", "*****@*****.**") #pytest.skip("El email ya existe") unittest.TestCase.skipTest(self, "El email ya existe") 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_013(self): with allure.step(u'Paso 2: Ingresar a Google'): date = Selenium.textDataEnvironmentReplace(self, "last month") Selenium.get_elements(self, "txt_busqueda").send_keys(date) Selenium.send_especific_keys(self, "txt_busqueda", "Enter") Selenium.esperar(3)
def test_016(self): with allure.step(u'Paso 2: Ingresar un correo duplicado'): Selenium.send_key_text(self, "txt_correo", "*****@*****.**") Selenium.get_elements(self, "txt_confirmarcorre").click() Mensaje_Email_Obj = Selenium.validar_elemento(self, "lbl_errorcorreo") Mensaje_Email_texto = Selenium.get_text(self, "lbl_errorcorreo") #with allure.step(u'Paso 3: verificar mensaje de correo repetido'): # assert Mensaje_Email_Obj == True, "No se visualizo el mensaje de error email duplicado" Selenium.esperar(5)
def test_005(self): Selenium.new_window(self, "https://www.mercadolibre.com.mx/ofertas#nav-header") time.sleep(3) Selenium.switch_to_windows_name(self, "Ofertas") time.sleep(3) Selenium.switch_to_windows_name(self, "Principal") time.sleep(3) Selenium.switch_to_windows_name(self, "Ofertas") time.sleep(3)
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_010(self): Selenium.get_elements(self, "Email").send_keys("mervlugo@gmailcom") Selenium.send_especific_keys(self, "Email", "Tab") Selenium.assert_text(self, "Email Error", "La dirección de email que proporcionaste no es válida.") time.sleep(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_010(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.get_elements(self, "Email").send_keys("dfsd") Selenium.send_especific_keys(self, "Email", "Tab") verificar = Selenium.check_element(self, "mensaje_error_email") if verificar == True: Selenium.send_key_text(self, "Email", Registro.emailUsuario) unittest.TestCase.skipTest(self, "El email ya existe") time.sleep(5)
def test_021(self): Selenium.get_elements(self, "Email").send_keys("*****@*****.**") Selenium.get_elements(self, "Email Confirmacion").click() Mensaje_Email_Obj = Selenium.validar_elemento(self, "Mensaje Email") Captcha = Selenium.validar_elemento(self, "Contenedor Captcha") Mensaje_Email_texto = Selenium.get_text(self, "Mensaje Email") assert Mensaje_Email_Obj == True, "No se visualizo el mensaje de error email duplicado" assert Captcha == True, "No se visualizo el captcha" assert Mensaje_Email_texto == "Lo sentimos, este correo ya está registrado.", f"El mensaje esperado es: 'Lo sentimos, este correo ya está registrado.', el mensaje obtenido fue: {Mensaje_Email_texto}"
def step_impl(self, KEYWORDS): Validar = Selenium.Esperar_Xpath(self, Inicio.txt_busqueda_xpath) if Validar == False: Selenium.CapturarPantalla(self, u"No se inicializo google.com") pytest.skip("No se inicializo google.com") self.driver.quit() Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).click() Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).send_keys(KEYWORDS) Selenium.Xpath_Elements(self, Inicio.txt_busqueda_xpath).send_keys( Keys.ENTER) Selenium.Esperar_Xpath(self, Inicio.txt_resultStats_xpath)
def test_016(self): assert "No coinciden", Selenium.get_text( self, "Titulo") == Registro.tituloPagina # assert "No coinciden", Selenium.get_elements(self, "Titulo").text == Registro.tituloPagina Selenium.get_elements(self, "Email").send_keys(Registro.emailUsuario) Selenium.get_elements(self, "emailConfirm").click() captcha = Selenium.validar_elemento(self, "Captcha") if captcha: pytest.skip("No se ejecutó la prueba. La captcha está visible.")
def test_007(self): print(u"Seleccionar Pais") self.esperar_xpath(Login_Meli.lbl_titulo_pais_xpath) self.xpath_elements_tap(Login_Meli.chk_Argentina_xpath) self.captura("Esto es Captura para Allure") print(u"Ingresar Usuario") self.esperar_id(Login_Meli.lbl_titulo_id) self.captura("Esto es Captura para Allure") print(u"Seleccionar tipo de Autenticación") self.esperar_id(Login_Meli.btn_already_id) self.id_elements_tap(Login_Meli.btn_already_id) print(u"Ingresar Usuario") self.esperar_id(Login_Meli.lbl_titulo_login_id) self.sendkeys_id(Login_Meli.txt_usuario_id, "*****@*****.**") self.captura("Estos es una bonitas capturas") self.id_elements_click(Login_Meli.btn_continuar_id) print(u"Ingreso de clave") self.esperar_id(Login_Meli.btn_ingresar_id) self.sendkeys_id(Login_Meli.txt_clave_id, "edgarmejias26") self.captura("Estos es una bonitas capturas para clientes") self.id_elements_click(Login_Meli.btn_ingresar_id) print(u"Validar el usuario logueado") self.waitStopLoad(3) self.captura("Estos es una bonitas capturas") self.id_elements_tap(Menu_Meli.btn_menu_accid) self.waitStopLoad(3) self.assertTrue( True, Selenium.esperar_id(self, Menu_Meli.lbl_UsuarioLogueado_id)) self.assertEqual( "¡Hola edgar!", self.get_to_text_element_id(Menu_Meli.lbl_UsuarioLogueado_id)) self.captura("Estos es una bonitas capturas") self.driver.close_app() print('DONE!!')
class set_Values(): Functions().Modificar_XML_Enviroments()
def tearDown(self): with allure.step(u'PASO 3: Salir de la app'): Selenium.tearDown(self)
def test_016(self): with allure.step(u'PASO 2: Captura de pantalla'): Selenium.captura(self, "Google") Selenium.esperar(self, 10)
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)
def tearDown(self): Selenium.tearDown(self)
def setUp(self): Selenium.abrir_navegador(self) Selenium.get_json_file(self, "Spotify_registro")
def tearDown(self): with allure.step(u'Paso 4: Cerrar el navegador'): Selenium.tearDown(self)
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")