forked from frlp-utn-ingsoft/vetsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Fix/cliente-ciudad-tests
- Loading branch information
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]") | ||
|