diff mbox series

[9/9] toaster/test: Test single recipe page

Message ID 20231129225416.479526-9-alassane.yattara@savoirfairelinux.com
State New
Headers show
Series [1/9] toaster/tests: Update methods wait_until_~ to skip using time.sleep | expand

Commit Message

Alassane Yattara Nov. 29, 2023, 10:54 p.m. UTC
Test recipe page
    - Check if title is displayed
    - Check add recipe layer displayed
    - Check left section is displayed
        - Check recipe: name, summary, description, Version, Section,
        License, Approx. packages included, Approx. size, Recipe file

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
 .../tests/functional/test_project_page.py     | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
diff mbox series

Patch

diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py
index 771a8484..03f64f8f 100644
--- a/lib/toaster/tests/functional/test_project_page.py
+++ b/lib/toaster/tests/functional/test_project_page.py
@@ -756,3 +756,35 @@  class TestProjectPage(SeleniumFunctionalTestCase):
         self.assertTrue("Summary" in section.text)
         # Check layer description
         self.assertTrue("Description" in section.text)
+
+    def test_single_recipe_page(self):
+        """ Test recipe page
+            - Check if title is displayed
+            - Check add recipe layer displayed
+            - Check left section is displayed
+                - Check recipe: name, summary, description, Version, Section,
+                License, Approx. packages included, Approx. size, Recipe file
+        """
+        url = reverse("recipedetails", args=(1, 53428))
+        self.get(url)
+        self.wait_until_visible('.page-header')
+        # check title is displayed
+        self.assertTrue(self.find('.page-header h1').is_displayed())
+        # check add recipe layer displayed
+        add_recipe_layer_btn = self.find('#add-layer-btn')
+        self.assertTrue(add_recipe_layer_btn.is_displayed())
+        # check left section is displayed
+        section = self.find('.well')
+        # Check recipe name
+        self.assertTrue(
+            section.find_element(By.XPATH, '//h2[1]').is_displayed()
+        )
+        # Check recipe sections details info are displayed
+        self.assertTrue("Summary" in section.text)
+        self.assertTrue("Description" in section.text)
+        self.assertTrue("Version" in section.text)
+        self.assertTrue("Section" in section.text)
+        self.assertTrue("License" in section.text)
+        self.assertTrue("Approx. packages included" in section.text)
+        self.assertTrue("Approx. package size" in section.text)
+        self.assertTrue("Recipe file" in section.text)