Skip to content
Snippets Groups Projects
Commit 96f456a2 authored by Pierre Paridans's avatar Pierre Paridans
Browse files

[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: default avatarChristophe Monniez (moc) <moc@odoo.com>
parent ac187676
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment