From eebf16d8abe6c80cfabd2208feb4535b07185531 Mon Sep 17 00:00:00 2001 From: Candela Date: Tue, 25 Jun 2024 20:27:54 -0300 Subject: [PATCH] Agrego el test e2e para validar el telefono del cliente. --- functional_tests/tests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/functional_tests/tests.py b/functional_tests/tests.py index f7a62e85..9414bdc9 100644 --- a/functional_tests/tests.py +++ b/functional_tests/tests.py @@ -371,6 +371,25 @@ def test_should_view_errors_if_form_is_invalid_email(self): expect(self.page.get_by_text("gonza@vetsoft.com")).to_be_visible() expect(self.page.get_by_text("La Plata")).to_be_visible() + def test_should_show_error_for_phone_whitout_54(self): + """ + Esta función verifica que se muestre un mensaje de error cuando se intenta + crear un cliente con un numero sin el 54 + """ + self.page.goto(f"{self.live_server_url}{reverse('clients_form')}") + + expect(self.page.get_by_role("form")).to_be_visible() + + self.page.get_by_label("Nombre").fill("Guido Carrillo") + self.page.get_by_label("Teléfono").fill("221232555") + self.page.get_by_label("Email").fill("goleador@vetsoft.com") + self.page.get_by_label("Ciudad").select_option("Berisso") + + self.page.get_by_role("button", name="Guardar").click() + + # Verifica si se muestra el mensaje de error esperado + expect(self.page.get_by_text("El telefono debe comenzar con 54")).to_be_visible() + class MedicineCreateEditTestCase(PlaywrightTestCase): """