test_member_list.py 1.2 KB

12345678910111213141516171819202122232425262728
  1. from sentry.models import OrganizationMember
  2. from sentry.testutils import AcceptanceTestCase
  3. class ListOrganizationMembersTest(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.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  10. OrganizationMember.objects.create(
  11. email="bar@example.com", organization=self.org, role="member"
  12. )
  13. self.create_member(
  14. user=self.create_user("baz@example.com"),
  15. organization=self.org,
  16. role="admin",
  17. teams=[self.team],
  18. )
  19. self.login_as(self.user)
  20. def test_list(self):
  21. self.browser.get(f"/organizations/{self.org.slug}/members/")
  22. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  23. self.browser.snapshot(name="list organization members")
  24. assert self.browser.element_exists_by_test_id("email-invite")
  25. assert self.browser.element_exists_by_aria_label("Resend invite")