Currently, in tour_compiler, to check that an element is actually
present in the DOM in a step, there are 2 possibilities.
- `isCheck: true` => Checks that the element is in the DOM.
The latter can be disabled.
- `run() {}` => Checks that the element is in the DOM (because this
is what is done by default). However, if the element is disabled,
the step will be aborted.
In the codebase, we can see a lot of `run() {} //it's a check` and
`isCheck:true`. However, the behavior is not exactly the same.
What's more, there are 2 ways to do "the same thing".
In order to clarify the turns API, it was decided to no longer put an
action (step.run) by default. (Previously, the default action was
the "click" action).
From then on, it is no longer necessary to stipulate
`step.isCheck: true` nor `run() {}`.
The corollary is that now, you must explicitly write `run: click`, if
you want the click action to be triggered on the target.
This commit sets the stage for making this change.
closesodoo/design-themes#801
Related: odoo/odoo#167743
Related: odoo/enterprise#63711
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
In this commit, we change rest of triggers in tours where an iframe is
selected (suite of #156653).
To do this, we use the :iframe HOOT pseudo-selector.
With this changes, we can now remove the getNodesFromSelector
function in odoo/addons/web_tour/static/src/tour_service/tour_utils.js
Note that in this previous function, a ([is-ready]="true") check was
made for iframe elements but was only necessary for few of them (7).
So, a stepUtils.waitIframeIsReady() has been added to check this state.
closesodoo/design-themes#783
Related: odoo/odoo#157217
Related: odoo/enterprise#58474
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
In PR [1], the duplicated navbars ids `o_main_nav` and `top_menu` are
replaced by classes, to avoid having the same ids multiple times in the
DOM. Note that for stability, the ids are kept for the desktop view
navbar.
This commit adapts the tests so they now consider the classes and not
the ids.
[1]: https://github.com/odoo/odoo/pull/146492
task-3609531
closesodoo/design-themes#780
X-original-commit: 103e544835
Related: odoo/odoo#156013
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: anelusia, artists, aviato, graphene, kiddo, loftspace, monglia,
notes, odoo_experts, paptic, test_custo, yes
The community PR [125824] introduces an automatic check on buttons to
add the `mb-2` class when several buttons follow each other, so that
they have space to breathe when split on multiple lines.
For consistency, this commit therefore removes most `mb-2` occurrences
on buttons within themes as long as they are alone on their line, but
keeps or adds the class when several buttons are next to each other.
[125824]: https://github.com/odoo/odoo/pull/125824
task-3369604
closesodoo/design-themes#680
Related: odoo/odoo#125824
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.
This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().
task-3292454
closesodoo/design-themes#678
Related: odoo/odoo#130248
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
This commit fixes the xpath that have been broken by the new
we-select-pager introducing a full height version of the shape UI in
the web_editor.
task-3266751
closesodoo/design-themes#653
Related: odoo/odoo#118253
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit permits to use the new utility to enter in edit mode. This
way, we make sure that the edit mode is enabled before testing the next
step of the test. This avoids race conditions during tests.
task-3203820
closesodoo/design-themes#656
X-original-commit: 38e0c87ae3
Related: odoo/odoo#120481
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
Before this commit, if a theme wanted to define a main font for their
theme and let the "headings", "navbar" and "buttons" ones use the same
they had to add this in their map:
```
'font': XXX,
'headings-font': null,
'navbar-font': null,
'button-font': null,
```
Indeed, without setting the "null" values, those font would use YYY
which is the first font defined in the theme config, which might be
different from XXX. And if forcing XXX 4 times, like most themes do at
the moment, if the user wanted to change them all, he had to change the
4 ones instead of the main one.
Now, only the 'font' value use the first font defined in the theme
config if not explicitly set. So forcing the null values is not
necessary, it will be the default behavior.
The advantage is thus also functional, as most theme forced all their 4
fonts so changing the main one did not change the others.
task-2993054
closesodoo/design-themes#593
X-original-commit: fc64bce81e
Related: odoo/odoo#101068
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
New test was introduced with [1] but it actually sometimes lead to
timeout errors.
That's a common issue since we merged the frontend in the backend and
some tour (like this one) now have to start both the backend and the
frontend (in the iframe).
10 seconds is not enough to load both, it often miss just half a second.
[1]: https://github.com/odoo/design-themes/commit/0e2497b8e84eab8957028f4d63ff0899a9fe6ab3
runbot-4684
closesodoo/design-themes#587
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit introduces a new theme for tests purpose.
The goal is to be able to create records and simulate a real use case
without only testing through unit tests in python.
For instance, with this commit, we now fully test:
- menu creation
- page creation
- new header & footer template
- new image shape & background shape
This will be extended later to be able to test other stuff too, maybe
like changing the website logo (not supported yet). Also, our existing
standalone test in themes should use this theme instead of nano to not
rely on a real theme that might change.
Courtesy of NMI as this theme is partly based on his job.
closesodoo/design-themes#586
Related: odoo/odoo#99099
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>