diff options
| author | Christophe Monniez <moc@odoo.com> | 2019-07-01 06:37:14 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2019-07-19 12:14:36 +0000 |
| commit | 0dc4a63e2dec57f3187501129f2670a3f4463e79 (patch) | |
| tree | 14a0350eb32511da2d1b59899a253df9a10cb140 /doc/reference/testing.rst | |
| parent | 1a49db046fdc87c6fb2e1aff8b2c92bd8f99f099 (diff) | |
[IMP] tests: save screenshots and screencasts in temp
Actually, when a browser_js test is running, screencasts and screenshots
are saved only if a "--logfile" parameter is specified.
This is problematic with the runbot because '--logfile' arg is not
provided when running tests. Also, in most situations, developpers
prefer to have logs on stdout.
With this commit, two CLI args are added to specify screencasts and
screenshots directories. If no screenshots dir is provided, it defaults
to "{tmp_dir}/odoo_tests/{db_name}/screenshots".
It means that screenshots are always enabled during browser_js tests.
If screencasts arg is given, it enables screencasts and save them in
"DIR/{db_name}/screencasts". If the screencasts parameter is "1", DIR
will be the same as for screenshots.
The ffmpeg tools is used to encode frames into a video. If the ffmpeg
tool is not found on the system, the frames are kept as pngs files
instead.
closes odoo/odoo#34640
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Diffstat (limited to 'doc/reference/testing.rst')
| -rw-r--r-- | doc/reference/testing.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/reference/testing.rst b/doc/reference/testing.rst index c1d9410bc4a..4175c709719 100644 --- a/doc/reference/testing.rst +++ b/doc/reference/testing.rst @@ -513,6 +513,20 @@ business flow. It explains a sequence of steps that should be followed. The test runner will then create a phantom_js browser, point it to the proper url and simulate the click and inputs, according to the scenario. +Screenshots and screencasts during browser_js tests +--------------------------------------------------- + +When running tests that use HttpCase.browser_js from the command line, the Chrome +browser is used in headless mode. By default, if a test fails, a PNG screenshot is +taken at the moment of the failure and written in + +.. code-block:: console + + '/tmp/odoo_tests/{db_name}/screenshots/' + +Two new command line arguments were added since Odoo 13.0 to control this behavior: +:option:`--screenshots <odoo-bin --screenshots>` and :option:`--screencasts <odoo-bin --screencasts>` + .. _qunit: http://qunitjs.com/ .. _qunit_config.js: https://github.com/odoo/odoo/blob/51ee0c3cb59810449a60dae0b086b49b1ed6f946/addons/web/static/tests/helpers/qunit_config.js#L49 |
