Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
a102a9f3
Commit
a102a9f3
authored
9 years ago
by
Christophe Matthieu
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] web: add a test to check the one2many create form and onchange
parent
fd01656f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/web/static/test/x2many.js
+52
-9
52 additions, 9 deletions
addons/web/static/test/x2many.js
with
52 additions
and
9 deletions
addons/web/static/test/x2many.js
+
52
−
9
View file @
a102a9f3
...
...
@@ -2,6 +2,7 @@ odoo.define('web.test.x2many', function (require) {
'
use strict
'
;
var
Tour
=
require
(
'
web.Tour
'
);
var
inc
;
Tour
.
register
({
id
:
'
widget_x2many
'
,
...
...
@@ -25,11 +26,53 @@ Tour.register({
sampleText
:
'
test
'
},
// try to add a user with one2many form
{
title
:
"
click on moderator one2many drop down
"
,
waitFor
:
'
.oe_form_required input:propValue(test)
'
,
element
:
'
tr:contains(Moderator) .oe_m2o_drop_down_button
'
},
{
title
:
"
click on 'Create and Edit...'
"
,
element
:
'
.oe_m2o_dropdown_option
'
},
{
title
:
"
insert a name into the modal form
"
,
element
:
'
.modal .oe_form_field.oe_form_required:first input
'
,
sampleText
:
'
user_test
'
,
onload
:
function
()
{
inc
=
new
Date
().
getTime
();
this
.
sampleText
=
'
user_test_
'
+
inc
;
}
},
{
title
:
"
insert an email into the modal form
"
,
waitFor
:
'
.modal .oe_form_field.oe_form_required input:propValueContains(user_test)
'
,
element
:
'
.modal .oe_form_field.oe_form_required:eq(1) input
'
,
sampleText
:
'
user_test@test
'
,
onload
:
function
()
{
this
.
sampleText
=
'
user_test_
'
+
inc
+
'
@test
'
;
}
},
{
title
:
"
save the modal content and create the new moderator
"
,
waitFor
:
'
.modal .oe_form_field.oe_form_required input:propValueContains(@test)
'
,
element
:
'
.modal .o_formdialog_save
'
,
},
{
title
:
"
check if the modal is saved
"
,
waitFor
:
'
tr:contains(Moderator) .oe_form_field_many2one input:propValueContains(user_test)
'
,
},
{
title
:
"
check the onchange from the o2m to the m2m
"
,
waitFor
:
'
.tab-pane:last tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):contains(user_test)
'
,
},
// add message a
{
title
:
"
create new message a
"
,
waitFor
:
'
.oe_form_required input:propValue(test)
'
,
element
:
'
.oe_form_field_x2many_list_row_add:first a
'
},
{
...
...
@@ -85,8 +128,8 @@ Tour.register({
{
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] )
'
,
waitNot
:
'
tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(2)
'
,
waitFor
:
'
.tab-pane:first
tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(1) .oe_list_field_cell:contains([test_trigger] )
'
,
waitNot
:
'
.tab-pane:first
tr:has(.oe_list_field_cell):not(:has(.oe_list_record_selector)):eq(2)
'
,
element
:
'
.oe_list_field_cell:containsExact(b)
'
},
{
...
...
@@ -150,8 +193,8 @@ Tour.register({
{
title
:
"
save discussion
"
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
1
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
3
)
'
,
element
:
'
button.oe_form_button_save
'
},
...
...
@@ -168,8 +211,8 @@ Tour.register({
},
{
title
:
"
check data 3
"
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
1
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
3
)
'
,
},
// edit
...
...
@@ -316,8 +359,8 @@ Tour.register({
},
{
title
:
"
check data 7
"
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
1
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitFor
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
2
)
'
,
waitNot
:
'
.oe_form_field_many2many tbody tr:has(.oe_list_field_char):eq(
3
)
'
,
},
// edit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment