2023-01-15 15:23:27 +04:00
|
|
|
import path from 'node:path';
|
|
|
|
import fs from 'node:fs';
|
|
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
|
2023-03-30 01:23:01 +01:00
|
|
|
const roadmapIds = fs.readdirSync(
|
|
|
|
path.join(process.cwd(), 'src/data/roadmaps')
|
|
|
|
);
|
2023-01-15 15:23:27 +04:00
|
|
|
|
2023-01-15 15:26:58 +04:00
|
|
|
test(`roadmaps`, async ({ page }) => {
|
|
|
|
await page.goto('/roadmaps');
|
|
|
|
|
|
|
|
await expect(page).toHaveScreenshot({ fullPage: true });
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:23:27 +04:00
|
|
|
for (const roadmapId of roadmapIds) {
|
|
|
|
test(`roadmap ${roadmapId}`, async ({ page }) => {
|
|
|
|
await page.goto(`/${roadmapId}`);
|
|
|
|
|
|
|
|
await expect(page).toHaveScreenshot({ fullPage: true });
|
|
|
|
});
|
|
|
|
}
|