From edf4f5c781fa75ad1506912c4494006caddcaa4e Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Fri, 7 Feb 2020 11:47:52 +0000 Subject: [PATCH] [IMP] test_main_flows: execute main flow tour on mobile In this commit, we are still running the main flow tour on desktop but we also run it a second time on mobile. It's only available in enterprise, otherwise the test will be skipped. '375x667' correspond to the Bootstrap XS size. This value is already used for the mobile tests suite. Task ID: 2149402 --- .../addons/test_main_flows/tests/test_flow.py | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/odoo/addons/test_main_flows/tests/test_flow.py b/odoo/addons/test_main_flows/tests/test_flow.py index 2f359d4cccc..d450c335253 100644 --- a/odoo/addons/test_main_flows/tests/test_flow.py +++ b/odoo/addons/test_main_flows/tests/test_flow.py @@ -1,12 +1,12 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. +import odoo import odoo.tests +import unittest +class BaseTestUi(odoo.tests.HttpCase): -@odoo.tests.tagged('post_install', '-at_install') -class TestUi(odoo.tests.HttpCase): - - def test_01_main_flow_tour(self): + def main_flow_tour(self): # Define minimal accounting data to run without CoA a_expense = self.env['account.account'].create({ 'code': 'X2120', @@ -68,3 +68,21 @@ class TestUi(odoo.tests.HttpCase): }) self.start_tour("/web", 'main_flow_tour', login="admin", timeout=180) + +@odoo.tests.tagged('post_install', '-at_install') +class TestUi(BaseTestUi): + + def test_01_main_flow_tour(self): + self.main_flow_tour() + +@odoo.tests.tagged('post_install', '-at_install') +class TestUiMobile(BaseTestUi): + + browser_size = '375x667' + + def test_01_main_flow_tour_mobile(self): + + if odoo.release.version_info[-1] == 'e': + self.main_flow_tour() + else: + raise unittest.SkipTest("Mobile testing not needed in community")