diff mbox series

[2/3] Toaster: Test documentation link in landing header is displayed

Message ID 20231030222513.403014-2-alassane.yattara@savoirfairelinux.com
State New
Headers show
Series [1/3] Toaster: Check info_sign is visible and clickable in landing page | expand

Commit Message

Alassane Yattara Oct. 30, 2023, 10:25 p.m. UTC
- check that the documentation link is visible
- check browser open new tab toaster manual when clicking on the documentation link

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
 lib/toaster/tests/browser/test_landing_page.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Tim Orling Oct. 31, 2023, 3:30 p.m. UTC | #1
On Mon, Oct 30, 2023 at 3:25 PM Alassane Yattara <
alassane.yattara@savoirfairelinux.com> wrote:

> - check that the documentation link is visible
> - check browser open new tab toaster manual when clicking on the
> documentation link
>
> The test case seems reasonable and the explanation is sufficient.


> Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
>
Reviewed-by: Tim Orling <tim.orling@konsulko.com>

> ---
>  lib/toaster/tests/browser/test_landing_page.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/lib/toaster/tests/browser/test_landing_page.py
> b/lib/toaster/tests/browser/test_landing_page.py
> index 2f092400..e731af22 100644
> --- a/lib/toaster/tests/browser/test_landing_page.py
> +++ b/lib/toaster/tests/browser/test_landing_page.py
> @@ -46,6 +46,21 @@ class TestLandingPage(SeleniumTestCase):
>          self.assertTrue(info_modal.is_displayed())
>          self.assertTrue("Toaster version information" in info_modal.text)
>
> +    def test_documentation_link_displayed(self):
> +        """ Test that the documentation link is displayed """
> +        self.get(reverse('landing'))
> +        documentation_link = self.find('#navbar-docs > a')
> +
> +        # check that the documentation link is visible
> +        self.assertTrue(documentation_link.is_displayed())
> +
> +        # check browser open new tab toaster manual when clicking on the
> documentation link
> +        self.assertEqual(documentation_link.get_attribute('target') ,
> '_blank')
> +        self.assertEqual(
> +            documentation_link.get_attribute('href'),
> +            '
> http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual
> ')
> +        self.assertTrue("Documentation" in documentation_link.text)
> +
>      def test_only_default_project(self):
>          """
>          No projects except default
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5913):
> https://lists.yoctoproject.org/g/toaster/message/5913
> Mute This Topic: https://lists.yoctoproject.org/mt/102286634/924729
> Group Owner: toaster+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [
> ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/lib/toaster/tests/browser/test_landing_page.py b/lib/toaster/tests/browser/test_landing_page.py
index 2f092400..e731af22 100644
--- a/lib/toaster/tests/browser/test_landing_page.py
+++ b/lib/toaster/tests/browser/test_landing_page.py
@@ -46,6 +46,21 @@  class TestLandingPage(SeleniumTestCase):
         self.assertTrue(info_modal.is_displayed())
         self.assertTrue("Toaster version information" in info_modal.text)
 
+    def test_documentation_link_displayed(self):
+        """ Test that the documentation link is displayed """
+        self.get(reverse('landing'))
+        documentation_link = self.find('#navbar-docs > a')
+
+        # check that the documentation link is visible
+        self.assertTrue(documentation_link.is_displayed())
+        
+        # check browser open new tab toaster manual when clicking on the documentation link
+        self.assertEqual(documentation_link.get_attribute('target') , '_blank')
+        self.assertEqual(
+            documentation_link.get_attribute('href'), 
+            'http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual')
+        self.assertTrue("Documentation" in documentation_link.text)
+
     def test_only_default_project(self):
         """
         No projects except default