在第 3 步之后为 Nick 的答案添加更多内容。点击转换为 tern 项目,您将要求选择模块,留下那个
自动选择,另外选择
Angular JS
浏览器
浏览器扩展
量角器
茉莉花。
然后在项目级别写入单击并创建一个新文件 samfirstspec.js
复制https://www.protractortest.org/#/tutorial第0步的内容——写一个测试
// samfirstspec.js
describe('Protractor Demo App', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
expect(browser.getTitle()).toEqual('Super Calculator');
});
});
下一步是创建配置文件。在项目级别写入单击并创建一个新文件
将以下内容复制到 myconfig.js 中
// conf.js
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['samfirstspec.js']
}
这个配置告诉 Protractor 你的测试文件(规格)在哪里,
以及在哪里与您的 Selenium 服务器 (seleniumAddress) 交谈。它指定我们将使用 Jasmine 作为测试框架。
它将使用所有其他配置的默认值。 Chrome 是默认浏览器。
下一步是运行脚本,所以通过 cmd 转到项目源代码位置
F:\Learning\Repositories\protractor-sam-test-scripts\EclipsePro
在cmd中输入
量角器 myconfig.js
也参考这个 - https://www.protractortest.org/#/tutorial