How to use definir_texto method in SeleniumBase

Best Python code snippet using SeleniumBase

juego.py

Source:juego.py Github

copy

Full Screen

...51 if self.pelota.x > 295:52 a = int(self.puntaje1.obtener_texto())53 54 if a != 6:55 self.puntaje1.definir_texto(str(a+1))56 else:57 self.puntaje1.definir_texto(str(a+1))58 self.pelota.explotar()59 pilas.avisar('Ganador: jugador 1')60 texto = pilas.actores.Texto('Game Over !!!')61 self.puntaje1.color = pilas.colores.verde62 self.puntaje2.color = pilas.colores.rojo63 self.termino_el_juego = True64 self.toco_lateral_der = True65 if self.toco_lateral_der:66 if self.pelota.x < 295:67 self.toco_lateral_der = False68 69 if not self.toco_lateral_izq:70 if self.pelota.x < -295:71 a = int(self.puntaje2.obtener_texto())72 73 if a != 6:74 self.puntaje2.definir_texto(str(a+1))75 else:76 self.puntaje2.definir_texto(str(a+1))77 self.pelota.explotar()78 pilas.avisar('Ganador: jugador 2')79 texto = pilas.actores.Texto('Game Over !!!')80 self.puntaje2.color = pilas.colores.verde81 self.puntaje1.color = pilas.colores.rojo82 self.termino_el_juego = True83 self.toco_lateral_izq = True84 if self.toco_lateral_izq:85 if self.pelota.x > -295:86 self.toco_lateral_izq = False87 88 def cuando_pulsa_tecla(self, *k, **kv):89 '''Función ejecutada al pulsar <ESC>. Llama a la escena Menu().'''90 pilas.recuperar_escena()

Full Screen

Full Screen

texto.py

Source:texto.py Github

copy

Full Screen

...38 pass39 def obtener_texto(self):40 """Retorna el texto definido."""41 return self.imagen.texto42 def definir_texto(self, texto):43 """Define el texto a mostrar."""44 imagen = self.pilas.imagenes.crear_texto(texto,45 self.__magnitud,46 self.__vertical,47 self.__fuente,48 color=self.__color,49 ancho=self._ancho)50 if not self._ancho:51 self._ancho = imagen.ancho()52 self.imagen = imagen53 self.centro = ("centro", "centro")54 self.__texto = texto55 texto = property(obtener_texto, definir_texto,56 doc="El texto que se tiene que mostrar.")57 def obtener_ancho(self):58 return self._ancho59 def definir_ancho(self, ancho):60 self._ancho = ancho61 self.definir_texto(self.texto)62 ancho = property(obtener_ancho, definir_ancho)63 def obtener_color(self):64 return self.__color65 def definir_color(self, color):66 self.__color = color67 # Actualiza el texto para forzar el re-dibujado68 self.texto = self.texto...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful