test_replay_list.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. from datetime import datetime, timedelta
  2. from uuid import uuid4
  3. from sentry.replays.testutils import mock_replay
  4. from sentry.testutils import ReplaysAcceptanceTestCase
  5. FEATURE_NAME = ["organizations:session-replay", "organizations:session-replay-ui"]
  6. class ReplayListTest(ReplaysAcceptanceTestCase):
  7. def setUp(self):
  8. super().setUp()
  9. self.user = self.create_user("foo@example.com")
  10. self.org = self.create_organization(name="Rowdy Tiger", owner=None)
  11. self.team = self.create_team(organization=self.org, name="Mariachi Band 1")
  12. self.project = self.create_project(
  13. organization=self.org,
  14. teams=[self.team],
  15. name="Bengal",
  16. )
  17. self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  18. seq1_timestamp = datetime.now() - timedelta(seconds=52)
  19. seq2_timestamp = datetime.now() - timedelta(seconds=35)
  20. for replay_id in [uuid4().hex, uuid4().hex, uuid4().hex]:
  21. self.store_replays(
  22. [
  23. mock_replay(
  24. seq1_timestamp,
  25. self.project.id,
  26. replay_id,
  27. segment_id=0,
  28. urls=[
  29. "http://localhost/",
  30. "http://localhost/home/",
  31. "http://localhost/profile/",
  32. ],
  33. ),
  34. mock_replay(seq2_timestamp, self.project.id, replay_id, segment_id=1),
  35. ]
  36. )
  37. self.login_as(self.user)
  38. self.path = f"/organizations/{self.org.slug}/replays/"
  39. def test_simple(self):
  40. with self.feature(FEATURE_NAME):
  41. self.browser.get(self.path)
  42. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  43. self.browser.wait_until_not('[data-test-id="loading-placeholder"]')
  44. self.browser.snapshot("replay list")