From 96f456a226b82c1d72c5e398fd1c3d186fd77440 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Mon, 2 Sep 2019 11:38:44 +0000 Subject: [PATCH] [FIX] web: don't mock mobile test suite environment The mobile-specific code relies on the size of the browser <= SM (currently 767px). But when phantomjs was used to run the JS tests headlessly there was no way to force that size for the mobile test suite (e.g. when running from the command line, runbot...). The only solution was to mock some variables (isMobile, size_class) in web.config to force them to mobile-like values (see commits odoo/odoo@9bc5009481de188 and odoo/odoo@497dfb691774bd7b8). Since the switch to Chrome Headless the browser size is set to a mobile-friendly size (currently 375x667) when the mobile test suite is ran. So isMobile is automatically set to true. The code to mock the web.config has then become redundant. This commit removes it to only rely on the browser window size for the mobile test suite execution. Notes: When testing manually in the browser it's now required to set the browser window to a mobile-friendly size. Even if it was already the case, it will provide a more realistic environment and allows to test important/behavior-related media queries (e.g. clicking on a button only visible/present on mobile). BTW the easiest way to run all tests is to execute them directly using Chrome Headless (except for debugging of course). closes odoo/odoo#36328 Signed-off-by: Christophe Monniez (moc) --- addons/web/views/webclient_templates.xml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml index c45ea0a3e2b01..07ef5d9c7b491 100644 --- a/addons/web/views/webclient_templates.xml +++ b/addons/web/views/webclient_templates.xml @@ -720,30 +720,6 @@ Web Mobile Tests - -