test(ui): add e2e and integration tests
This commit is contained in:
44
tests/regression/visual.test.js
Normal file
44
tests/regression/visual.test.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Visual Regression: CV Page', () => {
|
||||
test('hero section visual snapshot', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const hero = page.locator('section').first();
|
||||
await expect(hero).toHaveScreenshot('hero-section.png', {
|
||||
maxDiffPixels: 100,
|
||||
});
|
||||
});
|
||||
|
||||
test('full page visual snapshot', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(page).toHaveScreenshot('full-page.png', {
|
||||
fullPage: true,
|
||||
maxDiffPixels: 500,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Visual Regression: Admin Page', () => {
|
||||
test('admin panel visual snapshot', async ({ page }) => {
|
||||
await page.goto('/admin');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(page).toHaveScreenshot('admin-panel.png', {
|
||||
maxDiffPixels: 200,
|
||||
});
|
||||
});
|
||||
|
||||
test('personal form visual snapshot', async ({ page }) => {
|
||||
await page.goto('/admin');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const form = page.locator('form').first();
|
||||
await expect(form).toHaveScreenshot('personal-form.png', {
|
||||
maxDiffPixels: 100,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user