From d4288a778557ebfc2653bf9e570ae3f131702a14 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 17 Oct 2024 23:04:03 +0100 Subject: [PATCH] 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 --- .../tests/functional/test_functional_basic.py | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/bitbake/lib/toaster/tests/functional/test_functional_basic.py index e4070fbb88..e2d1c7dd86 100644 --- a/bitbake/lib/toaster/tests/functional/test_functional_basic.py +++ b/bitbake/lib/toaster/tests/functional/test_functional_basic.py @@ -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):