0
首先,我是一个e2e测试的noob。我所做的就是AngularJS:使用量角器测试e2e
- 安装量角器
nmp install protractor
- 安装webdriver的经理
- 运行
webdriver-manager start
从那里我angularjs应用程序位于该目录。它运行良好 - 运行
protractor tests/e2e/conf.js
它也运行良好
然而,在几秒钟内,它说Timed out waiting for page to load
这里是我的文件:
测试/ E2E/conf.js:
// An example configuration file.
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['example_spec.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
tests/e2e/example_spec.js
var protr;
describe('addressBook homepage', function() {
var ptor;
beforeEach(function() {
ptor = protractor.getInstance();
});
it('should greet the named user', function() {
browser.get('/'); // <-- exception here
element(by.model('yourName')).sendKeys('Julie');
var greeting = element(by.binding('yourName'));
expect(greeting.getText()).toEqual('Hello Julie!');
});
});
我只是不明白的地方,以便量角器/ webdriver的知道跑哪方面来定义我的web应用程序laypout /位置。
谢谢你的回答。但如何知道baseUrl? – Archer
这是您要测试的网站的网址! – Dan
我想测试我的网站的本地副本,我认为应该在量角器/ webdriver启动时自动启动。 – Archer