我是量角器的新手。我按照https://www.protractortest.org/#/中提到的步骤 运行命令 protractor conf.js 时,浏览器会立即打开和关闭。我在命令行中收到以下错误:
[22:41:08] E/launcher - 进程退出,错误代码 100
我尝试通过在 conf.js 中添加功能在 Firefox 中执行
文件内容:
规范.js
import { element } from "protractor";
describe('angularjs homepage todo list', function() {
it('should add a todo', async function() {
await browser.get('https://angularjs.org');
await element(by.model('todoList.todoText')).sendKeys('write first protractor test');
await element(by.css('[value="add"]')).click();
var todoList = element.all(by.repeater('todo in todoList.todos'));
expect(await todoList.count()).toEqual(3);
expect(await todoList.get(2).getText()).toEqual('write first protractor test');
// You wrote your first test, cross it off the list
await todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(await completedAmount.count()).toEqual(2);
});
});
conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
//useAllAngular2AppRoots: true,
//directConnect=true,
/* capabilities: {
'browserName': 'firefox'
} */
};