量角器 - 无法读取未定义的属性“$$testability" [英] Protractor - Cannot read property '$$testability' of undefined

查看:41
本文介绍了量角器 - 无法读取未定义的属性“$$testability"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个错误消息:

"Error while waiting for Protractor to synce with the page: "Cannot read property '$$testability' of undefined"

下面是我的测试.

describe('On the MyMoments page', function(){  

    beforeEach(function() {
        var editLocationText = 'Location';

        browser.driver.get('http://192.168.0.6:8100/#/page1/myMoments');
    });

    it('The edit button should work', function() {
        browser.driver.get('http://192.168.0.6:8100/#/page1/myMoments').then(function() {
            // browser.waitForAngular();
            browser.getCurrentUrl().then(function(url) {

            });
        });


    });
});

这是我的配置文件:

exports.config = {  
    capabilities: {
        'browserName': 'chrome',
        'chromeOptions': {                
            args: ['--disable-web-security']
        } 
    },
    baseUrl: 'http://192.168.0.6:8100',
    specs: [
    '*.test.js'
    ],
    jasmineNodeOpts: {
        isVerbose: true,
    }
};

我认为这与我的测试无关,因为我的测试非常简单.有没有人遇到过这个问题?我有点卡住了.

I don't think this is something to do with my test since my test is incredibly simple. Has anybody run into this issue before? I'm a bit stuck.

谢谢.

将我的量角器版本一直降级到 4.0.14 以修复此错误.现在我得到:

Downgraded my Protractor version all the way to 4.0.14 in order to fix this error. Now i'm getting:

"Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability/http://errors.angularjs.org/1.5.3/ng/test"

如果有人知道这是什么或如何解决这个问题,请告诉我!

If anyone knows what this is or how to resolve this, let me know!

谢谢.

推荐答案

这是 Protractor 中的一个已知问题,请参阅 此处.正如问题中提到的,这是因为如果没有传递给它的值, browser.angularAppRoot() 应该返回 app root 的当前值,但当前返回 undefined.一个新版本即将发布,应该可以解决这个问题.

This is a known issue in Protractor, see here. As mentioned in the issue this is because browser.angularAppRoot() is expected to return the current value of app root if a value isn't passed to it, but currently returns undefined. A new release is coming that should fix this issue.

希望能帮到你

这篇关于量角器 - 无法读取未定义的属性“$$testability"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆