描述未定义,我的配置文件无法在量角器上运行



我正在尝试量角器进行测试,但是在安装和配置后,我尝试运行并发生以下错误:

ReferenceError: describe is not defined
at Object.<anonymous> (c:Usersandre.mendesWebstormProjectspilotopiloto.js:2:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

这是我的代码:

describe('angularjs homepage', function() {
    it('should greet the named user', function() {
        browser.get('http://www.angularjs.org');
        element(by.model('yourName')).sendKeys('TheRoks');
        var greeting = element(by.binding('yourName'));
        expect(greeting.getText()).toEqual('Hello TheRoks!');
    });})

所以,我尝试运行我的配置文件,但没有任何反应。

从一个干净的项目开始,然后开始使用它。我建议您使用约曼生成器。https://www.npmjs.org/package/generator-protractor

最新更新