test_create_project.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from selenium.webdriver.common.by import By
  2. from sentry.testutils.cases import AcceptanceTestCase
  3. from sentry.testutils.silo import no_silo_test
  4. @no_silo_test(stable=True)
  5. class CreateProjectTest(AcceptanceTestCase):
  6. def setUp(self):
  7. super().setUp()
  8. self.user = self.create_user("foo@example.com")
  9. self.org = self.create_organization(name="Rowdy Tiger", owner=self.user)
  10. self.login_as(self.user)
  11. self.path = f"/organizations/{self.org.slug}/projects/new/"
  12. def test_no_teams(self):
  13. self.browser.get(self.path)
  14. self.browser.wait_until_not(".loading")
  15. self.browser.click(None, "//*[text()='Select a Team']")
  16. self.browser.click('[data-test-id="create-team-option"]')
  17. self.browser.wait_until("[role='dialog']")
  18. input = self.browser.element('input[name="slug"]')
  19. input.send_keys("new-team")
  20. self.browser.element("[role='dialog'] form").submit()
  21. # After creating team, should end up in onboarding screen
  22. self.browser.wait_until(xpath='//div[text()="#new-team"]')
  23. def test_many_teams(self):
  24. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  25. self.team2 = self.create_team(organization=self.org, name="team two")
  26. self.browser.get(self.path)
  27. self.browser.wait_until_not(".loading")
  28. def test_select_correct_platform(self):
  29. self.create_team(organization=self.org, name="team three")
  30. self.browser.get(self.path)
  31. self.browser.wait_until_not(".loading")
  32. self.browser.click('[data-test-id="platform-javascript-react"]')
  33. self.browser.wait_until_not(".loading")
  34. self.browser.click('[data-test-id="create-project"]')
  35. self.browser.wait_until_not(".loading")
  36. self.browser.wait_until("h2")
  37. title = self.browser.find_element(by=By.CSS_SELECTOR, value="h2")
  38. assert "React" in title.text