summaryrefslogtreecommitdiff
path: root/addons/web/tests
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-11-19 07:15:24 +0000
committerAaron Bohy <aab@odoo.com>2018-11-19 11:24:28 +0000
commit72f53c43b3b2a44f242eec9f7d5f0085bda72989 (patch)
treefece9cea5bb36b930528dbd88eebb9a703b8ee91 /addons/web/tests
parent8fc246da31aa2a1c770732ae97e0cb4e840f07cf (diff)
[IMP] web: force mobile screen size for mobile suite
Before this rev., the mobile js tests suite was run on a desktop like chrome-headless (1366x768). This can be a problem for this suite which tests mobile behaviors and thus clicks on parts of the interface that are only visible on small devices (thanks to scss media queries). This wasn't really a problem until now, because the test framework allowed to click on invisible elements. But it's no longer the case since the introduction of click helpers.
Diffstat (limited to 'addons/web/tests')
-rw-r--r--addons/web/tests/test_js.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/addons/web/tests/test_js.py b/addons/web/tests/test_js.py
index 04df8be91c1..71e96c8b3b8 100644
--- a/addons/web/tests/test_js.py
+++ b/addons/web/tests/test_js.py
@@ -10,14 +10,10 @@ RE_ONLY = re.compile('QUnit\.only\(')
@odoo.tests.tagged('post_install', '-at_install')
class WebSuite(odoo.tests.HttpCase):
- def test_01_js(self):
+ def test_js(self):
# webclient desktop test suite
self.phantom_js('/web/tests?mod=web&failfast', "", "", login='admin', timeout=1800)
- def test_02_js(self):
- # webclient mobile test suite
- self.phantom_js('/web/tests/mobile?mod=web&failfast', "", "", login='admin', timeout=1800)
-
def test_check_suite(self):
# verify no js test is using `QUnit.only` as it forbid any other test to be executed
self._check_only_call('web.qunit_suite')
@@ -35,3 +31,12 @@ class WebSuite(odoo.tests.HttpCase):
with open(filename, 'rb') as fp:
if RE_ONLY.search(fp.read().decode('utf-8')):
self.fail("`QUnit.only()` used in file %r" % asset['url'])
+
+
+@odoo.tests.tagged('post_install', '-at_install')
+class MobileWebSuite(odoo.tests.HttpCase):
+ browser_size = '375x667'
+
+ def test_mobile_js(self):
+ # webclient mobile test suite
+ self.phantom_js('/web/tests/mobile?mod=web&failfast', "", "", login='admin', timeout=1800)