Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4930 Переглядів

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")
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 15
4240
1
лист. 21
6067
0
серп. 21
4
0
лип. 24
4555
0
жовт. 19
3200