mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 21:32:12 +02:00
bitbake: toaster/tests/functional_basic: Reuse common project creation code
Switch this test module to use the common project creation code which contains race fixes. That code requires the database access wrapper be dropped and we no longer have ordering constraints. (Bitbake rev: f015d96e28d89fd0aef76ff127ebde8613125a66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -17,8 +17,6 @@ from selenium.webdriver.common.by import By
|
||||
from tests.functional.utils import get_projectId_from_url
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@pytest.mark.order("second_to_last")
|
||||
class FuntionalTestBasic(SeleniumFunctionalTestCase):
|
||||
"""Basic functional tests for Toaster"""
|
||||
project_id = None
|
||||
@@ -26,25 +24,7 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
|
||||
def setUp(self):
|
||||
super(FuntionalTestBasic, self).setUp()
|
||||
if not FuntionalTestBasic.project_id:
|
||||
self._create_slenium_project()
|
||||
current_url = self.driver.current_url
|
||||
FuntionalTestBasic.project_id = get_projectId_from_url(current_url)
|
||||
|
||||
# testcase (1514)
|
||||
def _create_slenium_project(self):
|
||||
project_name = 'selenium-project'
|
||||
self.get(reverse('newproject'))
|
||||
self.wait_until_visible('#new-project-name', poll=3)
|
||||
self.driver.find_element(By.ID, "new-project-name").send_keys(project_name)
|
||||
self.driver.find_element(By.ID, 'projectversion').click()
|
||||
self.driver.find_element(By.ID, "create-project-button").click()
|
||||
element = self.wait_until_visible('#project-created-notification', poll=10)
|
||||
self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown')
|
||||
self.assertTrue(project_name in element.text,
|
||||
"New project name not in new project notification")
|
||||
self.assertTrue(Project.objects.filter(name=project_name).count(),
|
||||
"New project not found in database")
|
||||
return Project.objects.last().id
|
||||
FuntionalTestBasic.project_id = self.create_new_project('selenium-project', '3', None, False)
|
||||
|
||||
# testcase (1515)
|
||||
def test_verify_left_bar_menu(self):
|
||||
|
||||
Reference in New Issue
Block a user