| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- const { test, expect } = require('@playwright/test');
- const BASE_URL = 'https://ajy.danclub.cn';
- const TEST_ADMIN = { username: 'admin', password: 'admin123' };
- test.describe('用户体型数据边界测试', () => {
- test.beforeEach(async ({ page }) => {
- await page.goto(BASE_URL);
- await page.waitForLoadState('networkidle');
- await page.getByPlaceholder('请输入用户名').fill(TEST_ADMIN.username);
- await page.getByPlaceholder('请输入密码').fill(TEST_ADMIN.password);
- await page.getByRole('button', { name: '登 录' }).click();
- await page.waitForURL(`${BASE_URL}/#/user/app`, { timeout: 10000 });
- });
- test('UE-001: 男性肩宽最小值边界(36cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- const addBtn = page.getByRole('button', { name: '新增用户' });
- if (await addBtn.isVisible()) {
- await addBtn.click();
- await page.waitForTimeout(500);
- await page.getByPlaceholder('请输入姓名').fill('边界男');
- await page.waitForTimeout(300);
- }
- });
- test('UE-002: 男性肩宽最大值边界(52cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-003: 女性肩宽最小值边界(32cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-004: 女性肩宽最大值边界(46cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-005: 男性身长最小值边界(75cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-006: 男性身长最大值边界(95cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-007: 女性身长最小值边界(70cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-008: 女性身长最大值边界(88cm)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-009: 年龄最小值边界(1岁)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-010: 年龄最大值边界(120岁)', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-011: 手机号11位验证', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-012: 手机号非1开头验证', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-013: 重名用户处理', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- });
- test('UE-014: 批量删除用户', async ({ page }) => {
- await page.goto(`${BASE_URL}/#/user/app`);
- await page.waitForLoadState('networkidle');
- const checkbox = page.locator('.el-table__header .el-checkbox').first();
- if (await checkbox.isVisible()) {
- await checkbox.click();
- await page.waitForTimeout(300);
- }
- });
- });
|