test_organization_releases.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. from datetime import datetime
  2. from django.utils import timezone
  3. from sentry.testutils import AcceptanceTestCase
  4. from sentry.testutils.silo import region_silo_test
  5. @region_silo_test(stable=True)
  6. class OrganizationReleasesTest(AcceptanceTestCase):
  7. release_date = datetime(2020, 5, 18, 15, 13, 58, 132928, tzinfo=timezone.utc)
  8. def setUp(self):
  9. super().setUp()
  10. self.user = self.create_user("foo@example.com")
  11. self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
  12. self.team = self.create_team(
  13. organization=self.org, name="Mariachi Band", members=[self.user]
  14. )
  15. self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  16. self.project2 = self.create_project(
  17. organization=self.org, teams=[self.team], name="Bengal 2"
  18. )
  19. self.create_project(organization=self.org, teams=[self.team], name="Bengal 3")
  20. self.login_as(self.user)
  21. self.path = f"/organizations/{self.org.slug}/releases/"
  22. self.project.update(first_event=timezone.now())
  23. def test_list(self):
  24. self.create_release(project=self.project, version="1.0", date_added=self.release_date)
  25. self.browser.get(self.path)
  26. self.browser.wait_until_not(".loading")
  27. self.browser.snapshot("organization releases - with releases")
  28. # TODO(releases): add health data
  29. def test_detail(self):
  30. release = self.create_release(
  31. project=self.project, version="1.0", date_added=self.release_date
  32. )
  33. self.browser.get(self.path + release.version)
  34. self.browser.wait_until_not(".loading")
  35. self.browser.wait_until_test_id("release-wrapper")
  36. self.browser.wait_until_not('[data-test-id="loading-placeholder"]')
  37. self.browser.snapshot("organization releases - detail")
  38. # TODO(releases): add health data
  39. def test_detail_pick_project(self):
  40. release = self.create_release(
  41. project=self.project,
  42. additional_projects=[self.project2],
  43. version="1.0",
  44. date_added=self.release_date,
  45. )
  46. self.browser.get(self.path + release.version)
  47. self.browser.wait_until_not(".loading")
  48. assert "Select a project to continue" in self.browser.element("[role='dialog'] header").text
  49. # This is snapshotting features that are enable through the discover and performance features.
  50. def test_detail_with_discover_and_performance(self):
  51. with self.feature(["organizations:discover-basic", "organizations:performance-view"]):
  52. release = self.create_release(
  53. project=self.project, version="1.0", date_added=self.release_date
  54. )
  55. self.browser.get(self.path + release.version)
  56. self.browser.wait_until_not(".loading")
  57. self.browser.wait_until_test_id("release-wrapper")
  58. self.browser.wait_until_not('[data-test-id="loading-placeholder"]')
  59. self.browser.snapshot("organization releases - detail with discover and performance")
  60. # TODO(releases): add health data