Odoo Help

0

ReferenceError when testing odoo UI with web.Tour, phantomjs

By
Nguyễn Thông
on 8/31/17, 2:35 PM 469 views

Currently, I'm using web.Tour from odoo to testing. Although it run successfully on browser console with command:

    odoo.__DEBUG__.services['web.Tour'].run('create_new_cpo', 'test');

But when I trying to running on Terminal console with this command:

    ./openerp-server --addons-path my_path -d my_database --log-level=test -u my_module --test-enable

I get the error: 

    openerp.tests.common: phantomjs: u"ReferenceError: Can't find variable: odoo\n at :1\n(leaf frame on top)"

Here is my log:

    INFO my_database openerp.tests.common: phantomjs: loaded http://127.0.0.1:8069/ success
    INFO my_database openerp.tests.common: phantomjs: PhantomTest.run: wait for condition: odoo.__DEBUG__.services['web.Tour'].tours.create_new_cpo
    INFO my_database openerp.tests.common: phantomjs: page.evaluate eval expr: odoo.__DEBUG__.services['web.Tour'].tours.create_new_cpo
    INFO my_database openerp.tests.common: phantomjs: page.evaluate eval result: false
    INFO my_database openerp.tests.common: phantomjs: PhantomTest.run: condition statified, executing: odoo.__DEBUG__.services['web.Tour'].run('create_new_cpo', 'test')
    ERROR my_database openerp.tests.common: phantomjs: u"ReferenceError: Can't find variable: odoo\n at :1\n(leaf frame on top)"

Here is my .py test script

    from openerp.tests import HttpCase    
    class TestCPO(HttpCase):
        post_install = True
        at_install = False
    
        def test_01_create_cpo(self):
            self.phantom_js(
                "/",
                "odoo.__DEBUG__.services['web.Tour'].run('create_new_cpo', 'test')",
                "odoo.__DEBUG__.services['web.Tour'].tours.create_new_cpo",
                login="admin")

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 8/31/17, 2:35 PM
Seen: 469 times
Last updated: 9/1/17, 1:16 AM