test_create_project.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. from selenium.webdriver.common.by import By
  2. from sentry.testutils.cases import AcceptanceTestCase
  3. from sentry.testutils.silo import region_silo_test
  4. @region_silo_test
  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('[data-test-id="create-team"]')
  16. self.browser.wait_until("[role='dialog']")
  17. input = self.browser.element('input[name="slug"]')
  18. input.send_keys("new-team")
  19. self.browser.element("[role='dialog'] form").submit()
  20. # After creating team, should end up in onboarding screen
  21. self.browser.wait_until(xpath='//div[text()="#new-team"]')
  22. self.browser.snapshot(name="create project no teams - after create 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. self.browser.snapshot(name="create project many teams")
  29. def test_select_correct_platform(self):
  30. self.create_team(organization=self.org, name="team three")
  31. self.browser.get(self.path)
  32. self.browser.wait_until_not(".loading")
  33. self.browser.click('[data-test-id="platform-javascript-react"]')
  34. self.browser.wait_until_not(".loading")
  35. self.browser.click('[data-test-id="create-project"]')
  36. self.browser.wait_until_not(".loading")
  37. self.browser.wait_until("h2")
  38. title = self.browser.find_element(by=By.CSS_SELECTOR, value="h2")
  39. assert "React" in title.text