test_create_project.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. self.browser.snapshot(name="create project no teams - after create team")
  24. def test_many_teams(self):
  25. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  26. self.team2 = self.create_team(organization=self.org, name="team two")
  27. self.browser.get(self.path)
  28. self.browser.wait_until_not(".loading")
  29. self.browser.snapshot(name="create project many teams")
  30. def test_select_correct_platform(self):
  31. self.create_team(organization=self.org, name="team three")
  32. self.browser.get(self.path)
  33. self.browser.wait_until_not(".loading")
  34. self.browser.click('[data-test-id="platform-javascript-react"]')
  35. self.browser.wait_until_not(".loading")
  36. self.browser.click('[data-test-id="create-project"]')
  37. self.browser.wait_until_not(".loading")
  38. self.browser.wait_until("h2")
  39. title = self.browser.find_element(by=By.CSS_SELECTOR, value="h2")
  40. assert "React" in title.text