我无法运行量角器打字稿样本。我正在收到错误。我已经安装了jasmine等类型。
这是我的代码:
import {Config} from 'protractor';
export let config: Config = {
framework: 'jasmine',
capabilities: {
browserName: 'chrome'
},
specs: [ 'spec.js' ],
seleniumAddress: 'localhost:4444/wd/hub',
// You could set no globals to true to avoid jQuery '$' and protractor '$'
// collisions on the global namespace.
noGlobals: true
};
我收到此错误:
root@localhost exampleTypescript]# protractor conf.ts [06:08:07] E/configParser - Error code: 105 [06:08:07] E/configParser - Error message: failed loading configuration file conf.ts [06:08:07] E/configParser - /usr/lib/node_modules/protractor/exampleTypescript/conf.ts:11 import {Config} from 'protractor'; ^^^^^^
答案 0 :(得分:0)
您应该运行protractor.conf.js
而不是protractor.conf.ts
。在tsconfig.js
中,您为已编译文件设置了一个文件夹(从ts
到js
)= outDir
属性。因此,您需要从protractor.conf.js
中设置的文件夹中运行tsconfig
,例如node ./dist/config/protractor.conf.js
而不是node ./config/protractor.conf.js