test_replay_list.py 2.2 KB

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