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
4ba42558
Commit
4ba42558
authored
8 years ago
by
Christophe Matthieu
Committed by
qsm-odoo
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] survey: convert tours to use web_tour.tour
parent
427bc242
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/survey/static/src/js/tour_test_survey.js
+101
-106
101 additions, 106 deletions
addons/survey/static/src/js/tour_test_survey.js
addons/survey/tests/test_survey_ui.py
+6
-5
6 additions, 5 deletions
addons/survey/tests/test_survey_ui.py
with
107 additions
and
111 deletions
addons/survey/static/src/js/tour_test_survey.js
+
101
−
106
View file @
4ba42558
odoo
.
define
(
'
survey.tour_test_survey
'
,
function
(
require
)
{
'
use strict
'
;
var
Core
=
require
(
'
web.core
'
);
var
Tour
=
require
(
'
web.Tour
'
);
var
_t
=
Core
.
_t
;
var
tour
=
require
(
'
web_tour.tour
'
);
Tour
.
register
({
id
:
'
test_survey
'
,
name
:
_t
(
"
try to create and fill survey
"
),
path
:
'
/survey/start/user-feedback-form-1/phantom
'
,
mode
:
'
test
'
,
steps
:
[
tour
.
register
(
'
test_survey
'
,
{
test
:
true
,
url
:
'
/survey/start/user-feedback-form-1/phantom
'
},
[
// Page-1
{
title
:
"
Clicking on Start Survey
"
,
element
:
'
a.btn.btn-primary.btn-lg:contains("Start Survey")
'
,
content
:
"
Clicking on Start Survey
"
,
trigger
:
'
a.btn.btn-primary.btn-lg:contains("Start Survey")
'
,
},
// Question: Where do you develop your new features?
{
title
:
"
Selecting answer 'Yes, I use a version < 7.0'
"
,
element
:
'
select[name="1_1_1"]
'
,
sampleT
ext
:
'
1
'
,
content
:
"
Selecting answer 'Yes, I use a version < 7.0'
"
,
trigger
:
'
select[name="1_1_1"]
'
,
run
:
'
t
ext
1
'
,
},
// Question: Which modules are you using/testing?
{
title
:
"
Ticking answer 'Sales Management'
"
,
element
:
'
input[name="1_1_2_5"][value="5"]
'
,
sampleT
ext
:
'
5
'
,
content
:
"
Ticking answer 'Sales Management'
"
,
trigger
:
'
input[name="1_1_2_5"][value="5"]
'
,
run
:
'
t
ext
5
'
,
},
{
title
:
"
Clicking on Next Page
"
,
element
:
'
button[value="next"]
'
,
content
:
"
Clicking on Next Page
"
,
trigger
:
'
button[value="next"]
'
,
},
// Page-2
// Question: What do you think about the documentation available on doc.odoo.com?
{
title
:
"
For 'It is up-to-date' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_3_15"][value="11"]
'
,
sampleT
ext
:
'
11
'
,
content
:
"
For 'It is up-to-date' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_3_15"][value="11"]
'
,
run
:
'
t
ext
11
'
,
},
{
title
:
"
For 'It helps in the beginning' ckecking 'Disagree'
"
,
element
:
'
input[name="1_2_3_16"][value="12"]
'
,
sampleT
ext
:
'
12
'
,
content
:
"
For 'It helps in the beginning' ckecking 'Disagree'
"
,
trigger
:
'
input[name="1_2_3_16"][value="12"]
'
,
run
:
'
t
ext
12
'
,
},
{
title
:
"
For 'I use the contextual help in Odoo' checking 'Agree'
"
,
element
:
'
input[name="1_2_3_17"][value="13"]
'
,
sampleT
ext
:
'
13
'
,
content
:
"
For 'I use the contextual help in Odoo' checking 'Agree'
"
,
trigger
:
'
input[name="1_2_3_17"][value="13"]
'
,
run
:
'
t
ext
13
'
,
},
{
title
:
"
For 'It is complete' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_3_18"][value="11"]
'
,
sampleT
ext
:
'
11
'
,
content
:
"
For 'It is complete' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_3_18"][value="11"]
'
,
run
:
'
t
ext
11
'
,
},
{
title
:
"
For 'It is clear' checking 'Disagree'
"
,
element
:
'
input[name="1_2_3_19"][value="12"]
'
,
sampleT
ext
:
'
12
'
,
content
:
"
For 'It is clear' checking 'Disagree'
"
,
trigger
:
'
input[name="1_2_3_19"][value="12"]
'
,
run
:
'
t
ext
12
'
,
},
// Question: What do you think about the process views of Odoo, available in the web client ?
{
title
:
"
For 'They help new users to understand Odoo' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_4_24"][value="20"]
'
,
sampleT
ext
:
'
20
'
,
content
:
"
For 'They help new users to understand Odoo' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_4_24"][value="20"]
'
,
run
:
'
t
ext
20
'
,
},
{
title
:
"
For 'They are clean and correct' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_4_25"][value="20"]
'
,
sampleT
ext
:
'
20
'
,
content
:
"
For 'They are clean and correct' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_4_25"][value="20"]
'
,
run
:
'
t
ext
20
'
,
},
{
title
:
"
For 'They are useful on a daily usage' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_4_26"][value="20"]
'
,
sampleT
ext
:
'
20
'
,
content
:
"
For 'They are useful on a daily usage' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_4_26"][value="20"]
'
,
run
:
'
t
ext
20
'
,
},
{
title
:
"
For 'A process is defined for all enterprise flows' checking 'Disagree'
"
,
element
:
'
input[name="1_2_4_27"][value="21"]
'
,
sampleT
ext
:
'
21
'
,
content
:
"
For 'A process is defined for all enterprise flows' checking 'Disagree'
"
,
trigger
:
'
input[name="1_2_4_27"][value="21"]
'
,
run
:
'
t
ext
21
'
,
},
{
title
:
"
For 'It's easy to find the process you need' checking 'Agree'
"
,
element
:
'
input[name="1_2_4_28"][value="22"]
'
,
sampleT
ext
:
'
22
'
,
content
:
"
For 'It's easy to find the process you need' checking 'Agree'
"
,
trigger
:
'
input[name="1_2_4_28"][value="22"]
'
,
run
:
'
t
ext
22
'
,
},
// Question: Do you have suggestions on how to improve the process view?
{
title
:
"
Writing answer
"
,
element
:
'
textarea[name="1_2_5"]
'
,
sampleT
ext
:
'
I do not want to provide any suggestions.
'
,
content
:
"
Writing answer
"
,
trigger
:
'
textarea[name="1_2_5"]
'
,
run
:
'
t
ext
I do not want to provide any suggestions.
'
,
},
// Question: What do you think about the structure of the menus?
{
title
:
"
Checking 'It can be improved'
"
,
element
:
'
input[name="1_2_6_30"][value="30"]
'
,
sampleT
ext
:
'
30
'
,
content
:
"
Checking 'It can be improved'
"
,
trigger
:
'
input[name="1_2_6_30"][value="30"]
'
,
run
:
'
t
ext
30
'
,
},
// Question: What do you think about the groups of users?
{
title
:
"
For 'The security rules defined on groups are useful' checking 'Agree'
"
,
element
:
'
input[name="1_2_7_36"][value="32"]
'
,
sampleT
ext
:
'
32
'
,
content
:
"
For 'The security rules defined on groups are useful' checking 'Agree'
"
,
trigger
:
'
input[name="1_2_7_36"][value="32"]
'
,
run
:
'
t
ext
32
'
,
},
{
title
:
"
For 'Those security rules are standard and can be used out-of-the-box in most cases' checking 'Totally agree'
"
,
element
:
'
input[name="1_2_7_37"][value="35"]
'
,
sampleT
ext
:
'
35
'
,
content
:
"
For 'Those security rules are standard and can be used out-of-the-box in most cases' checking 'Totally agree'
"
,
trigger
:
'
input[name="1_2_7_37"][value="35"]
'
,
run
:
'
t
ext
35
'
,
},
{
title
:
"
For 'The 'Usability/Extended View' group helps in daily work' checking 'Totally agree'
"
,
element
:
'
input[name="1_2_7_38"][value="35"]
'
,
sampleT
ext
:
'
35
'
,
content
:
"
For 'The 'Usability/Extended View' group helps in daily work' checking 'Totally agree'
"
,
trigger
:
'
input[name="1_2_7_38"][value="35"]
'
,
run
:
'
t
ext
35
'
,
},
{
title
:
"
For 'The 'Usability/Extended View' group hides only optional fields' checking 'Totally agree'
"
,
element
:
'
input[name="1_2_7_39"][value="33"]
'
,
sampleT
ext
:
'
33
'
,
content
:
"
For 'The 'Usability/Extended View' group hides only optional fields' checking 'Totally agree'
"
,
trigger
:
'
input[name="1_2_7_39"][value="33"]
'
,
run
:
'
t
ext
33
'
,
},
{
title
:
"
For 'The groups set on menu items are relevant' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_7_40"][value="32"]
'
,
sampleT
ext
:
'
32
'
,
content
:
"
For 'The groups set on menu items are relevant' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_7_40"][value="32"]
'
,
run
:
'
t
ext
32
'
,
},
// Question: What do you think about the structure of the menus?
{
title
:
"
Checking 'There are too few groups defined, security isn't accurate enough'
"
,
element
:
'
input[name="1_2_8"][value="42"]
'
,
sampleT
ext
:
'
42
'
,
content
:
"
Checking 'There are too few groups defined, security isn't accurate enough'
"
,
trigger
:
'
input[name="1_2_8"][value="42"]
'
,
run
:
'
t
ext
42
'
,
},
// Question: What do you think about configuration wizards?
{
title
:
"
For 'Descriptions and help tooltips are clear enough' checking 'Agree'
"
,
element
:
'
input[name="1_2_9_48"][value="46"]
'
,
sampleT
ext
:
'
46
'
,
content
:
"
For 'Descriptions and help tooltips are clear enough' checking 'Agree'
"
,
trigger
:
'
input[name="1_2_9_48"][value="46"]
'
,
run
:
'
t
ext
46
'
,
},
{
title
:
"
For 'Configuration wizard exists for each important setting' checking 'Agree'
"
,
element
:
'
input[name="1_2_9_49"][value="46"]
'
,
sampleT
ext
:
'
46
'
,
content
:
"
For 'Configuration wizard exists for each important setting' checking 'Agree'
"
,
trigger
:
'
input[name="1_2_9_49"][value="46"]
'
,
run
:
'
t
ext
46
'
,
},
{
title
:
"
For 'Extra modules proposed are relevant' checking 'Totally agree'
"
,
element
:
'
input[name="1_2_9_50"][value="47"]
'
,
sampleT
ext
:
'
47
'
,
content
:
"
For 'Extra modules proposed are relevant' checking 'Totally agree'
"
,
trigger
:
'
input[name="1_2_9_50"][value="47"]
'
,
run
:
'
t
ext
47
'
,
},
{
title
:
"
For 'Running the configuration wizards is a good way to spare time' checking 'Totally disagree'
"
,
element
:
'
input[name="1_2_9_51"][value="44"]
'
,
sampleT
ext
:
'
44
'
,
content
:
"
For 'Running the configuration wizards is a good way to spare time' checking 'Totally disagree'
"
,
trigger
:
'
input[name="1_2_9_51"][value="44"]
'
,
run
:
'
t
ext
44
'
,
},
{
title
:
"
Clicking on Next Page
"
,
element
:
'
button[value="next"]
'
,
content
:
"
Clicking on Next Page
"
,
trigger
:
'
button[value="next"]
'
,
},
// Page-3
// Question: How do you contribute or plan to contribute to Odoo?
{
title
:
"
Checking 'I would like to contribute but I don not know how?'
"
,
element
:
'
input[name="1_3_10_53"][value="53"]
'
,
sampleT
ext
:
'
53
'
,
content
:
"
Checking 'I would like to contribute but I don not know how?'
"
,
trigger
:
'
input[name="1_3_10_53"][value="53"]
'
,
run
:
'
t
ext
53
'
,
},
// Question: Do you have a proposition to help people to contribute?
{
title
:
"
Writing answer
"
,
element
:
'
textarea[name="1_3_11"]
'
,
sampleT
ext
:
'
No. I do not have any proposition to help people to contribute.
'
,
content
:
"
Writing answer
"
,
trigger
:
'
textarea[name="1_3_11"]
'
,
run
:
'
t
ext
No. I do not have any proposition to help people to contribute.
'
,
},
// Question: Do you have a proposition to attract new contributors?
{
title
:
"
Writing answer
"
,
element
:
'
textarea[name="1_3_12"]
'
,
sampleT
ext
:
'
No. I do not have any proposition to Attract new contributors.
'
,
content
:
"
Writing answer
"
,
trigger
:
'
textarea[name="1_3_12"]
'
,
run
:
'
t
ext
No. I do not have any proposition to Attract new contributors.
'
,
},
{
title
:
"
Clicking on Next Page
"
,
element
:
'
button[value="next"]
'
,
content
:
"
Clicking on Next Page
"
,
trigger
:
'
button[value="next"]
'
,
},
// Page-4
// Question: Where do you develop your new features?
{
title
:
"
Checking 'I host them on my own website'
"
,
element
:
'
input[name="1_4_13_59"][value="59"]
'
,
sampleT
ext
:
'
59
'
,
content
:
"
Checking 'I host them on my own website'
"
,
trigger
:
'
input[name="1_4_13_59"][value="59"]
'
,
run
:
'
t
ext
59
'
,
},
{
title
:
"
Finish Survey
"
,
element
:
'
button[value="finish"]
'
,
content
:
"
Finish Survey
"
,
trigger
:
'
button[value="finish"]
'
,
},
{
title
:
"
Thank you
"
,
element
:
'
h1:contains("Thank you!")
'
,
content
:
"
Thank you
"
,
trigger
:
'
h1:contains("Thank you!")
'
,
}
]
}
);
);
});
This diff is collapsed.
Click to expand it.
addons/survey/tests/test_survey_ui.py
+
6
−
5
View file @
4ba42558
...
...
@@ -2,15 +2,16 @@ import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@odoo.tests.common.at_install
(
False
)
@odoo.tests.common.post_install
(
True
)
class
TestUi
(
odoo
.
tests
.
HttpCase
):
post_install
=
True
at_install
=
False
def
test_01_admin_survey_tour
(
self
):
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].run(
'
test_survey
'
,
'
test
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].tours.test_survey
"
,
login
=
"
admin
"
)
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].run(
'
test_survey
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].tours.test_survey
.ready
"
,
login
=
"
admin
"
)
def
test_02_demo_survey_tour
(
self
):
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].run(
'
test_survey
'
,
'
test
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].tours.test_survey
"
,
login
=
"
demo
"
)
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].run(
'
test_survey
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].tours.test_survey
.ready
"
,
login
=
"
demo
"
)
def
test_03_public_survey_tour
(
self
):
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].run(
'
test_survey
'
,
'
test
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
.T
our
'
].tours.test_survey
"
)
self
.
phantom_js
(
"
/
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].run(
'
test_survey
'
)
"
,
"
odoo.__DEBUG__.services[
'
web
_tour.t
our
'
].tours.test_survey
.ready
"
)
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