test_organization_integration.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. from __future__ import absolute_import
  2. from exam import mock
  3. # from sentry.models import Integration
  4. from sentry.testutils import AcceptanceTestCase
  5. # from tests.acceptance.page_objects.organization_integration_settings import (
  6. # OrganizationIntegrationSettingsPage,
  7. # ExampleIntegrationSetupWindowElement,
  8. # )
  9. class OrganizationIntegrationAcceptanceTestCase(AcceptanceTestCase):
  10. def setUp(self):
  11. super(OrganizationIntegrationAcceptanceTestCase, self).setUp()
  12. self.login_as(self.user)
  13. self.integration_settings_path = "sentry-api-0-organization-integrations"
  14. def load_page(self, url):
  15. self.browser.get(url)
  16. self.browser.wait_until_not(".loading-indicator")
  17. class OrganizationIntegrationSettingsTest(OrganizationIntegrationAcceptanceTestCase):
  18. """
  19. As a user(type?), I can setup, configure, and remove an integration.
  20. """
  21. # TODO(lb): Tests to be written
  22. # test_setup_new_integration_with_repository
  23. # test_setup_new_integration_with_issue_sync
  24. # test_remove_existing_integration_installation
  25. # test_update_legacy_integration
  26. # test_user_permissions_for_integration_settings
  27. # test_add_multiple_integrations_to_one_provider
  28. # TODO(lb): check issues details page and see that integration shows in linked issues
  29. def setUp(self):
  30. super(OrganizationIntegrationSettingsTest, self).setUp()
  31. self.org_integration_settings_path = u"/settings/{}/integrations/".format(
  32. self.organization.slug
  33. )
  34. self.provider = mock.Mock()
  35. self.provider.key = "example"
  36. self.provider.name = "Example Installation"
  37. # def test_can_create_new_integration(self):
  38. # self.load_page(self.org_integration_settings_path)
  39. # org_settings_page = OrganizationIntegrationSettingsPage(browser=self.browser)
  40. # provider_element = org_settings_page.get_provider(self.provider)
  41. # # assert installation rather than upgrade button
  42. # assert provider_element.install_button.label == "Install"
  43. # integration_details_modal = org_settings_page.click_install_button(provider_element)
  44. # assert integration_details_modal.add_button.label == "Add %s" % self.provider.key
  45. # assert integration_details_modal.title == "%s Integration" % self.provider.key.capitalize()
  46. # integration_details_modal.add_button.click()
  47. # org_settings_page.click_through_integration_setup(
  48. # integration_details_modal,
  49. # ExampleIntegrationSetupWindowElement,
  50. # {"name": self.provider.name},
  51. # )
  52. # # provider_element might be rerendered
  53. # provider_element = org_settings_page.get_provider(self.provider)
  54. # installation_element = provider_element.get_installation_with_name(self.provider.name)
  55. # assert installation_element
  56. # assert Integration.objects.filter(
  57. # provider=self.provider.key, external_id=self.provider.name
  58. # ).exists()