|
@@ -20,21 +20,15 @@ from datetime import datetime
|
|
|
class DashboardTest(AcceptanceTestCase, SnubaTestCase):
|
|
|
def setUp(self):
|
|
|
super(DashboardTest, self).setUp()
|
|
|
- self.user = self.create_user("foo@example.com")
|
|
|
- self.org = self.create_organization(name="Rowdy Tiger", owner=None)
|
|
|
- self.team = self.create_team(organization=self.org, name="Mariachi Band")
|
|
|
- self.project = self.create_project(
|
|
|
- organization=self.org, teams=[self.team], name="Bengal-Elephant-Giraffe-Tree-House"
|
|
|
- )
|
|
|
- self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
|
|
|
-
|
|
|
- release = Release.objects.create(organization_id=self.org.id, version="1")
|
|
|
+ release = Release.objects.create(organization_id=self.organization.id, version="1")
|
|
|
|
|
|
- environment = Environment.objects.create(organization_id=self.org.id, name="production")
|
|
|
+ environment = Environment.objects.create(
|
|
|
+ organization_id=self.organization.id, name="production"
|
|
|
+ )
|
|
|
|
|
|
deploy = Deploy.objects.create(
|
|
|
environment_id=environment.id,
|
|
|
- organization_id=self.org.id,
|
|
|
+ organization_id=self.organization.id,
|
|
|
release=release,
|
|
|
date_finished="2018-05-23",
|
|
|
)
|
|
@@ -47,17 +41,9 @@ class DashboardTest(AcceptanceTestCase, SnubaTestCase):
|
|
|
)
|
|
|
|
|
|
self.login_as(self.user)
|
|
|
- self.path = u"/organizations/{}/projects/".format(self.org.slug)
|
|
|
-
|
|
|
- def test_project_with_no_first_event(self):
|
|
|
- self.project.update(first_event=None)
|
|
|
- self.browser.get(self.path)
|
|
|
- self.browser.wait_until_not(".loading-indicator")
|
|
|
- self.browser.wait_until_test_id("resources")
|
|
|
- self.browser.wait_until("[data-test-id] figure")
|
|
|
- self.browser.snapshot("org dash no first event")
|
|
|
+ self.path = u"/organizations/{}/projects/".format(self.organization.slug)
|
|
|
|
|
|
- def test_one_issue(self):
|
|
|
+ def create_sample_event(self):
|
|
|
self.init_snuba()
|
|
|
|
|
|
event_data = load_data("python")
|
|
@@ -77,21 +63,47 @@ class DashboardTest(AcceptanceTestCase, SnubaTestCase):
|
|
|
status=OnboardingTaskStatus.COMPLETE,
|
|
|
)
|
|
|
self.project.update(first_event=timezone.now())
|
|
|
+
|
|
|
+ def test_project_with_no_first_event(self):
|
|
|
+ self.project.update(first_event=None)
|
|
|
self.browser.get(self.path)
|
|
|
self.browser.wait_until_not(".loading-indicator")
|
|
|
- self.browser.wait_until("[data-test-id] figure")
|
|
|
+ self.browser.wait_until_test_id("resources")
|
|
|
+ self.browser.wait_until("[data-test-id] figure", timeout=10000)
|
|
|
+ self.browser.snapshot("org dash no first event")
|
|
|
+
|
|
|
+ def test_one_issue(self):
|
|
|
+ self.create_sample_event()
|
|
|
+ self.browser.get(self.path)
|
|
|
+ self.browser.wait_until_not(".loading-indicator")
|
|
|
+ self.browser.wait_until("[data-test-id] figure", timeout=100000)
|
|
|
self.browser.snapshot("org dash one issue")
|
|
|
|
|
|
+ def test_rename_team_and_navigate_back(self):
|
|
|
+ self.create_sample_event()
|
|
|
+ self.browser.get(self.path)
|
|
|
+ self.browser.wait_until_not(".loading-indicator")
|
|
|
+ self.browser.click('[data-test-id="badge-display-name"]')
|
|
|
+ self.browser.wait_until_not(".loading-indicator")
|
|
|
+ self.browser.click(".nav-tabs li:nth-child(3) a")
|
|
|
+ self.browser.wait_until('input[name="slug"]')
|
|
|
+ self.browser.element('input[name="slug"]').send_keys("-new-slug")
|
|
|
+ self.browser.click('[aria-label="Save"]')
|
|
|
+ self.browser.wait_until_not('[aria-label="Save"]')
|
|
|
+ self.browser.wait_until('[data-test-id="toast-success"]')
|
|
|
+
|
|
|
+ # Go to projects
|
|
|
+ self.browser.click('[href="/organizations/{}/projects/"]'.format(self.organization.slug))
|
|
|
+ self.browser.wait_until_not(".loading-indicator")
|
|
|
+
|
|
|
+ assert self.browser.element('[data-test-id="badge-display-name"]').text == "#foo-new-slug"
|
|
|
+
|
|
|
|
|
|
class EmptyDashboardTest(AcceptanceTestCase):
|
|
|
def setUp(self):
|
|
|
super(EmptyDashboardTest, self).setUp()
|
|
|
- self.user = self.create_user("foo@example.com")
|
|
|
- self.org = self.create_organization(name="Rowdy Tiger", owner=None)
|
|
|
- self.team = self.create_team(organization=self.org, name="Mariachi Band")
|
|
|
- self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
|
|
|
self.login_as(self.user)
|
|
|
- self.path = u"/organizations/{}/projects/".format(self.org.slug)
|
|
|
+ self.path = u"/organizations/{}/projects/".format(self.organization.slug)
|
|
|
|
|
|
def test_new_dashboard_empty(self):
|
|
|
self.browser.get(self.path)
|