test_organization_releases.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from datetime import datetime
  2. from django.utils import timezone
  3. from sentry.testutils.cases import AcceptanceTestCase
  4. from sentry.testutils.silo import no_silo_test
  5. @no_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. # TODO(releases): add health data
  28. def test_detail(self):
  29. release = self.create_release(
  30. project=self.project, version="1.0", date_added=self.release_date
  31. )
  32. self.browser.get(self.path + release.version)
  33. self.browser.wait_until_not(".loading")
  34. self.browser.wait_until_test_id("release-wrapper")
  35. self.browser.wait_until_not('[data-test-id="loading-placeholder"]')
  36. # TODO(releases): add health data
  37. def test_detail_pick_project(self):
  38. release = self.create_release(
  39. project=self.project,
  40. additional_projects=[self.project2],
  41. version="1.0",
  42. date_added=self.release_date,
  43. )
  44. self.browser.get(self.path + release.version)
  45. self.browser.wait_until_not(".loading")
  46. assert "Select a project to continue" in self.browser.element("[role='dialog'] header").text
  47. # This is snapshotting features that are enable through the discover and performance features.
  48. def test_detail_with_discover_and_performance(self):
  49. with self.feature(["organizations:discover-basic", "organizations:performance-view"]):
  50. release = self.create_release(
  51. project=self.project, version="1.0", date_added=self.release_date
  52. )
  53. self.browser.get(self.path + release.version)
  54. self.browser.wait_until_not(".loading")
  55. self.browser.wait_until_test_id("release-wrapper")
  56. self.browser.wait_until_not('[data-test-id="loading-placeholder"]')
  57. # TODO(releases): add health data