test_create_project.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from sentry.testutils import AcceptanceTestCase
  2. from sentry.testutils.silo import region_silo_test
  3. @region_silo_test
  4. class CreateProjectTest(AcceptanceTestCase):
  5. def setUp(self):
  6. super().setUp()
  7. self.user = self.create_user("foo@example.com")
  8. self.org = self.create_organization(name="Rowdy Tiger")
  9. self.login_as(self.user)
  10. self.path = f"/organizations/{self.org.slug}/projects/new/"
  11. def test_no_teams(self):
  12. self.create_member(user=self.user, organization=self.org, role="owner", teams=[])
  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.create_member(
  27. user=self.user, organization=self.org, role="owner", teams=[self.team, self.team2]
  28. )
  29. self.browser.get(self.path)
  30. self.browser.wait_until_not(".loading")
  31. self.browser.snapshot(name="create project many teams")