feat: add playwright e2e testing framework (#4468)

* feat: add playwright e2e testing framework
This commit is contained in:
Vben
2024-09-22 21:35:40 +08:00
committed by GitHub
parent 4b3d2d21ed
commit 2a83f1d666
22 changed files with 345 additions and 300 deletions

View File

@@ -0,0 +1,20 @@
import { expect, test } from '@playwright/test';
import { authLogin } from './common/auth';
test.beforeEach(async ({ page }) => {
await page.goto('/');
});
test.describe('Auth Login Page Tests', () => {
test('check title and page elements', async ({ page }) => {
// 获取页面标题并断言标题包含 'Vben Admin'
const title = await page.title();
expect(title).toContain('Vben Admin');
});
// 测试用例: 成功登录
test('should successfully login with valid credentials', async ({ page }) => {
await authLogin(page);
});
});