I enabled cypress tests for my Amplify pipeline. Some of the tests are failing during deployment. My changes to the tests (even completely deleting the failing test specs) is working locally - I see successful tests pass. However when I push the changes, I see failures in Amplify console. Is there a possibility that caching of some sort is going on here? Or if I need to compile the tests each time for the changes to take effect?
I also see this warning in my log file for Cypress tests :
2023-02-09T05:54:38.899Z [WARNING]: ! Test config file not found for the configFilePath glob provided in your build spec: **/mochawesome.json
This is the structure of my cypress folder
fixtures
downloads
plugins
reports
support
tsconfig.json
webpack.config.js
report
e2e
integration
And this is the test section of my amplify.yml
test:
artifacts:
baseDirectory: cypress
configFilePath: "**/mochawesome.json"
files:
- "**/*.png"
- "**/*.mp4"
phases:
preTest:
commands:
- npm ci
- npm install -g pm2
- npm install -g wait-on
- npm install mocha mochawesome mochawesome-merge mochawesome-report-generator
- npx pm2 start npm -- start
- 'npx wait-on --timeout 60 http://localhost:3000'
test:
commands:
- npm run build
- "npx serve -s -l 3000 build & sleep 30; yarn e2e"
- 'npx cypress run --reporter mochawesome --reporter-options "reportDir=cypress/report/mochawesome-report,overwrite=false,html=false,json=true,timestamp=mmddyyyy_HHMMss"'
postTest:
commands:
- npx mochawesome-merge cypress/report/mochawesome-report/mochawesome*.json > cypress/report/mochawesome.json
- npx pm2 kill