After Uploading an Image ( using t.setFilesToUpload() method ) , the image stored on the Azure Blob Storage is truncated and fetched Image is Broken
SamShot81 opened this issue · 2 comments
What is your Scenario?
I am trying to test a basic feature to see if the Company logo is uploaded successfully.
To upload the Image which is a PNG type file of size 7KB named manas.png I am using the method .setFilesToUpload method. It works as expected and uploads the file successfully. The problem occurs when I try to verify if the image is uploaded successfully.
On investigating I found out that the image is uploaded and gets to the Azure Blob storage but it is being truncated during uploading procedure and the size of the file on Blob Storage is 2.9Kb.
What is the Current behavior?
The image is uploaded and it reaches the Blob but is truncated and breaks, so I cannot test and confirm if its working or not.
What is the Expected behavior?
Image should be uploaded seamlessly and displayed without any problems
What is the public URL of the test page? (attach your complete example)
https://portal.fsm.epicor.com/
What is your TestCafe test code?
Test Case
test('Verify New Company Logo Functioning Successfully', async (t: TestController) => {
await t
.setFilesToUpload('#imageFile', '../../../../../../Images/Photos/manas.png')
.click(Selector('div').withAttribute('aria-label', 'Upload'))
});
Your complete configuration file
module.exports = {
skipJsErrors: true,
hooks: {
// fixture:{
// before: async (t) => {
// await t
// .maximizeWindow();
// }
// },
test: {
before: async (t) => {
await t
.maximizeWindow();
},
},
reporter: {
onBeforeWrite: {
'spec': hookFunction
},
},
},
};
let i = 1
function hookFunction(writeInfo, testRuninfo, name) {
if (writeInfo.initiator === 'reportTestDone') { // Determine the reporter event
const dateTime = new Date().toLocaleString('en-US', { timeZone: 'GMT' });
writeInfo.formattedText = i++ + " - " + dateTime + writeInfo.formattedText;
//writeInfo.formattedText = "NUMBER OF TEST EXECUTED : " + (++i)
};
}
Your complete test report
N/A
Screenshots
Screenshot of Azure Blob Storage to prove that it is uploaded successfully but the SIZE IS REDUCED
Below is the image of how it looks.
Expecting to see the uploaded image.
Steps to Reproduce
TestCafe version
3.5.0
Node.js version
v21.6.2
Command-line arguments
testcafe chrome ./mytestfile.ts
Browser name(s) and version(s)
- Chrome 129.0.0.0
Platform(s) and version(s)
Windows 11
Other
No response
Hello,
I believe the issue was fixed in TestCafe v3.6.2
Please update your version and let us know your results.
Original issue: #8198.
I'll close this issue as a duplicate.
Thanks. This works after updating.