Surface JS Errors from Selenium tests in CI (via test result report)
Sentry is setup/configured within application. Selenium checks to see if Raven is configured, if so it adds selenium-sessionid as a tag. At the end of test (tearedown), selenium checks to see if there were any errors. If errors occured, then hit Sentry events REST API to and obtains relevant (using selenium-sessionid tag) events/errors. The link to the errors are output to stdout, which is massaged into test result report (junit report). JUnit Test Report read in by CI.
- Set SENTRY_AUTH_TOKEN to generated auth token with proper permissions:
export SENTRY_AUTH_TOKEN=XXXXXXX
- Set SAUCE_USERNAME and SAUCE_ACCESS_KEY env var
- Run Sauce Connect (
make sc
) - Install dependencies/packages:
pip install -r requirements.txt
- Run App. See github.com/sentry-demos/react.
pytest --junitxml=report.xml test.py
-> This should run the tests on Sauce and javascript errors should be surfaced in report (soon will surface in console also)