Skip to content

Commit

Permalink
Merge branch 'main' into Fix/cliente-ciudad-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-edlp authored Jun 23, 2024
2 parents 5831249 + 8d37642 commit 86afb1c
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions functional_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,31 @@ def test_should_be_able_to_edit_a_client(self):
"href", reverse("clients_edit", kwargs={"id": client.id}),
)

def test_should_show_message_if_city_is_not_selected(self):

def test_should_view_errors_if_name_is_invalid(self):
"""
Esta función verifica que se muestre un mensaje de error cuando se intenta
crear un cliente sin seleccionar ciudad
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()


def test_should_show_message_if_city_is_not_selected(self):
"""
Esta función verifica que se muestre un mensaje de error cuando se intenta
crear un cliente sin seleccionar ciudad
"""
self.page.get_by_label("Nombre").fill("Angel")
self.page.get_by_label("Teléfono").fill("542226836789")
self.page.get_by_label("Email").fill("[email protected]")
Expand Down

0 comments on commit 86afb1c

Please sign in to comment.