[FIX] website: the rte tour was undeterministic
The tour try to click on the language dropdown before the reloading of the page if the server is slow. To fix it, we avoid the reloading by the rte, and trigger the reload in '_reload' method of editor menu who add the class 'o_wait_reload'. We add a selector and trigger in the test to avoid undeterministic error. closes odoo/odoo#36098 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -113,7 +113,7 @@ var EditorMenu = Widget.extend({
|
||||
save: function (reload) {
|
||||
var self = this;
|
||||
this.trigger_up('edition_will_stopped');
|
||||
return this.wysiwyg.save(true).then(function (result) {
|
||||
return this.wysiwyg.save(false).then(function (result) {
|
||||
var $wrapwrap = $('#wrapwrap');
|
||||
self.editable($wrapwrap).removeClass('o_editable');
|
||||
if (result.isDirty && reload !== false) {
|
||||
|
||||
@@ -91,7 +91,7 @@ var WysiwygMultizone = Wysiwyg.extend({
|
||||
save: function () {
|
||||
if (this.isDirty()) {
|
||||
return this._restoreMegaMenus()
|
||||
.then(() => this.editor.save())
|
||||
.then(() => this.editor.save(false))
|
||||
.then(() => ({isDirty: true}));
|
||||
} else {
|
||||
return {isDirty: false};
|
||||
|
||||
@@ -70,7 +70,7 @@ tour.register('rte_translator', {
|
||||
}, {
|
||||
content : "click language dropdown",
|
||||
trigger : '.js_language_selector .dropdown-toggle',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor))',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit"]',
|
||||
}, {
|
||||
content: "click on french version",
|
||||
trigger: '.js_language_selector a[data-url_code="fr_BE"]',
|
||||
@@ -91,6 +91,7 @@ tour.register('rte_translator', {
|
||||
action_helper.text('translated french text');
|
||||
Wysiwyg.setRange(this.$anchor.contents()[0], 22);
|
||||
this.$anchor.trigger($.Event( "keyup", {key: '_', keyCode: 95}));
|
||||
this.$anchor.trigger('input');
|
||||
},
|
||||
}, {
|
||||
content: "translate text with special char",
|
||||
@@ -100,6 +101,7 @@ tour.register('rte_translator', {
|
||||
this.$anchor.prepend('<{translated}>');
|
||||
Wysiwyg.setRange(this.$anchor.contents()[0], 0);
|
||||
this.$anchor.trigger($.Event( "keyup", {key: '_', keyCode: 95}));
|
||||
this.$anchor.trigger('input');
|
||||
},
|
||||
}, {
|
||||
content: "click on input",
|
||||
@@ -120,6 +122,7 @@ tour.register('rte_translator', {
|
||||
}, {
|
||||
content: "check: content is translated",
|
||||
trigger: '#wrap p font:first:contains(translated french text)',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit_master"]',
|
||||
run: function () {}, // it's a check
|
||||
}, {
|
||||
content: "check: content with special char is translated",
|
||||
@@ -168,7 +171,7 @@ tour.register('rte_translator', {
|
||||
}, {
|
||||
content : "click language dropdown",
|
||||
trigger : '.js_language_selector .dropdown-toggle',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor))',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit"]',
|
||||
}, {
|
||||
content: "return in french",
|
||||
trigger : 'html[lang="en-US"] .js_language_selector .js_change_lang[data-url_code="fr_BE"]',
|
||||
|
||||
Reference in New Issue
Block a user