test_create_project.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_select_correct_platform(self):
  24. self.create_team(organization=self.org, name="team three")
  25. self.browser.get(self.path)
  26. self.browser.wait_until_not(".loading")
  27. self.browser.click('[data-test-id="platform-javascript-react"]')
  28. self.browser.wait_until_not(".loading")
  29. self.browser.click('[data-test-id="create-project"]')
  30. self.browser.wait_until_not(".loading")
  31. self.browser.wait_until("h2")
  32. title = self.browser.find_element(by=By.CSS_SELECTOR, value="h2")
  33. assert "React" in title.text