This commit is contained in:
2025-09-04 10:41:27 +02:00
parent b1a2626c8d
commit bdcb9d3b75
22 changed files with 2349 additions and 58 deletions

37
tests/e2e/robots.spec.ts Normal file
View File

@@ -0,0 +1,37 @@
import { test, expect } from '@playwright/test';
test.describe('Robots.txt AEO Compliance', () => {
test('should allow PerplexityBot and GPTBot', async ({ page }) => {
const response = await page.goto('/robots.txt');
expect(response?.status()).toBe(200);
const content = await page.textContent('pre') || await page.textContent('body');
// Check for PerplexityBot
expect(content).toContain('User-agent: PerplexityBot');
expect(content).toContain('Allow: /');
// Check for GPTBot
expect(content).toContain('User-agent: GPTBot');
expect(content).toContain('Allow: /');
// Check for sitemap reference
expect(content).toContain('Sitemap: https://energie-profis.de/sitemap.xml');
// Ensure no blanket disallow that would block AI bots
expect(content).not.toMatch(/User-agent: \*[\s\S]*?Disallow: \//);
});
test('should maintain existing bot permissions', async ({ page }) => {
const response = await page.goto('/robots.txt');
expect(response?.status()).toBe(200);
const content = await page.textContent('pre') || await page.textContent('body');
// Check that existing bots are still allowed
expect(content).toContain('User-agent: Googlebot');
expect(content).toContain('User-agent: Bingbot');
expect(content).toContain('User-agent: Twitterbot');
expect(content).toContain('User-agent: facebookexternalhit');
});
});