Files
flights_web/tests/e2e-angular/seo.spec.ts
T
gnezim 20c19d15f4
CI / ci (push) Failing after 23s
Deploy / build-and-deploy (push) Failing after 5s
Add standalone API proxy via curl (bypasses WAF TLS fingerprinting)
Modern.js SSR intercepts all routes before any Express middleware,
so the API proxy runs as a separate Express server on port 8080.
Modern.js runs on 8081. The proxy uses curl subprocesses which go
through the system HTTPS proxy (GOST) with a proper TLS fingerprint
that the Aeroflot WAF accepts.

Usage: node scripts/dev-server.mjs (replaces pnpm dev for full-stack)

Also: remove stray e2e-angular test directory, fix env default to
same-origin /api.
2026-04-15 23:04:24 +03:00

73 lines
2.6 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('SEO & Meta Tags (US-9)', () => {
test('should have correct title and meta tags for ru-ru', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const title = await page.title();
expect(title).toBeTruthy();
expect(title.length).toBeGreaterThan(0);
const description = await page.locator('meta[name="description"]').getAttribute('content');
expect(description).toBeTruthy();
});
test('should have correct title and meta tags for en-us', async ({ page }) => {
await page.goto('http://localhost:3000/en-us/onlineboard');
const title = await page.title();
expect(title).toBeTruthy();
expect(title.length).toBeGreaterThan(0);
});
test('should have OpenGraph tags on all pages', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const ogTitle = await page.locator('meta[property="og:title"]').count();
expect(ogTitle).toBeGreaterThan(0);
const ogDescription = await page.locator('meta[property="og:description"]').count();
expect(ogDescription).toBeGreaterThan(0);
});
test('should have canonical link', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const canonical = await page.locator('link[rel="canonical"]').count();
expect(canonical).toBeGreaterThan(0);
});
test('should have viewport meta tag', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const viewport = await page.locator('meta[name="viewport"]').getAttribute('content');
expect(viewport).toContain('width=device-width');
});
test('should have correct language attribute', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const lang = await page.locator('html').getAttribute('lang');
expect(lang).toBeTruthy();
});
test('should update lang attribute when changing locale', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
let lang = await page.locator('html').getAttribute('lang');
expect(lang).toBeTruthy();
// Switch to English
await page.goto('http://localhost:3000/en-us/onlineboard');
lang = await page.locator('html').getAttribute('lang');
expect(lang).toBeTruthy();
});
test('should have JSON-LD structured data', async ({ page }) => {
await page.goto('http://localhost:3000/ru-ru/onlineboard');
const jsonLd = await page.locator('script[type="application/ld+json"]').count();
expect(jsonLd).toBeGreaterThan(0);
});
});