cypress-plugin-snapshots
cypress-plugin-snapshots copied to clipboard
cypress-plugin-snapshots does not support headless mode
Describe the bug Using cypress with --headless works fine on jenkins However adding cypress-plugin-snapshots causes the following error on jenkins
resize: can't open terminal /dev/tty
tput: No value for $TERM and no -T specified
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @spokeo/[email protected] test:run-cypress: `cypress run --headless`
npm ERR! Exit status 2
Manually executing the test on laptop or when ssh into the jenkins slave works fine because there is an interactive shell session. However when it's auto executed with on jenkins it doesn't have interactive session.
I have tried to add $TERM and $DISPLAY env var but it stil it doesn't work
When I logged in to jenkins, TERM is set to xterm-256color so I put that in the Jenkinsfile. It got rid of the "tput: No value for $TERM and no -T specified" but still it has "resize: can't open terminal /dev/tty"
cypress was executed with --headless and works fine without this plugin
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: ubuntu
- Cypress Version cypress@^6.5.0: cypress-plugin-snapshots@^1.4.4
Additional context Add any other context about the problem here.
I had the same output of resize and tput when running cypress in headless mode via crontab on linux. But no plugin has been used in cypress. It seems that a call to resize is done if one of the environment variables COLUMNS or LINES is not set. After calling my cronjob in this way:
47 * * * * export TERM=xterm && export COLUMNS=80 && export LINES=80 && my.sh
both error messages vanished. Perhaps that might help.