私はProtractorJSでAngular 2プロジェクトをエンドツーエンドでテストしようとしています。 私は私のコンソールでprotractor conf.js
を実行すると、私が手:ProtractorJS:分度器がページと同期するのを待っている間にエラーが発生しました:「要素のテスト容易性が見つかりませんでした」
Failed: Error while waiting for Protractor to sync with the page: "Could not
find testability for element."
設定ファイル内部:
exports.config = {
seleniumAddress: "http://localhost:4444/wd/hub",
framework:"jasmine2",
capabilities: {"browserName": "chrome"},
specs: ["todo-spec.js"]
};
マイルートコンポーネント:
<section>
<h1>Employee Payroll Information Directory</h1>
<employee-searchform></employee-searchform>
</section>
これは私がしようとしているテストです実行する:
describe('modal component', function() {
it('should output the employee and delete it from the array', function() {
browser.get('http://localhost:80/Fourth/Fourth/');
var searchField = element(by.className('.ng-valid'));
searchField.click();
searchField.sendKeys('Skye');
searchField.getText().then(function (text) {
console.log(text);
});
var employeeListItem = element(by.id('employee-list'));
});
});
これは私がwebdriverをSeleniumサーバー上で得るものです:
23:57:25.816 INFO - Done: [execute async script: try { return (function (rootSel
ector, callback) {
var el = document.querySelector(rootSelector);
try {
if (window.getAngularTestability) {
window.getAngularTestability(el).whenStable(callback);
return;
}
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
23:57:25.899 INFO - Executing: [delete session: 35adb055-eee3-419e-b3c1-461b65b4
18aa])
23:57:29.157 INFO - Done: [delete session: 35adb055-eee3-419e-b3c1-461b65b418aa]
@alecxeただ追加しました。 –
@alecxeこれは角2です。私の主な構成要素は、 ' 'カスタムタグ –
です。使用している分度器のバージョンは? – alecxe