From c196e8062388eef2da890bc3c6b65eb39d28d1dd Mon Sep 17 00:00:00 2001 From: Pablo Gracia Gil Date: Wed, 6 Nov 2024 21:14:06 +0100 Subject: [PATCH] Add navigation tests --- tests/navigation/ayuda-psicologica.spec.ts | 10 ++++++++++ tests/navigation/compartir-coche.spec.ts | 10 ++++++++++ tests/navigation/reclamacion-consorcio.spec.ts | 10 ++++++++++ tests/navigation/servicio-notarial.spec.ts | 12 ++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 tests/navigation/ayuda-psicologica.spec.ts create mode 100644 tests/navigation/compartir-coche.spec.ts create mode 100644 tests/navigation/reclamacion-consorcio.spec.ts create mode 100644 tests/navigation/servicio-notarial.spec.ts diff --git a/tests/navigation/ayuda-psicologica.spec.ts b/tests/navigation/ayuda-psicologica.spec.ts new file mode 100644 index 00000000..e16fbdf4 --- /dev/null +++ b/tests/navigation/ayuda-psicologica.spec.ts @@ -0,0 +1,10 @@ +import { test, expect } from '@playwright/test'; + +test('should navigate to the "Ayuda Psicologica" page ', async ({ page }) => { + await page.goto('/'); + await page.click('text=Ayuda Psicológica'); + await expect(page).toHaveURL('https://ayudana.org/'); + await expect(page.locator('h1:has-text("Ayuda psicológica")')).toHaveText( + 'Ayuda psicológica gratuita a los afectados por la Dana de Valencia', + ); +}); diff --git a/tests/navigation/compartir-coche.spec.ts b/tests/navigation/compartir-coche.spec.ts new file mode 100644 index 00000000..8743a9f3 --- /dev/null +++ b/tests/navigation/compartir-coche.spec.ts @@ -0,0 +1,10 @@ +import { test, expect } from '@playwright/test'; + +test('should navigate to the "Compartir coche" page ', async ({ page }) => { + await page.goto('/'); + await page.click('text=Compartir Coche'); + await expect(page).toHaveURL('https://anem.guruwalk.com/'); + await expect(page.locator('h2:has-text("Comparte")')).toHaveText( + 'Comparte coche con quien no tiene y alivia el tráfico de la ciudad.', + ); +}); diff --git a/tests/navigation/reclamacion-consorcio.spec.ts b/tests/navigation/reclamacion-consorcio.spec.ts new file mode 100644 index 00000000..7b0f2055 --- /dev/null +++ b/tests/navigation/reclamacion-consorcio.spec.ts @@ -0,0 +1,10 @@ +import { test, expect } from '@playwright/test'; + +test('should navigate to the "Reclamar a Consorcio" page ', async ({ page }) => { + await page.goto('/'); + await page.click('text=Reclamar a Consorcio'); + await expect(page).toHaveURL( + 'https://www.consorseguros.es/ambitos-de-actividad/seguros-de-riesgos-extraordinarios/solicitud-de-indemnizacion', + ); + await expect(page.locator('h2:has-text("Abono")')).toHaveText('Abono de la indemnización'); +}); diff --git a/tests/navigation/servicio-notarial.spec.ts b/tests/navigation/servicio-notarial.spec.ts new file mode 100644 index 00000000..53689684 --- /dev/null +++ b/tests/navigation/servicio-notarial.spec.ts @@ -0,0 +1,12 @@ +import { test, expect } from '@playwright/test'; + +test('should navigate to the "Servicio Notarial" page ', async ({ page }) => { + await page.goto('/'); + await page.click('text=Servicio Notarial'); + await expect(page).toHaveURL( + 'https://valencia.notariado.org/portal/-/20241031-servicio-notarial-de-ayuda-gratuito-para-los-afectados-por-la-dana-noticia-p%C3%BAblica-', + ); + await expect(page.locator('h2:has-text("DANA")')).toHaveText( + 'Habilitado un servicio notarial gratuito de ayuda para los afectados por la DANA', + ); +});