test_sidebar.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import pytest
  2. from sentry.testutils import AcceptanceTestCase
  3. class SidebarTest(AcceptanceTestCase):
  4. def setUp(self):
  5. super().setUp()
  6. self.user = self.create_user("foo@example.com")
  7. self.login_as(self.user)
  8. self.create_organization(name="Foo Foo Foo Foo Foo Foo Foo", owner=self.user)
  9. self.create_organization(name="Bar Bar Bar Bar Bar Bar Bar", owner=self.user)
  10. self.path = "/"
  11. @pytest.mark.skip("Tests are flaking cause of org name being inconsistent")
  12. def test_new_sidebar(self):
  13. self.browser.get(self.path)
  14. self.browser.wait_until_not(".loading")
  15. self.browser.click('[data-test-id="sidebar-dropdown"]')
  16. self.browser.move_to('[data-test-id="sidebar-switch-org"]')
  17. self.browser.wait_until_test_id("sidebar-switch-org-menu")
  18. self.browser.snapshot("sidebar - switch org expanded")
  19. self.browser.click('[data-test-id="sidebar-collapse"]')
  20. self.browser.snapshot("sidebar - collapsed")
  21. self.browser.click('[data-test-id="sidebar-broadcasts"]')
  22. self.browser.wait_until_test_id("sidebar-broadcasts-panel")
  23. self.browser.snapshot("sidebar - broadcasts panel")
  24. self.browser.click("footer")
  25. self.browser.wait_until_not('[data-test-id="sidebar-broadcasts-panel"]')
  26. def test_help_search(self):
  27. self.browser.get(self.path)
  28. self.browser.wait_until_not('[data-test-id="loading-indicator"]')
  29. self.browser.wait_until_test_id("help-sidebar")
  30. self.browser.click('[data-test-id="help-sidebar"]')
  31. self.browser.wait_until_test_id("search-docs-and-faqs")
  32. self.browser.click('[data-test-id="search-docs-and-faqs"]')
  33. self.browser.wait_until(
  34. 'input[placeholder="Search for documentation, FAQs, blog posts..."]'
  35. )
  36. def test_sandbox_sidebar(self):
  37. user = self.create_user("another@example.com")
  38. self.create_member(user=user, organization=self.organization, role="member", teams=[])
  39. self.login_as(user)
  40. with self.settings(DEMO_MODE=True):
  41. self.browser.get(self.path)
  42. self.browser.wait_until_not(".loading")
  43. self.browser.click('[data-test-id="sidebar-dropdown"]')
  44. self.browser.snapshot("sidebar - sandbox mode expanded")