test_organization_releases.py 3.6 KB

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