You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
senzapaura_es/e2e/suscripciones.e2e.ts

45 lines
2.3 KiB

import { expect, test } from '@playwright/test';
test.describe('Suscripciones', () => {
test('la página pública explica los planes sin prometer un cobro inexistente', async ({
page
}) => {
await page.goto('/suscripciones');
await expect(page.getByRole('heading', { level: 1, name: 'Suscripciones' })).toBeVisible();
await expect(page.getByRole('heading', { level: 3, name: 'Seguidor' })).toBeVisible();
await expect(
page.getByRole('heading', { level: 3, name: 'Amigo', exact: true })
).toBeVisible();
await expect(page.getByRole('heading', { level: 3, name: 'Buen amigo' })).toBeVisible();
await expect(page.getByRole('heading', { level: 3, name: 'Taller de letras' })).toBeVisible();
await expect(page.getByText('Escucha con publicidad')).toBeVisible();
await expect(page.getByText('30 descargas en calidad media')).toBeVisible();
await expect(page.getByText('100 descargas', { exact: true })).toBeVisible();
await expect(page.getByText('Acceso a versiones')).toBeVisible();
await expect(page.getByText('Acceso a todo el contenido')).toBeVisible();
await expect(page.getByText('Descarga de todo el material')).toBeVisible();
await expect(page.getByRole('link', { name: 'Empezar gratis' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Elegir Amigo' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Elegir Buen amigo' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Acceder al taller' })).toBeVisible();
await expect(page.getByText(/Ordenados de menor a mayor nivel/i)).toHaveCount(0);
await expect(page.getByText(/Nivel [123]/i)).toHaveCount(0);
await expect(page.getByText(/Consultar (?:este )?plan/i)).toHaveCount(0);
await expect(
page.getByRole('heading', { level: 2, name: 'Suscripción y compra no son lo mismo' })
).toBeVisible();
await expect(page.getByText('Las canciones compradas')).toBeVisible();
});
test('se puede alcanzar desde el pie y no desborda en móvil', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto('/');
await page.locator('footer').getByRole('link', { name: 'Suscripciones' }).click();
await expect(page).toHaveURL(/\/suscripciones$/);
const ancho = await page.evaluate(() => document.documentElement.scrollWidth);
expect(ancho).toBeLessThanOrEqual(390);
});
});

Powered by TurnKey Linux.