Improve image upload error handling and validation (#17188)
- Add URL validation in getImageBufferFromUrl utility - Add response status validation and content-type checking - Add timeout and connection error handling with specific error messages - Validate buffer is not empty before processing - Validate file type detection results before proceeding - Ensure detected file type is actually an image format - Add proper type safety for Axios error handling This improves robustness when uploading images from URLs by: - Preventing invalid URLs from being processed - Providing clear error messages for different failure scenarios - Ensuring only valid image files are processed - Handling network errors gracefully --------- Co-authored-by: GitTensor Miner <miner@gittensor.io>
This commit is contained in:
@@ -105,6 +105,8 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
async typeEmail(email: string) {
|
||||
// Wait for the email field to be visible before trying to interact
|
||||
await this.emailField.waitFor({ state: 'visible' });
|
||||
await expect(this.emailField).toBeVisible();
|
||||
|
||||
await this.emailField.fill(email);
|
||||
|
||||
@@ -47,6 +47,8 @@ test('Create workflow', async ({ page }) => {
|
||||
.getByTestId('top-bar-title')
|
||||
.getByText(NEW_WORKFLOW_NAME);
|
||||
|
||||
// Wait for the name to be visible and not hidden
|
||||
await workflowName.waitFor({ state: 'visible' });
|
||||
await expect(workflowName).toBeVisible();
|
||||
|
||||
await expect(page).toHaveURL(`/object/workflow/${newWorkflowId}`);
|
||||
|
||||
Reference in New Issue
Block a user