我無法在量角器中運行測試。我是一名初學者,我正在努力學習。如果有人幫助我,我將不勝感激。量角器登錄頁面並測試端到端導航
Conf.js
// An example configuration file.
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: [
'Login_spec.js',
// 'editprofile_spec.js',
],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 80000
}
};
Spec.js
describe('angularjs homepage', function() {
it('should be able to login',function() {
browser.get('http://www.jnbmusic.com/player/#/login');
element(by.model('username')).sendKeys('[email protected]');
element(by.model('password')).sendKeys('jack1234');
});
element(by.css('[ng-click="login()"]')).click();
});
,但我得到的錯誤,
Error: Error while waiting for Protractor to sync with the page: "window.angular is undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
Any one please help me
檢查NG-應用屬性。如果它不在
標記中。確定放置ng-app的標籤的css定位器策略。並在conf.js文件中提及該css值爲「rootElement:ccvalue」 –