跳至內容
選單
此問題已被標幟
4827 瀏覽次數

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")
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 15
4179
1
11月 21
5930
0
8月 21
4
0
7月 24
4480
0
10月 19
3100