angularjs – 集成量角器与Yeoman通过Grunt
发布时间:2020-12-17 08:55:56 所属栏目:安全 来源:网络整理
导读:我想将量角器与Yeoman制作的支架集成。我按照一个教程,在其中,旧的情景运行器用于设置e2e测试(通过grunt)。 我想升级我的脚手架,使用量角器。 有什么想法吗? 从npm安装量角器和grunt-quantractor-runner: npm install protractor grunt-protractor-runn
我想将量角器与Yeoman制作的支架集成。我按照一个教程,在其中,旧的情景运行器用于设置e2e测试(通过grunt)。
我想升级我的脚手架,使用量角器。
>从npm安装量角器和grunt-quantractor-runner:
npm install protractor grunt-protractor-runner --save-dev >为量角器(protractor.conf.js)创建一个配置文件,将specs和baseUrl更改为测试文件和测试服务器: exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub',specs: ['test/e2e/*_test.js'],baseUrl: 'http://localhost:9001' //default test port with Yeoman } >更新您的Gruntfile.js,在karma任务后添加以下内容: protractor: { options: { keepAlive: true,configFile: "protractor.conf.js" },run: {} } >添加要测试的量角器任务 grunt.registerTask('test',[ 'clean:server','concurrent:test','autoprefixer','connect:test','karma','protractor:run' ]); >下载并启动selenium服务器: node_modules/protractor/bin/webdriver-manager update node_modules/protractor/bin/webdriver-manager start (在Windows (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |