Open SairamNewron opened 7 months ago
@SairamNewron Could you provide a full example that we could run and see the error? Thanks.
@jennifer-shehane , I observe that , the same spec file used in direct in e2e folder , it is not throwing error for cy.writefile(), but when i keep spec file in sub folders like fourth or fifth level sub - sub folder , it started throwing error for new spec ,may be the cy.writefile is not recognizing the imported js file as supported file / unable to call cy.writefile if spec file is in sub folders (it is getting failed when i used the same method in command.js).
it seems issue is with spec file location in folder structure
folder structure used for POM module is as follows
cypress > e2e / pages / main menu / sub menu / module / sub module / page.js cypress > e2e / testscripts / main menu / sub menu / module / sub module / test.cy.js
issue in import (only for cy.writefile) import shiftMasterEntity from "../../../../../../Pages/Entity/Settings/D_HR_Management/a_HR_Master/ShiftMaster/shiftMasterEntity";
no issue in the following import same file (only for cy.writefile)
import shiftMasterEntity from '../../../Pages/Entity/Settings/D_HR_Management/a_HR_Master/ShiftMaster/shiftMasterEntity';
The issue still exist for one spec file , what I have used, but it is working fine in new spec files
@SairamNewron could this be related to the path of the file being too long? It is just a thought.
Example (I know it is not the full path): "../../../../../../Pages/Entity/Settings/D_HR_Management/a_HR_Master/ShiftMaster/shiftMasterEntity" Has 98 characters "../../../Pages/Entity/Settings/D_HR_Management/a_HR_Master/ShiftMaster/shiftMasterEntity" Has 89 characters
Maybe the first path exceeds whatever the maximum limit is.
I don't know the exact reason for this, but this is not working only in single spec file , all the previous and new files are working fine , I am unable to reproduce the issue
Current behavior
Unable to use writefile in new spec file , but works fine in old spec files
Desired behavior
No response
Test code to reproduce
Cypress Version
13.7.1
Node version
20.9
Operating System
windows 64
Debug Logs
Other
No response