test_project_releases.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import pytest
  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
  6. class ProjectReleasesTest(AcceptanceTestCase):
  7. def setUp(self):
  8. super().setUp()
  9. self.user = self.create_user("foo@example.com")
  10. self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
  11. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  12. self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  13. self.login_as(self.user)
  14. self.path = f"/{self.org.slug}/{self.project.slug}/releases/"
  15. @pytest.mark.skip(reason="Sentry 9 only")
  16. def test_with_releases(self):
  17. release = self.create_release(project=self.project, version="1.0")
  18. self.create_group(first_release=release, project=self.project, message="Foo bar")
  19. self.project.update(first_event=timezone.now())
  20. self.browser.get(self.path)
  21. self.browser.wait_until_not(".loading")
  22. self.browser.wait_until(".ref-project-releases")
  23. self.browser.snapshot("project releases with releases")
  24. @pytest.mark.skip(reason="Sentry 9 only")
  25. def test_with_no_releases(self):
  26. self.browser.get(self.path)
  27. self.browser.wait_until_not(".loading")
  28. self.browser.wait_until(".ref-project-releases")
  29. self.browser.snapshot("project releases without releases")
  30. @region_silo_test
  31. class ProjectReleaseDetailsTest(AcceptanceTestCase):
  32. def setUp(self):
  33. super().setUp()
  34. self.user = self.create_user("foo@example.com")
  35. self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
  36. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  37. self.project = self.create_project(
  38. organization=self.org, teams=[self.team], name="Bengal", first_event=timezone.now()
  39. )
  40. self.release = self.create_release(project=self.project, version="1.0")
  41. self.create_group(first_release=self.release, project=self.project, message="Foo bar")
  42. self.login_as(self.user)
  43. self.path = f"/{self.org.slug}/{self.project.slug}/releases/{self.release.version}/"
  44. @pytest.mark.skip(reason="Sentry 9 only")
  45. def test_release_details_no_commits_no_deploys(self):
  46. self.browser.get(self.path)
  47. self.browser.wait_until_not(".loading")
  48. self.browser.wait_until(".ref-release-details")
  49. self.browser.snapshot("project release details no commits no deploys")