test_organization_integrations_settings.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from __future__ import absolute_import
  2. from sentry.models import Integration
  3. from sentry.testutils import AcceptanceTestCase
  4. from tests.sentry.plugins.testutils import register_mock_plugins, unregister_mock_plugins
  5. class OrganizationIntegrationSettingsTest(AcceptanceTestCase):
  6. def setUp(self):
  7. super(OrganizationIntegrationSettingsTest, self).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.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  12. self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  13. self.model = Integration.objects.create(
  14. provider="slack",
  15. external_id="some_slack",
  16. name="Test Slack",
  17. metadata={"domain_name": "slack-test.slack.com"},
  18. )
  19. self.org_integration = self.model.add_organization(self.org, self.user)
  20. register_mock_plugins()
  21. self.login_as(self.user)
  22. def tearDown(self):
  23. unregister_mock_plugins()
  24. def test_all_integrations_list(self):
  25. path = u"/settings/{}/integrations/".format(self.org.slug)
  26. self.browser.get(path)
  27. self.browser.wait_until_not(".loading-indicator")
  28. self.browser.snapshot("organization settings - all integrations")