I am using TestCafe Studio to record tests that Upload files in my web application.
I have used the Set Files to Upload both with and without Clear Upload as the next step.
The test runs perfectly fine when I run from TestCafe Studio.
However, when the tests are deployed by Azure DevOps to another machine where the _uploads_ folder does not have the same exact file path, the tests fail because it cannot find the whole path name.
Cannot find the following file(s) to upload: C:\Source\Test\PortalTestCafe\TestCafeTests\_uploads_\HealthCareClinic.spfx Browser: HeadlessChrome 77.0.3865 / Windows 10.0.0
If I change the Javascript file and replace the entire path with "…", the test runs fine from the Javascript file.
.click(Selector('span').withText('Browse'))
.setFilesToUpload(Selector('#uploadModelFiles'), ['…\_uploads_\HealthCareClinic.spfx'])
.click(Selector('.main-container'))
.click(Selector('#uploadProjectButton'))
I cannot seem to remove the entire file path in the testcafe file however.
In our Azure DevOps, the command line is using the testcafe files.
Is there something that I need to so differently to be able to run the testcafe file?
Or is my only option to run the Javascript?
Please advise.
Thanks