test_teams_list.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. from django.utils import timezone
  2. from sentry.testutils.cases import AcceptanceTestCase
  3. class TeamsListTest(AcceptanceTestCase):
  4. def setUp(self):
  5. super().setUp()
  6. self.user = self.create_user("foo@example.com")
  7. self.org = self.create_organization(name="Rowdy Tiger", owner=None)
  8. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  9. self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  10. self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  11. self.login_as(self.user)
  12. # this should redirect to /settings/{}/teams/
  13. self.path = f"/organizations/{self.org.slug}/teams/"
  14. def test_simple(self):
  15. self.project.update(first_event=timezone.now())
  16. self.browser.get(self.path)
  17. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  18. self.browser.wait_until_test_id("team-list")
  19. self.browser.snapshot("organization teams list")
  20. # team details link
  21. self.browser.click('[data-test-id="team-list"] a[href]:first-child')
  22. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  23. self.browser.snapshot("organization team - members list")
  24. # Click projects tab
  25. self.browser.click(".nav-tabs li:nth-child(2) a")
  26. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  27. self.browser.snapshot("organization team - projects list")
  28. # Click projects tab
  29. self.browser.click(".nav-tabs li:nth-child(3) a")
  30. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  31. self.browser.snapshot("organization team - settings")