refactors
This commit is contained in:
parent
4e1a339432
commit
82c4d0168e
28 changed files with 1042 additions and 782 deletions
|
|
@ -22,13 +22,12 @@ test.beforeEach(async ({ context, request }, testInfo) => {
|
|||
process.env.NEXT_PUBLIC_API_URL = backendUrl;
|
||||
|
||||
// Reset database before each test for isolation
|
||||
try {
|
||||
await resetDatabase(request);
|
||||
} catch (error) {
|
||||
// If reset fails, log but don't fail the test
|
||||
// This allows tests to run even if reset endpoint is unavailable
|
||||
console.warn(`Failed to reset database: ${error}`);
|
||||
}
|
||||
// This must complete successfully before tests run to avoid race conditions
|
||||
await resetDatabase(request);
|
||||
|
||||
// Small delay to ensure database transaction commits are visible
|
||||
// This prevents race conditions where tests start before reset completes
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
// Add init script to set English language before any page loads
|
||||
// This must be called before any page.goto() calls
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue