Skip to content

Commit

Permalink
Agrego test e2e para validar nombre de cliente.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmasemper committed Jun 23, 2024
1 parent 6af0899 commit 854f562
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions functional_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,22 @@ def test_should_be_able_to_edit_a_client(self):
"href", reverse("clients_edit", kwargs={"id": client.id}),
)

def test_should_view_errors_if_name_is_invalid(self):
"""
Esta función verifica que muestre un mesnaje de error para un nombre invalido.
"""
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("manu22")
self.page.get_by_label("Teléfono").fill("54221555232")
self.page.get_by_label("Email").fill("[email protected]")
self.page.get_by_label("Ciudad").select_option("La Plata")

self.page.get_by_role("button", name="Guardar").click()

expect(self.page.get_by_text("El nombre debe contener solo letras y espacios")).to_be_visible()

class MedicineCreateEditTestCase(PlaywrightTestCase):
"""
Expand Down

0 comments on commit 854f562

Please sign in to comment.