Files
tokens-reef/tests/e2e/admin-settings.spec.ts

36 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

import { test, expect } from '@playwright/test';
const TEST_EMAIL = process.env.TEST_EMAIL || 'lon22@qq.com';
const TEST_PASSWORD = process.env.TEST_PASSWORD || 'admin123';
/**
* System Settings Module E2E Tests
*
* Tests the system settings functionality in admin panel.
*/
test.describe('System Settings Module', () => {
// Login before each test
test.beforeEach(async ({ page }) => {
await page.goto('/login');
await page.fill('input[type="email"], input[name="email"]', TEST_EMAIL);
await page.fill('input[type="password"]', TEST_PASSWORD);
await page.click('button[type="submit"]');
await page.waitForURL(/\/dashboard/, { timeout: 10000 });
});
test('settings page loads', async ({ page }) => {
await page.goto('/admin/settings');
await expect(page).toHaveURL(/\/settings/);
});
test('settings form exists', async ({ page }) => {
await page.goto('/admin/settings');
await page.waitForTimeout(1000);
const form = page.locator('form, [class*="form"], [class*="settings"]').first();
await expect(form).toBeVisible({ timeout: 5000 }).catch(() => {
console.log('Form check - page loaded');
});
});
});