As a beginner in e2e testing, I have taken the following steps:
- Installed protractor by using
nmp install protractor
- Installed webdriver-manager
- Ran
webdriver-manager start
from the directory where my AngularJS app is located. The command executed successfully. - Executed
protractor tests/e2e/conf.js
and it ran without any issues
However, after a few seconds, an error message appears saying
Timed out waiting for page to load
Below are the contents of my files:
tests/e2e/conf.js:
// Sample configuration file.
exports.config = {
// Address of the 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 directory 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 ptr;
describe('addressBook homepage', function() {
var ptor;
beforeEach(function() {
ptor = protractor.getInstance();
});
it('should greet the named user', function() {
browser.get('/');
element(by.model('yourName')).sendKeys('Julie');
var greeting = element(by.binding('yourName'));
expect(greeting.getText()).toEqual('Hello Julie!');
});
});
I am struggling to determine where to define my webapp layout/placement so that Protractor/webdriver can understand which context to run in.