2
我知道在Karma中有使用预处理器的选项,但是在量角器中我看不到同样的东西。我目前使用onPrepare选项,但我想知道是否有可能/目前是否有办法让npm模块总是先运行(基本上与onPrepare相同),但通过配置,而不必做任何需要等量角器JS预处理器
我知道在Karma中有使用预处理器的选项,但是在量角器中我看不到同样的东西。我目前使用onPrepare选项,但我想知道是否有可能/目前是否有办法让npm模块总是先运行(基本上与onPrepare相同),但通过配置,而不必做任何需要等量角器JS预处理器
尝试使用就像在你的package.json脚本的东西:
"scripts": {
"postinstall": "bower install",
"pretest": "npm install",
"test": "karma start test/karma.conf.js",
"test-single-run": "karma start test/karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver && node setUp.js",
"protractor": "protractor test/protractor-conf.js",
"postprotractor": "node tearDown.js",
}
通过说你CMD“运行故宫量角器”,在预(setUp.js)脚本和postprotractor(拆卸.js)将在您的e2e测试之前和之后运行。