summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2019-04-01 16:10:54 +0000
committerSébastien Theys <seb@odoo.com>2019-04-04 08:44:59 +0000
commitdf7326f0be88baa9aa12543f003f9e31a1e3307f (patch)
tree322f8df145db26d3638d283079cacbd69812172f /addons
parent7529bd35fab88759769187c331f46db960b321fa (diff)
[IMP] tests, *: add start_tour helper
Before this commit, the syntax to start a tour was extremely verbose. With this new method, it is possible to start a tour by just giving the essential parameter: the tour name. The full set of features from browser_js are kept by using **kwargs. closes odoo/odoo#32316 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/tests/test_reconciliation_widget.py5
-rw-r--r--addons/crm/tests/test_crm_ui.py2
-rw-r--r--addons/event_sale/tests/test_event_sale_ui.py2
-rw-r--r--addons/point_of_sale/tests/test_frontend.py12
-rw-r--r--addons/point_of_sale/tests/test_point_of_sale_ui.py2
-rw-r--r--addons/portal/tests/test_load_process.py7
-rw-r--r--addons/project/tests/test_project_ui.py2
-rw-r--r--addons/sale/tests/test_sale_signature.py2
-rw-r--r--addons/sale_management/tests/test_sale_ui.py2
-rw-r--r--addons/sale_product_configurator/tests/test_sale_product_configurator_ui.py12
-rw-r--r--addons/stock/tests/test_ui.py2
-rw-r--r--addons/survey/tests/test_survey_ui.py12
-rw-r--r--addons/test_mail/tests/test_ui.py2
-rw-r--r--addons/test_website/tests/test_reset_views.py11
-rw-r--r--addons/website/tests/test_ui.py10
-rw-r--r--addons/website/tests/test_website_reset_password.py2
-rw-r--r--addons/website_blog/tests/test_ui.py2
-rw-r--r--addons/website_crm/tests/test_website_crm.py2
-rw-r--r--addons/website_event/tests/test_ui.py2
-rw-r--r--addons/website_event_sale/tests/test_ui.py4
-rw-r--r--addons/website_forum/tests/test_forum_process.py4
-rw-r--r--addons/website_hr_recruitment/tests/test_website_hr_recruitment.py2
-rw-r--r--addons/website_links/tests/test_ui.py2
-rw-r--r--addons/website_sale/tests/test_customize.py12
-rw-r--r--addons/website_sale/tests/test_sale_process.py6
-rw-r--r--addons/website_sale/tests/test_website_sale_cart_recovery.py2
-rw-r--r--addons/website_sale/tests/test_website_sale_image.py2
-rw-r--r--addons/website_sale/tests/test_website_sale_mail.py2
-rw-r--r--addons/website_sale_coupon/tests/test_shop_sale_coupon.py7
-rw-r--r--addons/website_sale_wishlist/tests/test_wishlist_process.py2
30 files changed, 57 insertions, 81 deletions
diff --git a/addons/account/tests/test_reconciliation_widget.py b/addons/account/tests/test_reconciliation_widget.py
index a24cec75ca5..d0ebd37d37b 100644
--- a/addons/account/tests/test_reconciliation_widget.py
+++ b/addons/account/tests/test_reconciliation_widget.py
@@ -25,9 +25,8 @@ class TestUi(odoo.tests.HttpCase):
prep = requests.models.PreparedRequest()
prep.prepare_url(url="http://localhost/web#", params=payload)
- self.phantom_js(prep.url.replace('http://localhost','').replace('?','#'),
- "odoo.__DEBUG__.services['web_tour.tour'].run('bank_statement_reconciliation')",
- "odoo.__DEBUG__.services['web_tour.tour'].tours.bank_statement_reconciliation.ready", login="admin")
+ self.start_tour(prep.url.replace('http://localhost', '').replace('?', '#'),
+ 'bank_statement_reconciliation', login="admin")
@odoo.tests.tagged('post_install', '-at_install')
diff --git a/addons/crm/tests/test_crm_ui.py b/addons/crm/tests/test_crm_ui.py
index 3c648a1a276..7916662b0b0 100644
--- a/addons/crm/tests/test_crm_ui.py
+++ b/addons/crm/tests/test_crm_ui.py
@@ -7,4 +7,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_crm_tour(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('crm_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.crm_tour.ready", login="admin")
+ self.start_tour("/web", 'crm_tour', login="admin")
diff --git a/addons/event_sale/tests/test_event_sale_ui.py b/addons/event_sale/tests/test_event_sale_ui.py
index 44e876922c4..354b0bc425d 100644
--- a/addons/event_sale/tests/test_event_sale_ui.py
+++ b/addons/event_sale/tests/test_event_sale_ui.py
@@ -5,4 +5,4 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_event_configurator(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('event_configurator_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event_configurator_tour.ready", login="admin")
+ self.start_tour("/web", 'event_configurator_tour', login="admin")
diff --git a/addons/point_of_sale/tests/test_frontend.py b/addons/point_of_sale/tests/test_frontend.py
index f47f27e0a9a..80c9909afc7 100644
--- a/addons/point_of_sale/tests/test_frontend.py
+++ b/addons/point_of_sale/tests/test_frontend.py
@@ -315,15 +315,9 @@ class TestUi(odoo.tests.HttpCase):
# this you end up with js, css but no qweb.
env['ir.module.module'].search([('name', '=', 'point_of_sale')], limit=1).state = 'installed'
- self.phantom_js("/pos/web",
- "odoo.__DEBUG__.services['web_tour.tour'].run('pos_pricelist')",
- "odoo.__DEBUG__.services['web_tour.tour'].tours.pos_pricelist.ready",
- login="admin")
-
- self.phantom_js("/pos/web",
- "odoo.__DEBUG__.services['web_tour.tour'].run('pos_basic_order')",
- "odoo.__DEBUG__.services['web_tour.tour'].tours.pos_basic_order.ready",
- login="admin")
+ self.start_tour("/pos/web", 'pos_pricelist', login="admin")
+
+ self.start_tour("/pos/web", 'pos_basic_order', login="admin")
for order in env['pos.order'].search([]):
self.assertEqual(order.state, 'paid', "Validated order has payment of " + str(order.amount_paid) + " and total of " + str(order.amount_total))
diff --git a/addons/point_of_sale/tests/test_point_of_sale_ui.py b/addons/point_of_sale/tests/test_point_of_sale_ui.py
index 2298b41064f..c686b47aae9 100644
--- a/addons/point_of_sale/tests/test_point_of_sale_ui.py
+++ b/addons/point_of_sale/tests/test_point_of_sale_ui.py
@@ -7,4 +7,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_point_of_sale_tour(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('point_of_sale_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.point_of_sale_tour.ready", login="admin")
+ self.start_tour("/web", 'point_of_sale_tour', login="admin")
diff --git a/addons/portal/tests/test_load_process.py b/addons/portal/tests/test_load_process.py
index 94904f26afc..ccefbad8d39 100644
--- a/addons/portal/tests/test_load_process.py
+++ b/addons/portal/tests/test_load_process.py
@@ -6,9 +6,4 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_portal_load_tour(self):
- self.phantom_js(
- "/",
- "odoo.__DEBUG__.services['web_tour.tour'].run('portal_load_homepage')",
- "odoo.__DEBUG__.services['web_tour.tour'].tours.portal_load_homepage.ready",
- login="portal"
- )
+ self.start_tour("/", 'portal_load_homepage', login="portal")
diff --git a/addons/project/tests/test_project_ui.py b/addons/project/tests/test_project_ui.py
index 2218e491838..9fd5ee2c273 100644
--- a/addons/project/tests/test_project_ui.py
+++ b/addons/project/tests/test_project_ui.py
@@ -7,4 +7,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_project_tour(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('project_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.project_tour.ready", login="admin")
+ self.start_tour("/web", 'project_tour', login="admin")
diff --git a/addons/sale/tests/test_sale_signature.py b/addons/sale/tests/test_sale_signature.py
index 5e259103bc3..3daa3e5a6ad 100644
--- a/addons/sale/tests/test_sale_signature.py
+++ b/addons/sale/tests/test_sale_signature.py
@@ -24,4 +24,4 @@ class TestSaleSignature(odoo.tests.HttpCase):
# must be sent to the user so he can see it
sales_order.force_quotation_send()
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_signature')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_signature.ready", login="portal")
+ self.start_tour("/", 'sale_signature', login="portal")
diff --git a/addons/sale_management/tests/test_sale_ui.py b/addons/sale_management/tests/test_sale_ui.py
index cf107b02ebc..1640e7fcace 100644
--- a/addons/sale_management/tests/test_sale_ui.py
+++ b/addons/sale_management/tests/test_sale_ui.py
@@ -6,4 +6,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_sale_tour(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_tour', login="admin")
diff --git a/addons/sale_product_configurator/tests/test_sale_product_configurator_ui.py b/addons/sale_product_configurator/tests/test_sale_product_configurator_ui.py
index 8470090c7a8..d3bab0c4c8d 100644
--- a/addons/sale_product_configurator/tests/test_sale_product_configurator_ui.py
+++ b/addons/sale_product_configurator/tests/test_sale_product_configurator_ui.py
@@ -10,7 +10,7 @@ class TestUi(odoo.tests.HttpCase):
# To be able to test the product configurator, admin user must have access to "variants" feature, so we give him the right group for that
self.env.ref('base.user_admin').write({'groups_id': [(4, self.env.ref('product.group_product_variant').id)]})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_tour', login="admin")
def test_02_product_configurator_advanced(self):
# group_product_variant: use the product configurator
@@ -73,13 +73,13 @@ class TestUi(odoo.tests.HttpCase):
'attribute_line_ids': [(4, product_template_attribute_line.id) for product_template_attribute_line in product_template_attribute_lines]
})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_advanced_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_advanced_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_advanced_tour', login="admin")
def test_03_product_configurator_edition(self):
# To be able to test the product configurator, admin user must have access to "variants" feature, so we give him the right group for that
self.env.ref('base.user_admin').write({'groups_id': [(4, self.env.ref('product.group_product_variant').id)]})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_edition_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_edition_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_edition_tour', login="admin")
def test_04_product_configurator_single_custom_value(self):
# group_product_variant: use the product configurator
@@ -116,7 +116,7 @@ class TestUi(odoo.tests.HttpCase):
'attribute_line_ids': [(4, product_template_attribute_lines[0].id)]
})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_single_custom_attribute_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_single_custom_attribute_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_single_custom_attribute_tour', login="admin")
def test_05_product_configurator_pricelist(self):
"""The goal of this test is to make sure pricelist rules are correctly
@@ -156,7 +156,7 @@ class TestUi(odoo.tests.HttpCase):
'compute_price': 'formula',
})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_pricelist_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_pricelist_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_pricelist_tour', login="admin")
def test_06_product_configurator_optional_products(self):
"""The goal of this test is to check that the product configurator
@@ -170,4 +170,4 @@ class TestUi(odoo.tests.HttpCase):
'optional_product_ids': [(6, 0, [self.env.ref('sale_product_configurator.product_product_1_product_template').id])]
})
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_product_configurator_optional_products_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_product_configurator_optional_products_tour.ready", login="admin")
+ self.start_tour("/web", 'sale_product_configurator_optional_products_tour', login="admin")
diff --git a/addons/stock/tests/test_ui.py b/addons/stock/tests/test_ui.py
index ef434ea678a..45e2a74169c 100644
--- a/addons/stock/tests/test_ui.py
+++ b/addons/stock/tests/test_ui.py
@@ -7,4 +7,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_admin_stock_route(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('stock')", "odoo.__DEBUG__.services['web_tour.tour'].tours.stock.ready", login='admin')
+ self.start_tour("/web", 'stock', login='admin')
diff --git a/addons/survey/tests/test_survey_ui.py b/addons/survey/tests/test_survey_ui.py
index 1e14241a932..e9abcd08b90 100644
--- a/addons/survey/tests/test_survey_ui.py
+++ b/addons/survey/tests/test_survey_ui.py
@@ -7,24 +7,24 @@ class TestUi(odoo.tests.HttpCase):
def test_01_admin_survey_tour(self):
access_token = self.env.ref('survey.survey_feedback').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_survey')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_survey.ready", login="admin")
+ self.start_tour("/survey/start/%s" % access_token, 'test_survey', login="admin")
def test_02_demo_survey_tour(self):
access_token = self.env.ref('survey.survey_feedback').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_survey')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_survey.ready", login="demo")
+ self.start_tour("/survey/start/%s" % access_token, 'test_survey', login="demo")
def test_03_public_survey_tour(self):
access_token = self.env.ref('survey.survey_feedback').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_survey')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_survey.ready")
+ self.start_tour("/survey/start/%s" % access_token, 'test_survey')
def test_04_certification_success_tour(self):
access_token = self.env.ref('survey.vendor_certification').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_certification_success')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_certification_success.ready", login="demo")
+ self.start_tour("/survey/start/%s" % access_token, 'test_certification_success', login="demo")
def test_05_certification_failure_tour(self):
access_token = self.env.ref('survey.vendor_certification').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_certification_failure')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_certification_failure.ready", login="demo")
+ self.start_tour("/survey/start/%s" % access_token, 'test_certification_failure', login="demo")
def test_06_survey_prefill(self):
access_token = self.env.ref('survey.survey_feedback').access_token
- self.phantom_js("/survey/start/%s" % access_token, "odoo.__DEBUG__.services['web_tour.tour'].run('test_survey_prefill')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_survey_prefill.ready")
+ self.start_tour("/survey/start/%s" % access_token, 'test_survey_prefill')
diff --git a/addons/test_mail/tests/test_ui.py b/addons/test_mail/tests/test_ui.py
index 59f6dc37047..82858b520d2 100644
--- a/addons/test_mail/tests/test_ui.py
+++ b/addons/test_mail/tests/test_ui.py
@@ -7,4 +7,4 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_mail_tour(self):
- self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('mail_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.mail_tour.ready", login="admin")
+ self.start_tour("/web", 'mail_tour', login="admin")
diff --git a/addons/test_website/tests/test_reset_views.py b/addons/test_website/tests/test_reset_views.py
index c927ffd32ba..b9bf3801363 100644
--- a/addons/test_website/tests/test_reset_views.py
+++ b/addons/test_website/tests/test_reset_views.py
@@ -11,13 +11,6 @@ def break_view(view, fr='<p>placeholder</p>', to='<p t-field="not.exist"/>'):
@odoo.tests.common.tagged('post_install', '-at_install')
class TestWebsiteResetViews(odoo.tests.HttpCase):
- def do_test(self, name):
- self.browser_js(
- "/",
- "odoo.__DEBUG__.services['web_tour.tour'].run('%s')" % name,
- "odoo.__DEBUG__.services['web_tour.tour'].tours.%s.ready" % name,
- login="admin"
- )
def fix_it(self, page, mode='soft'):
self.authenticate("admin", "admin")
@@ -97,9 +90,9 @@ class TestWebsiteResetViews(odoo.tests.HttpCase):
@mute_logger('odoo.addons.website.models.ir_http')
def test_07_reset_page_view_complete_flow(self):
- self.do_test('test_reset_page_view_complete_flow_part1')
+ self.start_tour("/", 'test_reset_page_view_complete_flow_part1', login="admin")
self.fix_it('/test_page_view')
- self.do_test('test_reset_page_view_complete_flow_part2')
+ self.start_tour("/", 'test_reset_page_view_complete_flow_part2', login="admin")
self.fix_it('/test_page_view')
@mute_logger('odoo.addons.website.models.ir_http')
diff --git a/addons/website/tests/test_ui.py b/addons/website/tests/test_ui.py
index d73a525e791..0660d232752 100644
--- a/addons/website/tests/test_ui.py
+++ b/addons/website/tests/test_ui.py
@@ -21,7 +21,7 @@ class TestUiHtmlEditor(odoo.tests.HttpCase):
</t>
'''
generic_aboutus.arch = oe_structure_layout
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('html_editor_multiple_templates')", "odoo.__DEBUG__.services['web_tour.tour'].tours.html_editor_multiple_templates.ready", login='admin')
+ self.start_tour("/", 'html_editor_multiple_templates', login='admin')
self.assertEqual(View.search_count([('key', '=', 'website.aboutus')]), 2, "Aboutus view should have been COW'd")
self.assertTrue(generic_aboutus.arch == oe_structure_layout, "Generic Aboutus view should be untouched")
self.assertEqual(len(generic_aboutus.inherit_children_ids.filtered(lambda v: 'oe_structure' in v.name)), 0, "oe_structure view should have been deleted when aboutus was COW")
@@ -30,12 +30,12 @@ class TestUiHtmlEditor(odoo.tests.HttpCase):
self.assertEqual(len(specific_aboutus.inherit_children_ids.filtered(lambda v: 'oe_structure' in v.name)), 1, "oe_structure view should have been created on the specific tree")
def test_html_editor_scss(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('test_html_editor_scss')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_html_editor_scss.ready", login='admin')
+ self.start_tour("/", 'test_html_editor_scss', login='admin')
class TestUiTranslate(odoo.tests.HttpCase):
def test_admin_tour_rte_translator(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('rte_translator')", "odoo.__DEBUG__.services['web_tour.tour'].tours.rte_translator.ready", login='admin', timeout=120)
+ self.start_tour("/", 'rte_translator', login='admin', timeout=120)
@odoo.tests.common.tagged('post_install', '-at_install')
@@ -45,7 +45,7 @@ class TestUi(odoo.tests.HttpCase):
self.phantom_js("/", "console.log('test successful')", "'website.content.snippets.animation' in odoo.__DEBUG__.services")
def test_02_admin_tour_banner(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('banner')", "odoo.__DEBUG__.services['web_tour.tour'].tours.banner.ready", login='admin')
+ self.start_tour("/", 'banner', login='admin')
def test_03_restricted_editor(self):
self.restricted_editor = self.env['res.users'].create({
@@ -57,4 +57,4 @@ class TestUi(odoo.tests.HttpCase):
self.ref('website.group_website_publisher')
])]
})
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('restricted_editor')", "odoo.__DEBUG__.services['web_tour.tour'].tours.restricted_editor.ready", login='restricted')
+ self.start_tour("/", 'restricted_editor', login='restricted')
diff --git a/addons/website/tests/test_website_reset_password.py b/addons/website/tests/test_website_reset_password.py
index b9fe135d35f..40928732dad 100644
--- a/addons/website/tests/test_website_reset_password.py
+++ b/addons/website/tests/test_website_reset_password.py
@@ -31,4 +31,4 @@ class TestWebsiteResetPassword(HttpCase):
return original_send_mail(*args, **kwargs)
with patch.object(MailMail, 'unlink', lambda self: None), patch.object(MailTemplate, 'send_mail', my_send_mail):
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_reset_password')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_reset_password.ready", login="admin")
+ self.start_tour("/", 'website_reset_password', login="admin")
diff --git a/addons/website_blog/tests/test_ui.py b/addons/website_blog/tests/test_ui.py
index 1de418350cc..654ca612644 100644
--- a/addons/website_blog/tests/test_ui.py
+++ b/addons/website_blog/tests/test_ui.py
@@ -6,4 +6,4 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_admin(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('blog')", "odoo.__DEBUG__.services['web_tour.tour'].tours.blog.ready", login='admin')
+ self.start_tour("/", 'blog', login='admin')
diff --git a/addons/website_crm/tests/test_website_crm.py b/addons/website_crm/tests/test_website_crm.py
index 67e93625c20..c74256b0ad7 100644
--- a/addons/website_crm/tests/test_website_crm.py
+++ b/addons/website_crm/tests/test_website_crm.py
@@ -8,7 +8,7 @@ import odoo.tests
class TestWebsiteCrm(odoo.tests.HttpCase):
def test_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_crm_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_crm_tour.ready")
+ self.start_tour("/", 'website_crm_tour')
# check result
record = self.env['crm.lead'].search([('description', '=', '### TOUR DATA ###')])
diff --git a/addons/website_event/tests/test_ui.py b/addons/website_event/tests/test_ui.py
index 06da539287b..baf4f0be5eb 100644
--- a/addons/website_event/tests/test_ui.py
+++ b/addons/website_event/tests/test_ui.py
@@ -4,4 +4,4 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_admin(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('event')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event.ready", login='admin')
+ self.start_tour("/", 'event', login='admin')
diff --git a/addons/website_event_sale/tests/test_ui.py b/addons/website_event_sale/tests/test_ui.py
index f47a34dc45f..06acc8f250d 100644
--- a/addons/website_event_sale/tests/test_ui.py
+++ b/addons/website_event_sale/tests/test_ui.py
@@ -11,9 +11,9 @@ class TestUi(odoo.tests.HttpCase):
# - that this test awaits for hardcoded USDs amount
# we have to force company currency as USDs only for this test
self.cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref('base.USD').id, self.env.ref('base.main_company').id])
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('event_buy_tickets')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event_buy_tickets.ready", login="admin")
+ self.start_tour("/", 'event_buy_tickets', login="admin")
def test_demo(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('event_buy_tickets')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event_buy_tickets.ready", login="demo")
+ self.start_tour("/", 'event_buy_tickets', login="demo")
# TO DO - add public test with new address when convert to web.tour format.
diff --git a/addons/website_forum/tests/test_forum_process.py b/addons/website_forum/tests/test_forum_process.py
index 367186ccbfd..d367f6e3804 100644
--- a/addons/website_forum/tests/test_forum_process.py
+++ b/addons/website_forum/tests/test_forum_process.py
@@ -6,10 +6,10 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_admin_forum_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('question')", "odoo.__DEBUG__.services['web_tour.tour'].tours.question.ready", login="admin")
+ self.start_tour("/", 'question', login="admin")
def test_02_demo_question(self):
forum = self.env.ref('website_forum.forum_help')
demo = self.env.ref('base.user_demo')
demo.karma = forum.karma_post + 1
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('forum_question')", "odoo.__DEBUG__.services['web_tour.tour'].tours.forum_question.ready", login="demo")
+ self.start_tour("/", 'forum_question', login="demo")
diff --git a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
index 1d406ea01b5..53c8f921016 100644
--- a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
+++ b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
@@ -7,7 +7,7 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestWebsiteHrRecruitmentForm(odoo.tests.HttpCase):
def test_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_hr_recruitment_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_hr_recruitment_tour.ready")
+ self.start_tour("/", 'website_hr_recruitment_tour')
# check result
record = self.env['hr.applicant'].search([('description', '=', '### HR RECRUITMENT TEST DATA ###')])
diff --git a/addons/website_links/tests/test_ui.py b/addons/website_links/tests/test_ui.py
index 6a8e317eab1..e21473b33a5 100644
--- a/addons/website_links/tests/test_ui.py
+++ b/addons/website_links/tests/test_ui.py
@@ -13,4 +13,4 @@ class TestUi(odoo.tests.HttpCase):
'source_id': 2,
'url': self.env["ir.config_parameter"].sudo().get_param("web.base.url") + '/contactus',
})
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_links_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_links_tour.ready", login="admin")
+ self.start_tour("/", 'website_links_tour', login="admin")
diff --git a/addons/website_sale/tests/test_customize.py b/addons/website_sale/tests/test_customize.py
index 944d6f33a93..deab4212c5c 100644
--- a/addons/website_sale/tests/test_customize.py
+++ b/addons/website_sale/tests/test_customize.py
@@ -42,7 +42,7 @@ class TestUi(odoo.tests.HttpCase):
product_template.create_variant_ids()
def test_01_admin_shop_customize_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_customize')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_customize.ready", login="admin")
+ self.start_tour("/", 'shop_customize', login="admin")
def test_02_admin_shop_custom_attribute_value_tour(self):
# Make sure pricelist rule exist
@@ -65,7 +65,7 @@ class TestUi(odoo.tests.HttpCase):
pricelist.discount_policy = 'without_discount'
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_custom_attribute_value')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_custom_attribute_value.ready", login="admin")
+ self.start_tour("/", 'shop_custom_attribute_value', login="admin")
def test_03_public_tour_shop_dynamic_variants(self):
""" The goal of this test is to make sure product variants with dynamic
@@ -114,7 +114,7 @@ class TestUi(odoo.tests.HttpCase):
# 0 to not bother with the pricelist of the public user
ptav.price_extra = 0
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('tour_shop_dynamic_variants')", "odoo.__DEBUG__.services['web_tour.tour'].tours.tour_shop_dynamic_variants.ready")
+ self.start_tour("/", 'tour_shop_dynamic_variants')
def test_04_portal_tour_deleted_archived_variants(self):
"""The goal of this test is to make sure deleted and archived variants
@@ -172,7 +172,7 @@ class TestUi(odoo.tests.HttpCase):
# delete second combination (which is now first variant since cache has been cleared)
product_template.product_variant_ids[0].unlink()
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('tour_shop_deleted_archived_variants')", "odoo.__DEBUG__.services['web_tour.tour'].tours.tour_shop_deleted_archived_variants.ready", login="portal")
+ self.start_tour("/", 'tour_shop_deleted_archived_variants', login="portal")
def test_05_demo_tour_no_variant_attribute(self):
"""The goal of this test is to make sure attributes no_variant are
@@ -211,7 +211,7 @@ class TestUi(odoo.tests.HttpCase):
product_template.create_variant_ids()
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('tour_shop_no_variant_attribute')", "odoo.__DEBUG__.services['web_tour.tour'].tours.tour_shop_no_variant_attribute.ready", login="demo")
+ self.start_tour("/", 'tour_shop_no_variant_attribute', login="demo")
def test_06_admin_list_view_b2c(self):
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_list_view_b2c')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_list_view_b2c.ready", login="admin")
+ self.start_tour("/", 'shop_list_view_b2c', login="admin")
diff --git a/addons/website_sale/tests/test_sale_process.py b/addons/website_sale/tests/test_sale_process.py
index ae3f63e436f..33cf200cf12 100644
--- a/addons/website_sale/tests/test_sale_process.py
+++ b/addons/website_sale/tests/test_sale_process.py
@@ -6,12 +6,12 @@ import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_admin_shop_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop.ready", login="admin")
+ self.start_tour("/", 'shop', login="admin")
def test_02_admin_checkout(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_buy_product')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_buy_product.ready", login="admin")
+ self.start_tour("/", 'shop_buy_product', login="admin")
def test_03_demo_checkout(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_buy_product')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_buy_product.ready", login="demo")
+ self.start_tour("/", 'shop_buy_product', login="demo")
# TO DO - add public test with new address when convert to web.tour format.
diff --git a/addons/website_sale/tests/test_website_sale_cart_recovery.py b/addons/website_sale/tests/test_website_sale_cart_recovery.py
index 4aaa0433886..3dd3206506a 100644
--- a/addons/website_sale/tests/test_website_sale_cart_recovery.py
+++ b/addons/website_sale/tests/test_website_sale_cart_recovery.py
@@ -10,4 +10,4 @@ class TestWebsiteSaleCartRecovery(HttpCase):
def test_01_shop_cart_recovery_tour(self):
"""The goal of this test is to make sure cart recovery works."""
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_cart_recovery')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_cart_recovery.ready", login="portal")
+ self.start_tour("/", 'shop_cart_recovery', login="portal")
diff --git a/addons/website_sale/tests/test_website_sale_image.py b/addons/website_sale/tests/test_website_sale_image.py
index 1a306d2181a..c873fffef15 100644
--- a/addons/website_sale/tests/test_website_sale_image.py
+++ b/addons/website_sale/tests/test_website_sale_image.py
@@ -202,7 +202,7 @@ class TestWebsiteSaleImage(odoo.tests.HttpCase):
# self.env.cr.commit() # uncomment to save the product to test in browser
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_zoom')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_zoom.ready", login="admin")
+ self.start_tour("/", 'shop_zoom', login="admin")
# CASE: unlink move image to fallback if fallback image empty
template.image = False
diff --git a/addons/website_sale/tests/test_website_sale_mail.py b/addons/website_sale/tests/test_website_sale_mail.py
index 8cb495b5db9..5764c6d8141 100644
--- a/addons/website_sale/tests/test_website_sale_mail.py
+++ b/addons/website_sale/tests/test_website_sale_mail.py
@@ -21,4 +21,4 @@ class TestWebsiteSaleMail(HttpCase):
MailMail = odoo.addons.mail.models.mail_mail.MailMail
with patch.object(MailMail, 'unlink', lambda self: None):
- self.browser_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_mail')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_mail.ready", login="admin")
+ self.start_tour("/", 'shop_mail', login="admin")
diff --git a/addons/website_sale_coupon/tests/test_shop_sale_coupon.py b/addons/website_sale_coupon/tests/test_shop_sale_coupon.py
index 1ab113c83a8..24061326689 100644
--- a/addons/website_sale_coupon/tests/test_shop_sale_coupon.py
+++ b/addons/website_sale_coupon/tests/test_shop_sale_coupon.py
@@ -12,9 +12,4 @@ class TestUi(HttpCase):
def test_01_admin_shop_sale_coupon_tour(self):
# pre enable "Show # found" option to avoid race condition...
self.env.ref("website_sale.search count").write({"active": True})
- self.phantom_js(
- "/",
- "odoo.__DEBUG__.services['web_tour.tour'].run('shop_sale_coupon')",
- "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_sale_coupon.ready",
- login="admin",
- )
+ self.start_tour("/", 'shop_sale_coupon', login="admin")
diff --git a/addons/website_sale_wishlist/tests/test_wishlist_process.py b/addons/website_sale_wishlist/tests/test_wishlist_process.py
index 26b13dd0957..5f0fc99e08a 100644
--- a/addons/website_sale_wishlist/tests/test_wishlist_process.py
+++ b/addons/website_sale_wishlist/tests/test_wishlist_process.py
@@ -7,4 +7,4 @@ import odoo.tests
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_wishlist_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_wishlist')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_wishlist.ready")
+ self.start_tour("/", 'shop_wishlist')