summaryrefslogtreecommitdiff
path: root/addons/web_tests/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_tests/static/src/js')
-rw-r--r--addons/web_tests/static/src/js/web.tour.js182
1 files changed, 159 insertions, 23 deletions
diff --git a/addons/web_tests/static/src/js/web.tour.js b/addons/web_tests/static/src/js/web.tour.js
index 53da3af357d..6d107a103db 100644
--- a/addons/web_tests/static/src/js/web.tour.js
+++ b/addons/web_tests/static/src/js/web.tour.js
@@ -34,12 +34,12 @@ Tour.register({
},
{
title: "insert body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'a'
},
{
title: "create new message",
- waitFor: 'textarea.field_text:propValue(a)',
+ waitFor: '.modal textarea.field_text:propValue(a)',
element: '.oe_abstractformpopup-form-save'
},
@@ -47,17 +47,18 @@ Tour.register({
{
title: "create new message",
- waitFor: '.oe_list_field_cell',
+ waitNot: '.modal',
+ waitFor: '.oe_application:has(.oe_list_field_cell):has(textarea[name="message_concat"]:propValue([test] Administrator:a))',
element: '.oe_form_field_one2many_list_row_add a'
},
{
title: "insert body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'b'
},
{
title: "create new message",
- waitFor: 'textarea.field_text:propValue(b)',
+ waitFor: '.modal textarea.field_text:propValue(b)',
element: '.oe_abstractformpopup-form-save'
},
@@ -65,27 +66,37 @@ Tour.register({
{
title: "insert title",
- waitFor: '.oe_list_field_cell:eq(2)',
+ waitNot: '.modal',
+ waitFor: 'textarea[name="message_concat"]:propValue([test] Administrator:a\n[test] Administrator:b)',
element: '.oe_form_required input',
- sampleText: 'test trigger'
+ sampleText: 'test_trigger'
+ },
+ {
+ title: "blur the title field",
+ waitFor: '.oe_form_required input:propValue(test_trigger)',
+ element: '.oe_form_field_many2one input:first',
+ },
+ {
+ title: "check onchange",
+ waitFor: 'textarea[name="message_concat"]:propValue([test_trigger] Administrator:a\n[test_trigger] Administrator:b)',
},
// change message b
{
title: "edit message b",
- waitFor: 'tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(1) .oe_list_field_cell:contains([test trigger] )',
+ waitFor: 'tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(1) .oe_list_field_cell:contains([test_trigger] )',
waitNot: 'tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(2)',
element: '.oe_list_field_cell:containsExact(b)'
},
{
title: "change the body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'bbb'
},
{
title: "save changes",
- waitFor: 'textarea.field_text:propValue(bbb)',
+ waitFor: '.modal textarea.field_text:propValue(bbb)',
element: '.oe_abstractformpopup-form-save'
},
@@ -94,17 +105,17 @@ Tour.register({
{
title: "create new message",
waitNot: '.modal',
- waitFor: 'tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(1) .oe_list_field_text:contains(bbb)',
+ waitFor: 'textarea[name="message_concat"]:propValue([test_trigger] Administrator:a\n[test_trigger] Administrator:bbb)',
element: '.oe_form_field_one2many_list_row_add a'
},
{
title: "insert body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'c'
},
{
title: "create new message",
- waitFor: 'textarea.field_text:propValue(c)',
+ waitFor: '.modal textarea.field_text:propValue(c)',
element: '.oe_abstractformpopup-form-save'
},
@@ -112,6 +123,7 @@ Tour.register({
{
title: "change tab to Participants",
+ waitNot: '.modal',
waitFor: '.oe_form_field_one2many .oe_list_field_cell:eq(3)',
element: '[data-toggle="tab"]:contains(Participants)'
},
@@ -152,7 +164,7 @@ Tour.register({
},
{
title: "check data 2",
- waitFor: '.oe_form_field_one2many tr:has(.oe_list_field_text:containsExact(bbb)):has(.oe_list_field_char:containsExact([test trigger] Administrator))',
+ waitFor: '.oe_form_field_one2many tr:has(.oe_list_field_text:containsExact(bbb)):has(.oe_list_field_char:containsExact([test_trigger] Administrator))',
},
{
title: "check data 3",
@@ -182,12 +194,12 @@ Tour.register({
},
{
title: "insert body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'd'
},
{
title: "create new message",
- waitFor: 'textarea.field_text:propValue(d)',
+ waitFor: '.modal textarea.field_text:propValue(d)',
element: '.oe_abstractformpopup-form-save'
},
@@ -195,17 +207,18 @@ Tour.register({
{
title: "create new message",
+ waitNot: '.modal',
waitFor: '.oe_list_field_cell:containsExact(d)',
element: '.oe_form_field_one2many_list_row_add a'
},
{
title: "insert body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'e'
},
{
title: "create new message",
- waitFor: 'textarea.field_text:propValue(e)',
+ waitFor: '.modal textarea.field_text:propValue(e)',
element: '.oe_abstractformpopup-form-save'
},
@@ -213,17 +226,18 @@ Tour.register({
{
title: "create new message",
+ waitNot: '.modal',
waitFor: '.oe_list_field_cell:containsExact(e)',
element: '.oe_list_field_cell:containsExact(a)'
},
{
title: "change the body",
- element: 'textarea.field_text',
+ element: '.modal textarea.field_text',
sampleText: 'aaa'
},
{
title: "save changes",
- waitFor: 'textarea.field_text:propValue(aaa)',
+ waitFor: '.modal textarea.field_text:propValue(aaa)',
element: '.oe_abstractformpopup-form-save'
},
@@ -231,8 +245,8 @@ Tour.register({
{
title: "remove b",
- waitFor: '.oe_list_field_text:contains(aaa)',
waitNot: '.modal',
+ waitFor: '.oe_list_field_text:contains(aaa)',
element: 'tr:has(.oe_list_field_cell:containsExact(bbb)) .oe_list_record_delete button'
},
{
@@ -240,6 +254,9 @@ Tour.register({
waitNot: 'tr:has(.oe_list_field_cell:containsExact(bbb))',
element: 'tr:has(.oe_list_field_cell:containsExact(e)) .oe_list_record_delete button'
},
+
+ // save
+
{
title: "save discussion",
waitNot: 'tr:has(.oe_list_field_cell:containsExact(e))',
@@ -258,7 +275,7 @@ Tour.register({
},
{
title: "check data 6",
- waitFor: '.oe_form_field_one2many tr:has(.oe_list_field_text:containsExact(aaa)):has(.oe_list_field_char:containsExact([test trigger] Administrator))',
+ waitFor: '.oe_form_field_one2many tr:has(.oe_list_field_text:containsExact(aaa)):has(.oe_list_field_char:containsExact([test_trigger] Administrator))',
},
{
title: "check data 7",
@@ -266,9 +283,128 @@ Tour.register({
waitNot: '.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(2)',
},
+ /////////////////////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////////////////////
+
{
- title: "finish",
+ title: "switch to the second form view to test one2many with editable list",
waitFor: '.oe_list_field_cell:eq(3)',
+ element: 'a.oe_menu_leaf:contains(Discussions 2)'
+ },
+
+ {
+ title: "switch to list view",
+ waitFor: ".oe_list_editable",
+ element: '.oe-cp-switch-list',
+ },
+ {
+ title: "select previous created record",
+ element: 'td[data-field="name"]:contains(test_trigger):last',
+ },
+ {
+ title: "click on edit",
+ element: '.oe_form_button_edit',
+ },
+
+ {
+ title: "click on a field of the editable list to edit content",
+ element: '.oe_list_editable tr[data-id]:eq(1) .oe_list_field_cell:eq(2)',
+ },
+ {
+ title: "change text value",
+ element: '.oe_form_field[data-fieldname="body"] textarea',
+ sampleText: 'ccc'
+ },
+ {
+ title: "click on a many2one (trigger the line onchange)",
+ element: '.oe_list_editable tr[data-id]:eq(1) .oe_list_field_cell:eq(1)',
+ },
+ {
+ title: "test on2many's line onchange",
+ waitFor: '.oe_list_editable tr[data-id]:eq(1) .oe_list_field_cell:eq(3):contains(3)',
+ },
+ {
+ title: "test on2many field not triggered onchange",
+ waitNot: 'textarea[name="message_concat"]:propValueContains(ccc)',
+ },
+
+ {
+ title: "open the many2one to select an other user",
+ element: '.oe_m2o_drop_down_button',
+ },
+ {
+ title: "select an other user",
+ element: '.oe_application li a:contains(Demo User)',
+ },
+ {
+ title: "test on2many's line onchange after many2one",
+ waitFor: '.oe_form_char_content:contains([test_trigger] Demo User)',
+ },
+ {
+ title: "test on2many field not triggered onchange",
+ waitNot: 'textarea[name="message_concat"]:propValueContains(ccc)',
+ },
+ {
+ title: "change text value",
+ element: '.oe_form_field[data-fieldname="body"] textarea',
+ sampleText: 'ccccc'
+ },
+
+ // check onchange
+
+ {
+ title: "click outside to trigger one2many onchange",
+ waitNot: 'textarea[name="message_concat"]:propValueContains(Demo User)',
+ element: '.oe_form_required input',
+ },
+ {
+ title: "test one2many onchange",
+ waitFor: 'textarea[name="message_concat"]:propValueContains([test_trigger] Demo User:ccccc)',
+ },
+
+ {
+ title: "click outside to trigger one2many onchange",
+ element: '.oe_tags .text-arrow',
+ },
+ {
+ title: "click outside to trigger one2many onchange",
+ element: '.text-label:first',
+ },
+
+ {
+ title: "click outside to trigger one2many onchange",
+ element: '.text-label:first',
+ },
+
+ // remove record
+
+ {
+ title: "delete the last item in the editable list",
+ element: '.oe_list_record_delete button:visible:last',
+ },
+ {
+ title: "test one2many onchange after delete",
+ waitNot: 'textarea[name="message_concat"]:propValueContains(Administrator:d)',
+ },
+
+ // save
+
+ {
+ title: "save discussion",
+ waitNot: 'tr:has(.oe_list_field_cell:containsExact(e))',
+ element: 'button.oe_form_button_save'
+ },
+
+ // check saved data
+
+ {
+ title: "check data 8",
+ waitFor: '.oe_form_text_content:containsExact([test_trigger] Administrator:aaa\n[test_trigger] Demo User:ccccc)',
+ },
+ {
+ title: "check data 9",
+ waitFor: '.oe_form_field_one2many tbody tr:has(.oe_list_field_cell):eq(1)',
+ waitNot: '.oe_form_field_one2many tbody tr:has(.oe_list_field_cell):eq(2)',
},
]
});