<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/tests/test_js.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] web: restore post-test check for qunit-fixture elements</title>
<updated>2021-01-05T20:49:04+00:00</updated>
<author>
<name>Pierre Paridans</name>
<email>app@odoo.com</email>
</author>
<published>2021-01-04T20:30:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7f8e0fe4d2a47968bdcb136fd7e6d96a184f9eae'/>
<id>7f8e0fe4d2a47968bdcb136fd7e6d96a184f9eae</id>
<content type='text'>
Disabled in odoo/odoo@b992619840a70c600c50fac0383ad9396351af75
by mistake.

Also, restore the "failfast" for the QUnit tests (disabled in the same
commit...).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Disabled in odoo/odoo@b992619840a70c600c50fac0383ad9396351af75
by mistake.

Also, restore the "failfast" for the QUnit tests (disabled in the same
commit...).</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] auth_totp: notify user on activation and deactivation of OTP</title>
<updated>2020-09-10T12:50:20+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2020-08-21T10:39:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b992619840a70c600c50fac0383ad9396351af75'/>
<id>b992619840a70c600c50fac0383ad9396351af75</id>
<content type='text'>
Was not super visible, especially without HR as the dialog immediately
closes (limitation of the web client), or when an administrator user
massively disables totp.

Show a toast notification indicating the success of the action.

Also fix the logging of `totp_disable` so it correctly handles being
called on more than one record, and change the logging data to
&lt;browse_record&gt; (&lt;logins&gt;) across the board.

Also add a way to provide an action to execute after a notification:
by default nothing happens, which leads to dialogs not closing and
forms not reloading, and there is no good way to show a notification
and/then do some other thing, which is inconvenient.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Was not super visible, especially without HR as the dialog immediately
closes (limitation of the web client), or when an administrator user
massively disables totp.

Show a toast notification indicating the success of the action.

Also fix the logging of `totp_disable` so it correctly handles being
called on more than one record, and change the logging data to
&lt;browse_record&gt; (&lt;logins&gt;) across the board.

Also add a way to provide an action to execute after a notification:
by default nothing happens, which leads to dialogs not closing and
forms not reloading, and there is no good way to show a notification
and/then do some other thing, which is inconvenient.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: QUnit.only detection is now back in business</title>
<updated>2020-06-09T11:10:40+00:00</updated>
<author>
<name>Xavier Dubuc</name>
<email>xdu@odoo.com</email>
</author>
<published>2020-06-09T10:56:18+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c50cc1ddacb42bfc38a9830149c57b5277c6a4b7'/>
<id>c50cc1ddacb42bfc38a9830149c57b5277c6a4b7</id>
<content type='text'>
Assets bundle names have been changed in #48676 but QUnit.only uses check was
still using old names. This commit makes that check use the new names.

task-2274185

closes odoo/odoo#52687

Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Assets bundle names have been changed in #48676 but QUnit.only uses check was
still using old names. This commit makes that check use the new names.

task-2274185

closes odoo/odoo#52687

Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tests: log a warning when HttpCase test in at_install</title>
<updated>2019-10-30T12:35:23+00:00</updated>
<author>
<name>Christophe Monniez</name>
<email>moc@odoo.com</email>
</author>
<published>2019-10-25T11:27:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8d5da6e4be05428f3243f92c0464d3c1f6a43873'/>
<id>8d5da6e4be05428f3243f92c0464d3c1f6a43873</id>
<content type='text'>
When loading a page on an existing starting database, registry is not
fully loaded causing potential error when trying to access model
existing in database (views, menitem, ...) since model added in last
loaded module does not exist in registry.

Thus, executing browser js test may lead to errors when executed during
an update on a database with other modules installed.

HTTPCase should be executed post_install to ensure that registry is
fully loaded to avoid this problem.

Since HTTPCase are slower than other test, it is also a good idea to
execute them at the end, in order to prioritize fast fail.

With this commit, a warning is isued if such a test class is tagged to
run at install time.

While at it, remove deprecated at_install and post_install helpers and
remove the deprecated phantom_js alias.

closes odoo/odoo#39462

Signed-off-by: Christophe Monniez (moc) &lt;moc@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When loading a page on an existing starting database, registry is not
fully loaded causing potential error when trying to access model
existing in database (views, menitem, ...) since model added in last
loaded module does not exist in registry.

Thus, executing browser js test may lead to errors when executed during
an update on a database with other modules installed.

HTTPCase should be executed post_install to ensure that registry is
fully loaded to avoid this problem.

Since HTTPCase are slower than other test, it is also a good idea to
execute them at the end, in order to prioritize fast fail.

With this commit, a warning is isued if such a test class is tagged to
run at install time.

While at it, remove deprecated at_install and post_install helpers and
remove the deprecated phantom_js alias.

closes odoo/odoo#39462

Signed-off-by: Christophe Monniez (moc) &lt;moc@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: force desktop mode on mobile</title>
<updated>2019-10-18T12:41:39+00:00</updated>
<author>
<name>Romeo Fragomeli</name>
<email>rfr@odoo.com</email>
</author>
<published>2019-10-15T08:31:09+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9831ed08fe60f36244e8e941012ca6866cab3e16'/>
<id>9831ed08fe60f36244e8e941012ca6866cab3e16</id>
<content type='text'>
Before this commit, some views appeared broken on mobile.
We don't consider this as a bug because Odoo is not supposed
to be responsive in Community edition. This feature is only
available on Enterprise.

This commit aims at clarifying this situation by clearly moving
the base requirements to support browsers' responsive to the
Enterprise edition and stating that the Community edition only
targets desktop.

It's important to note that, for technical reasons, some
responsive-related JS/CSS code may still be present in the
Community codebase but they are not meant to provide any
explicit or implicit support for responsive/mobile devices.

Technically speaking, this commit removes the viewport meta tag.
This change will then force the "desktop-like" rendering even on
small screens for the Community edition and will keep the current
behavior (scaling/zooming on small screens) for the Enterprise edition.

By doing this we do not let the users think that something is broken
and must be fixed.

So,
in Community edition, desktop is always displayed;
In Enterprise edition, Responsive Web Design is available.

We also had to adapt a test to be able to apply XPath adding
viewport meta tag in enterprise.

Task ID: 2090202</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, some views appeared broken on mobile.
We don't consider this as a bug because Odoo is not supposed
to be responsive in Community edition. This feature is only
available on Enterprise.

This commit aims at clarifying this situation by clearly moving
the base requirements to support browsers' responsive to the
Enterprise edition and stating that the Community edition only
targets desktop.

It's important to note that, for technical reasons, some
responsive-related JS/CSS code may still be present in the
Community codebase but they are not meant to provide any
explicit or implicit support for responsive/mobile devices.

Technically speaking, this commit removes the viewport meta tag.
This change will then force the "desktop-like" rendering even on
small screens for the Community edition and will keep the current
behavior (scaling/zooming on small screens) for the Enterprise edition.

By doing this we do not let the users think that something is broken
and must be fixed.

So,
in Community edition, desktop is always displayed;
In Enterprise edition, Responsive Web Design is available.

We also had to adapt a test to be able to apply XPath adding
viewport meta tag in enterprise.

Task ID: 2090202</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: force mobile screen size for mobile suite</title>
<updated>2018-11-19T11:24:28+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2018-11-19T07:15:24+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=72f53c43b3b2a44f242eec9f7d5f0085bda72989'/>
<id>72f53c43b3b2a44f242eec9f7d5f0085bda72989</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch 11.0 up to 521414b1c10</title>
<updated>2018-05-02T17:36:16+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2018-05-02T17:36:16+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=87e21ccdc5c181960fa0d137e3ed880673032ca9'/>
<id>87e21ccdc5c181960fa0d137e3ed880673032ca9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: Explicitly decode the JS files in tests.</title>
<updated>2018-04-26T07:14:29+00:00</updated>
<author>
<name>Manuel Vázquez Acosta</name>
<email>mvaled@users.noreply.github.com</email>
</author>
<published>2018-04-26T07:14:29+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=33704bc7172ca602128767756fa49e09684a06fc'/>
<id>33704bc7172ca602128767756fa49e09684a06fc</id>
<content type='text'>
When in Python 3, then function `open` defaults to open the file in text mode
with and the encoding (if not passed) is taken from
`locale.getpreferredencoding`.

Using `getpreferredencoding` is not necessarily a good practice.  Because
files might no be encoded that way.

When testing Odoo not in runbot (which has LANG set to C.UTF-8) you may get:

Traceback (most recent call last):
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 24, in test_check_suite
    self._check_only_call('web.qunit_suite')
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 37, in _check_only_call
    if RE_ONLY.search(fp.read()):
  File "/home/gitlab-runner/virtualenvs/odoo11-MlnlRiTaP2/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4757: ordinal not in range(128)

The proposed solution is to read the file in binary mode, and decode to
unicode/str ourselves using utf-8.  We don't use the encoding argument of
`open`, so that the code works in both Python 3 and Python 2.

PR  #24434</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When in Python 3, then function `open` defaults to open the file in text mode
with and the encoding (if not passed) is taken from
`locale.getpreferredencoding`.

Using `getpreferredencoding` is not necessarily a good practice.  Because
files might no be encoded that way.

When testing Odoo not in runbot (which has LANG set to C.UTF-8) you may get:

Traceback (most recent call last):
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 24, in test_check_suite
    self._check_only_call('web.qunit_suite')
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 37, in _check_only_call
    if RE_ONLY.search(fp.read()):
  File "/home/gitlab-runner/virtualenvs/odoo11-MlnlRiTaP2/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4757: ordinal not in range(128)

The proposed solution is to read the file in binary mode, and decode to
unicode/str ourselves using utf-8.  We don't use the encoding argument of
`open`, so that the code works in both Python 3 and Python 2.

PR  #24434</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: add fail fast feature to qunit test suite</title>
<updated>2018-04-12T09:27:15+00:00</updated>
<author>
<name>Géry Debongnie</name>
<email>ged@odoo.com</email>
</author>
<published>2018-04-12T07:39:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=473edda86edd367a070084573d8b8cb46a7be2d4'/>
<id>473edda86edd367a070084573d8b8cb46a7be2d4</id>
<content type='text'>
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: increase timeout of test suite</title>
<updated>2018-04-11T14:51:43+00:00</updated>
<author>
<name>Christophe Monniez</name>
<email>moc@odoo.com</email>
</author>
<published>2018-04-11T14:51:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6527b69ee0688a72988e5f2d77311fab124a3113'/>
<id>6527b69ee0688a72988e5f2d77311fab124a3113</id>
<content type='text'>
As the test suite increases, the timeout has to follow until a better
solution is found (like a fail fast in Qunit).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the test suite increases, the timeout has to follow until a better
solution is found (like a fail fast in Qunit).
</pre>
</div>
</content>
</entry>
</feed>
