Commit 25c77d7
test: fix E2E test isolation issues
This commit fixes two critical test isolation problems that were causing
CI failures:
1. **Profile password tests modifying shared user**: The profile tests
were updating Bob's password and attempting to reset it back to
'password123' at the end. If the reset failed or tests failed before
reaching the reset, Bob's password remained changed, causing
subsequent tests to fail with "Invalid login credentials".
**Solution**: Created `createPasswordTestUser()` helper that
generates a unique test user for each password modification test.
This prevents Bob (shared test user) from being modified.
2. **Category/Post duplicate key errors**: Tests were creating
categories and posts with hardcoded names/slugs, causing duplicate
key violations when tests ran multiple times or in parallel.
**Solution**: Created `getUniqueTestPost()` and
`getUniqueTestCategory()` helpers that append timestamps to ensure
unique values for each test run.
These changes ensure tests are properly isolated and don't interfere
with each other, which is critical for reliable CI/CD execution.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d0d8201 commit 25c77d7
2 files changed
Lines changed: 74 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | | - | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| |||
252 | 261 | | |
253 | 262 | | |
254 | 263 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
263 | | - | |
| 274 | + | |
264 | 275 | | |
265 | 276 | | |
266 | 277 | | |
| |||
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
320 | | - | |
| 331 | + | |
| 332 | + | |
321 | 333 | | |
322 | | - | |
323 | | - | |
| 334 | + | |
| 335 | + | |
324 | 336 | | |
325 | 337 | | |
326 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 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 | + | |
15 | 42 | | |
16 | 43 | | |
17 | 44 | | |
| |||
57 | 84 | | |
58 | 85 | | |
59 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
60 | 90 | | |
61 | 91 | | |
62 | 92 | | |
| |||
80 | 110 | | |
81 | 111 | | |
82 | 112 | | |
83 | | - | |
| 113 | + | |
84 | 114 | | |
85 | 115 | | |
86 | 116 | | |
87 | 117 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 118 | | |
97 | 119 | | |
98 | 120 | | |
| |||
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
160 | 185 | | |
161 | 186 | | |
162 | 187 | | |
163 | 188 | | |
164 | 189 | | |
165 | 190 | | |
166 | 191 | | |
167 | | - | |
168 | | - | |
| 192 | + | |
| 193 | + | |
169 | 194 | | |
170 | 195 | | |
171 | 196 | | |
| |||
176 | 201 | | |
177 | 202 | | |
178 | 203 | | |
179 | | - | |
| 204 | + | |
180 | 205 | | |
181 | | - | |
| 206 | + | |
182 | 207 | | |
183 | 208 | | |
184 | 209 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | 210 | | |
192 | 211 | | |
193 | 212 | | |
| |||
0 commit comments