test_chart_renderer.py 809 B

12345678910111213141516171819202122232425
  1. from sentry.testutils import AcceptanceTestCase
  2. class TestChartRenderer(AcceptanceTestCase):
  3. def test_debug_renders(self):
  4. options = {
  5. "chart-rendering.enabled": True,
  6. "system.url-prefix": self.browser.live_server_url,
  7. }
  8. with self.options(options):
  9. self.browser.get("debug/chart-renderer/")
  10. images = self.browser.elements(selector="img")
  11. assert len(images) > 0
  12. for image in images:
  13. src = image.get_attribute("src")
  14. resp = self.client.get(src)
  15. # Ensure our chart images actually look like pngs
  16. assert resp.status_code == 200
  17. assert next(resp.streaming_content)[:4] == b"\x89PNG"
  18. self.browser.snapshot("chart renderer debug view via chartcuterie")