From 0ed42f903c5ea10e64241ce4b85e6ddeb06d57c6 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 12 May 2021 10:22:32 +0000 Subject: [PATCH] [FIX] test_themes: add a test which goes over all theme tours This is a backport of [1] which at the same time finally enables the test to be able to test all theme tours. Notice that the tours should be improved so that each step properly checks that the previous step actually had an effect (as those tours are normally made to display to the user and were not designed for testing). However, this is already really useful as only checking if *entering* edit mode in each theme does not crash is already covering most issues that can be created when designing a theme at the moment. [1]: https://github.com/odoo/design-themes/commit/52fef46388ec880af78c5a5f3e6152c4510548f4 closes odoo/design-themes#532 Related: odoo/odoo#80936 Signed-off-by: Romain Derie (rde) --- test_themes/tests/test_crawl.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test_themes/tests/test_crawl.py b/test_themes/tests/test_crawl.py index 6d0c1591d..eed02bf9a 100644 --- a/test_themes/tests/test_crawl.py +++ b/test_themes/tests/test_crawl.py @@ -26,3 +26,18 @@ class Crawler(HttpCase): # 2. Test as admin self.authenticate('admin', 'admin') test_crawling() + + # Note: this test is also really useful to build the default pages + # automatically by adding cr.commit() at the end of the tour + def test_02_homepage_tour_every_theme(self): + # TODO All the theme tours that are runned during this test should be + # improved so that each step properly checks that the previous step + # actually had an effect (as those tours are normally made to display to + # the user and were not designed for testing). However, this is already + # really useful as only checking if *entering* edit mode in each theme + # does not crash is already covering most issues that can be created + # when designing a theme at the moment. + Website = self.env['website'] + websites_themes = Website.get_test_themes_websites() + for website in websites_themes: + self.start_tour(f"/?fw={website.id}", 'homepage', login='admin')