test_api.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. from sentry.testutils.cases import AcceptanceTestCase
  2. from sentry.testutils.silo import no_silo_test
  3. @no_silo_test(stable=True)
  4. class ApiTokensTest(AcceptanceTestCase):
  5. def setUp(self):
  6. super().setUp()
  7. self.org = self.create_organization(name="Rowdy Tiger Rowdy Tiger Rowdy Tiger", owner=None)
  8. self.project = self.create_project(
  9. organization=self.org, teams=[self.team], name="Bengal Bengal Bengal Bengal"
  10. )
  11. self.login_as(self.user)
  12. self.path = "/api/"
  13. def test_simple(self):
  14. self.browser.get(self.path)
  15. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  16. self.browser.click_when_visible('[data-test-id="create-token"]')
  17. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  18. self.browser.click_when_visible('[data-test-id="form-submit"]')
  19. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  20. class ApiApplicationTest(AcceptanceTestCase):
  21. def setUp(self):
  22. super().setUp()
  23. self.org = self.create_organization(name="Rowdy Tiger Rowdy Tiger Rowdy Tiger", owner=None)
  24. self.project = self.create_project(
  25. organization=self.org, teams=[self.team], name="Bengal Bengal Bengal Bengal"
  26. )
  27. self.login_as(self.user)
  28. self.path = "/api/applications/"
  29. def test_simple(self):
  30. self.browser.get(self.path)
  31. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  32. self.browser.click_when_visible('[aria-label="Create New Application"]')
  33. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  34. self.browser.click('[href="/settings/account/api/applications/"]')
  35. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  36. self.browser.click_when_visible('[data-test-id="toast-success"]')
  37. self.browser.wait_until_not('[data-test-id="toast-success"]')
  38. self.browser.get(self.path)
  39. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  40. self.browser.click_when_visible('[aria-label="Remove"]')
  41. self.browser.wait_until_not('[data-test-id="toast-loading"]')
  42. self.browser.wait_until_test_id("empty-message")