diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-09 16:16:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:03:24 +0000 |
commit | 707ffa79aff5835c7f4314745e5164da2c3aaa3c (patch) | |
tree | 9ed5666c412f782d09eb4e3cf45fc14e99aad3d5 /bitbake/lib/toaster/tests/browser | |
parent | 6031006582ce770c9a676bdb599ce71922092fc0 (diff) | |
download | poky-707ffa79aff5835c7f4314745e5164da2c3aaa3c.tar.gz |
bitbake: toaster: Test jumbotron links visible and clickable
Test that the followings link are visible and clickable:
- OpenEmbedded
- BitBake
- Yocto Project
- Read the Toaster manual
- Contribute to Toaster
- Fixed typo: using instead of usign line:97
- Remove whitespace
(Bitbake rev: d4c35eaff3c152ee864a886aac8ad5476f7f29f7)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_landing_page.py | 89 |
1 files changed, 88 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_landing_page.py b/bitbake/lib/toaster/tests/browser/test_landing_page.py index 771e627a8d..7b4253446a 100644 --- a/bitbake/lib/toaster/tests/browser/test_landing_page.py +++ b/bitbake/lib/toaster/tests/browser/test_landing_page.py | |||
@@ -11,7 +11,7 @@ from django.urls import reverse | |||
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | 13 | ||
14 | from orm.models import Project, Build | 14 | from orm.models import Layer, Layer_Version, Project, Build |
15 | 15 | ||
16 | class TestLandingPage(SeleniumTestCase): | 16 | class TestLandingPage(SeleniumTestCase): |
17 | """ Tests for redirects on the landing page """ | 17 | """ Tests for redirects on the landing page """ |
@@ -60,6 +60,93 @@ class TestLandingPage(SeleniumTestCase): | |||
60 | 'http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual') | 60 | 'http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual') |
61 | self.assertTrue("Documentation" in documentation_link.text) | 61 | self.assertTrue("Documentation" in documentation_link.text) |
62 | 62 | ||
63 | def test_openembedded_jumbotron_link_visible_and_clickable(self): | ||
64 | """ Test OpenEmbedded link jumbotron is visible and clickable: """ | ||
65 | self.get(reverse('landing')) | ||
66 | jumbotron = self.find('.jumbotron') | ||
67 | |||
68 | # check OpenEmbedded | ||
69 | openembedded = jumbotron.find_element_by_link_text('OpenEmbedded') | ||
70 | self.assertTrue(openembedded.is_displayed()) | ||
71 | openembedded.click() | ||
72 | self.assertTrue("openembedded.org" in self.driver.current_url) | ||
73 | |||
74 | def test_bitbake_jumbotron_link_visible_and_clickable(self): | ||
75 | """ Test BitBake link jumbotron is visible and clickable: """ | ||
76 | self.get(reverse('landing')) | ||
77 | jumbotron = self.find('.jumbotron') | ||
78 | |||
79 | # check BitBake | ||
80 | bitbake = jumbotron.find_element_by_link_text('BitBake') | ||
81 | self.assertTrue(bitbake.is_displayed()) | ||
82 | bitbake.click() | ||
83 | self.assertTrue("yoctoproject.org/software-item/bitbake" in self.driver.current_url) | ||
84 | |||
85 | def test_yoctoproject_jumbotron_link_visible_and_clickable(self): | ||
86 | """ Test Yocto Project link jumbotron is visible and clickable: """ | ||
87 | self.get(reverse('landing')) | ||
88 | jumbotron = self.find('.jumbotron') | ||
89 | |||
90 | # check Yocto Project | ||
91 | yoctoproject = jumbotron.find_element_by_link_text('Yocto Project') | ||
92 | self.assertTrue(yoctoproject.is_displayed()) | ||
93 | yoctoproject.click() | ||
94 | self.assertTrue("yoctoproject.org" in self.driver.current_url) | ||
95 | |||
96 | def test_link_setup_using_toaster_visible_and_clickable(self): | ||
97 | """ Test big magenta button setting up and using toaster link in jumbotron | ||
98 | if visible and clickable | ||
99 | """ | ||
100 | self.get(reverse('landing')) | ||
101 | jumbotron = self.find('.jumbotron') | ||
102 | |||
103 | # check Big magenta button | ||
104 | big_magenta_button = jumbotron.find_element_by_link_text( | ||
105 | 'Toaster is ready to capture your command line builds' | ||
106 | ) | ||
107 | self.assertTrue(big_magenta_button.is_displayed()) | ||
108 | big_magenta_button.click() | ||
109 | self.assertTrue("docs.yoctoproject.org/toaster-manual/setup-and-use.html#setting-up-and-using-toaster" in self.driver.current_url) | ||
110 | |||
111 | def test_link_create_new_project_in_jumbotron_visible_and_clickable(self): | ||
112 | """ Test big blue button create new project jumbotron if visible and clickable """ | ||
113 | # Create a layer and a layer version to make visible the big blue button | ||
114 | layer = Layer.objects.create(name='bar') | ||
115 | Layer_Version.objects.create(layer=layer) | ||
116 | |||
117 | self.get(reverse('landing')) | ||
118 | jumbotron = self.find('.jumbotron') | ||
119 | |||
120 | # check Big Blue button | ||
121 | big_blue_button = jumbotron.find_element_by_link_text( | ||
122 | 'Create your first Toaster project to run manage builds' | ||
123 | ) | ||
124 | self.assertTrue(big_blue_button.is_displayed()) | ||
125 | big_blue_button.click() | ||
126 | self.assertTrue("toastergui/newproject/" in self.driver.current_url) | ||
127 | |||
128 | def test_toaster_manual_link_visible_and_clickable(self): | ||
129 | """ Test Read the Toaster manual link jumbotron is visible and clickable: """ | ||
130 | self.get(reverse('landing')) | ||
131 | jumbotron = self.find('.jumbotron') | ||
132 | |||
133 | # check Read the Toaster manual | ||
134 | toaster_manual = jumbotron.find_element_by_link_text('Read the Toaster manual') | ||
135 | self.assertTrue(toaster_manual.is_displayed()) | ||
136 | toaster_manual.click() | ||
137 | self.assertTrue("https://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual" in self.driver.current_url) | ||
138 | |||
139 | def test_contrib_to_toaster_link_visible_and_clickable(self): | ||
140 | """ Test Contribute to Toaster link jumbotron is visible and clickable: """ | ||
141 | self.get(reverse('landing')) | ||
142 | jumbotron = self.find('.jumbotron') | ||
143 | |||
144 | # check Contribute to Toaster | ||
145 | contribute_to_toaster = jumbotron.find_element_by_link_text('Contribute to Toaster') | ||
146 | self.assertTrue(contribute_to_toaster.is_displayed()) | ||
147 | contribute_to_toaster.click() | ||
148 | self.assertTrue("wiki.yoctoproject.org/wiki/contribute_to_toaster" in str(self.driver.current_url).lower()) | ||
149 | |||
63 | def test_only_default_project(self): | 150 | def test_only_default_project(self): |
64 | """ | 151 | """ |
65 | No projects except default | 152 | No projects except default |