test_project_releases.py 2.4 KB

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