test_member_list.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. from sentry.models import OrganizationMember
  2. from sentry.testutils import AcceptanceTestCase
  3. from sentry.testutils.silo import region_silo_test
  4. @region_silo_test
  5. class ListOrganizationMembersTest(AcceptanceTestCase):
  6. def setUp(self):
  7. super().setUp()
  8. self.user = self.create_user("foo@example.com")
  9. self.org = self.create_organization(name="Rowdy Tiger", owner=None)
  10. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  11. self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  12. OrganizationMember.objects.create(
  13. email="bar@example.com", organization=self.org, role="member"
  14. )
  15. self.create_member(
  16. user=self.create_user("baz@example.com"),
  17. organization=self.org,
  18. role="admin",
  19. teams=[self.team],
  20. )
  21. self.login_as(self.user)
  22. def test_list(self):
  23. self.browser.get(f"/organizations/{self.org.slug}/members/")
  24. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  25. self.browser.snapshot(name="list organization members")
  26. assert self.browser.element_exists_by_test_id("email-invite")
  27. assert self.browser.element_exists_by_aria_label("Resend invite")