File size: 1,779 Bytes
05c5ed5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
 * Shared test user credentials for E2E tests
 * These users are created by the seed script: pnpm test:e2e:seed
 */

export const TEST_USERS = {
  admin: {
    email: "admin@test-seed.local",
    password: "AdminPassword123!",
    name: "Test Admin User",
    role: "admin",
    authFile: "tests/.auth/admin.json",
  },
  editor: {
    email: "editor@test-seed.local",
    password: "EditorPassword123!",
    name: "Test Editor User",
    role: "editor",
    authFile: "tests/.auth/editor-user.json",
  },
  editor2: {
    email: "editor2@test-seed.local",
    password: "Editor2Password123!",
    name: "Test Editor User 2",
    role: "editor",
    authFile: "tests/.auth/editor-user2.json",
  },
  regular: {
    email: "user@test-seed.local",
    password: "UserPassword123!",
    name: "Test Regular User",
    role: "user",
    authFile: "tests/.auth/regular-user.json",
  },
  banned: {
    email: "testuser21@test-seed.local",
    password: "TestPass21!",
    name: "Test User 21",
    role: "user",
    banReason: "Test ban for E2E testing",
  },
  // Additional test users for pagination testing
  testUsers: Array.from({ length: 18 }, (_, i) => ({
    email: `testuser${i + 4}@test-seed.local`,
    password: `TestPass${i + 4}!`,
    name: `Test User ${i + 4}`,
    role: i + 4 <= 9 ? "editor" : "user",
  })),
} as const;

// Test email domain for easy identification and cleanup
export const TEST_EMAIL_DOMAIN = "@test-seed.local";

// Patterns for identifying test users to clean up
export const TEST_EMAIL_PATTERNS = {
  seeded: "%@test-seed.local%", // Our seeded test users
  playwright: "%playwright%", // Dynamically created playwright users
  example: "%@example.com%", // Test signup users
  tempTest: "%@temp-test.%", // Temporary test users
} as const;