chore: refactor tests to improve clarity and reliability
- Removed unnecessary test.skip() calls in various test files, replacing them with comments for clarity. - Enhanced retry logic in TestDataManager for API requests to handle rate limiting more gracefully. - Updated security helper functions to include retry mechanisms for fetching security status and setting module states. - Improved loading completion checks to handle page closure scenarios. - Adjusted WebKit-specific tests to run in all browsers, removing the previous skip logic. - General cleanup and refactoring across multiple test files to enhance readability and maintainability.
This commit is contained in:
@@ -237,6 +237,10 @@ export async function waitForLoadingComplete(
|
||||
): Promise<void> {
|
||||
const { timeout = 10000 } = options;
|
||||
|
||||
if (page.isClosed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for any loading indicator to disappear
|
||||
// Updated to be more specific and exclude pulsing UI badges
|
||||
const loader = page.locator([
|
||||
@@ -252,7 +256,15 @@ export async function waitForLoadingComplete(
|
||||
'[role="status"][aria-label="Security Loading"]'
|
||||
].join(', '));
|
||||
|
||||
await expect(loader).toHaveCount(0, { timeout });
|
||||
try {
|
||||
await expect(loader).toHaveCount(0, { timeout });
|
||||
} catch (error) {
|
||||
if (page.isClosed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user