test_account_settings.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import pytest
  2. from sentry.testutils import AcceptanceTestCase
  3. class AccountSettingsTest(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 Rowdy Tiger Rowdy Tiger", owner=None)
  8. self.team = self.create_team(
  9. organization=self.org, name="Mariachi Band Mariachi Band Mariachi Band"
  10. )
  11. self.project = self.create_project(
  12. organization=self.org, teams=[self.team], name="Bengal Bengal Bengal Bengal"
  13. )
  14. self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
  15. second_org = self.create_organization(name="Multiple Owners", owner=self.user)
  16. self.create_member(
  17. user=self.create_user("bar@example.com"), organization=second_org, role="owner"
  18. )
  19. self.login_as(self.user)
  20. # TODO(billy): Enable this and remove the slower tests below
  21. @pytest.mark.skip(
  22. reason="This will be faster but does not check if old django routes are redirecting"
  23. )
  24. def test_account_settings(self):
  25. with self.feature("organizations:onboarding"):
  26. path = "/settings/account/"
  27. self.browser.get(path)
  28. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  29. self.browser.snapshot("account settings")
  30. self.browser.click('[href="/settings/account/security/"]')
  31. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  32. self.browser.snapshot("account security settings")
  33. self.browser.click('[href="/settings/account/notifications/"]')
  34. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  35. self.browser.snapshot("account notification settings")
  36. self.browser.click_when_visible("#Alerts a")
  37. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  38. self.browser.snapshot('account notification - fine tune "Alerts"')
  39. self.browser.click('[href="/settings/account/emails/"]')
  40. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  41. self.browser.snapshot("account emails settings")
  42. self.browser.click('[href="/settings/account/subscriptions/"]')
  43. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  44. self.browser.snapshot("account subscriptions settings")
  45. self.browser.click('[href="/settings/account/authorizations/"]')
  46. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  47. self.browser.snapshot("account authorizations settings")
  48. self.browser.click('[href="/settings/account/identities/"]')
  49. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  50. self.browser.snapshot("account identities settings")
  51. self.browser.click('[href="/settings/account/close-account/"]')
  52. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  53. self.browser.snapshot("account settings - close account")
  54. def test_account_security_settings(self):
  55. with self.feature("organizations:onboarding"):
  56. self.browser.get("/settings/account/security/")
  57. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  58. self.browser.snapshot("account security settings")
  59. def test_account_notifications(self):
  60. with self.feature("organizations:onboarding"):
  61. self.browser.get("/settings/account/notifications/")
  62. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  63. self.browser.snapshot("account notification settings")
  64. self.browser.click_when_visible('[data-test-id="fine-tuning"]')
  65. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  66. self.browser.snapshot('account notification - fine tune "Alerts"')
  67. def test_account_emails_settings(self):
  68. with self.feature("organizations:onboarding"):
  69. self.browser.get("/settings/account/emails/")
  70. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  71. self.browser.snapshot("account emails settings")
  72. def test_account_subscriptions_settings(self):
  73. with self.feature("organizations:onboarding"):
  74. self.browser.get("/settings/account/subscriptions/")
  75. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  76. self.browser.snapshot("account subscriptions settings")
  77. def test_account_authorizations_settings(self):
  78. with self.feature("organizations:onboarding"):
  79. self.browser.get("/account/authorizations/")
  80. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  81. self.browser.snapshot("account authorizations settings")
  82. def test_account_identities_settings(self):
  83. with self.feature("organizations:onboarding"):
  84. self.browser.get("/settings/account/identities/")
  85. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  86. self.browser.snapshot("account identities settings")
  87. def test_close_account(self):
  88. with self.feature("organizations:onboarding"):
  89. self.browser.get("/account/remove/")
  90. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  91. self.browser.snapshot("account settings - close account")