diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_new_project_page.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_new_project_page.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_new_project_page.py b/bitbake/lib/toaster/tests/browser/test_new_project_page.py index e20a1f686e..458bb6538d 100644 --- a/bitbake/lib/toaster/tests/browser/test_new_project_page.py +++ b/bitbake/lib/toaster/tests/browser/test_new_project_page.py | |||
@@ -6,11 +6,11 @@ | |||
6 | # | 6 | # |
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | |||
10 | from django.urls import reverse | 9 | from django.urls import reverse |
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 10 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | from selenium.webdriver.support.ui import Select | 11 | from selenium.webdriver.support.ui import Select |
13 | from selenium.common.exceptions import InvalidElementStateException | 12 | from selenium.common.exceptions import InvalidElementStateException |
13 | from selenium.webdriver.common.by import By | ||
14 | 14 | ||
15 | from orm.models import Project, Release, BitbakeVersion | 15 | from orm.models import Project, Release, BitbakeVersion |
16 | 16 | ||
@@ -47,7 +47,7 @@ class TestNewProjectPage(SeleniumTestCase): | |||
47 | 47 | ||
48 | url = reverse('newproject') | 48 | url = reverse('newproject') |
49 | self.get(url) | 49 | self.get(url) |
50 | 50 | self.wait_until_visible('#new-project-name', poll=3) | |
51 | self.enter_text('#new-project-name', project_name) | 51 | self.enter_text('#new-project-name', project_name) |
52 | 52 | ||
53 | select = Select(self.find('#projectversion')) | 53 | select = Select(self.find('#projectversion')) |
@@ -57,7 +57,8 @@ class TestNewProjectPage(SeleniumTestCase): | |||
57 | 57 | ||
58 | # We should get redirected to the new project's page with the | 58 | # We should get redirected to the new project's page with the |
59 | # notification at the top | 59 | # notification at the top |
60 | element = self.wait_until_visible('#project-created-notification') | 60 | element = self.wait_until_visible( |
61 | '#project-created-notification', poll=3) | ||
61 | 62 | ||
62 | self.assertTrue(project_name in element.text, | 63 | self.assertTrue(project_name in element.text, |
63 | "New project name not in new project notification") | 64 | "New project name not in new project notification") |
@@ -78,13 +79,20 @@ class TestNewProjectPage(SeleniumTestCase): | |||
78 | 79 | ||
79 | url = reverse('newproject') | 80 | url = reverse('newproject') |
80 | self.get(url) | 81 | self.get(url) |
82 | self.wait_until_visible('#new-project-name', poll=3) | ||
81 | 83 | ||
82 | self.enter_text('#new-project-name', project_name) | 84 | self.enter_text('#new-project-name', project_name) |
83 | 85 | ||
84 | select = Select(self.find('#projectversion')) | 86 | select = Select(self.find('#projectversion')) |
85 | select.select_by_value(str(self.release.pk)) | 87 | select.select_by_value(str(self.release.pk)) |
86 | 88 | ||
87 | element = self.wait_until_visible('#hint-error-project-name') | 89 | radio = self.driver.find_element(By.ID, 'type-new') |
90 | radio.click() | ||
91 | |||
92 | self.click("#create-project-button") | ||
93 | |||
94 | self.wait_until_present('#hint-error-project-name', poll=3) | ||
95 | element = self.find('#hint-error-project-name') | ||
88 | 96 | ||
89 | self.assertTrue(("Project names must be unique" in element.text), | 97 | self.assertTrue(("Project names must be unique" in element.text), |
90 | "Did not find unique project name error message") | 98 | "Did not find unique project name error message") |