- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用 ProtractorJS 对我的 Angular 2 项目进行端到端测试。当我在控制台中运行 protractor conf.js
时,我得到:
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]
最佳答案
您应该将 Protractor 指向包含 Angular 应用程序的元素。这可以通过设置 rootElement
来完成。在你的 Protractor 配置中:
rootElement: 'app',
关于selenium - Protractor : Error while waiting for Protractor to sync with the page: "Could not find testability for element.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38883505/
是否可以使用 MS Sync Framework 同步不同数据库中的不同表(具有完全不同的结构),假设其中一个表具有主键,另一个具有唯一索引,其值与第一个表的 PK 一致(但不能晋级PK)?列名也可以
我正在开发一个使用 Twilio Sync 作为数据库的应用程序。我确实订阅了很多事件,例如 itemAdded、itemUpdated、itemRemoved,以使用 Sync Javascript
我们计划使用 ADO.NET 的同步服务将商店与总部同步,有人建议我通过 进行同步。 WCF 代理 . 通过 WCF 代理同步是否意味着我将能够 通过 http 同步 ?如果没有,是否可以使用同步服务
在 Sync Framework 2.1 中,批处理似乎得到了内置支持,因此在某些提供程序中,我们可以只提及批处理大小和假脱机文件位置(以及一些其他属性),批处理将得到处理。开发人员不必编写自己的批处
'sync' 事件和 Backbone.sync 有什么区别? ...它们分别是什么? 最佳答案 虽然两者都与向服务器同步数据的任务有关,但两者之间没有任何联系。 Backbone.sync实现您的
在 Go 中,我们可以使用: type Data struct { lock *sync.Mutex } 或 type Data struct { lock sync.Mutex
我们在各种客户项目中使用 Microsoft Sync Framework 2.1 进行文件和数据库同步。扩展支持将于 2021 年结束。 所以我的问题是: 微软的同步框架策略是什么?它会是开源的,所
我在这个站点和其他站点上看到了一些帖子,指出问题通常是由将表添加到客户端的 SyncAgent 配置或提供者端的 SyncAdapter 的顺序引起的。我相信我在这两个地方都正确地对表格进行了排序(我
Using an Asynchronous Controller in ASP.NET MVC 的使用 BeginMethod/EndMethod 模式部分指的是 Sync() 方法。它没有链接,我无
这是代码: type someThing struct { sync.Mutex cv *sync.Cond num int } func NewSometh
异步地做多项工作(排序向量,主要是函数计算(计算是计算或内存限制,目前,我可以用以下方式编写这些操作: 使用 Threads.@spawn _f1 = Threads.@spawn f1(x) _f2
我想使用 Rust 和 once_cell实现一些静态常量结构实例,一个静态常量向量包含这些静态结构实例。 示例代码如下: use once_cell::sync::Lazy; pub struct
我想使用 Rust 和 once_cell实现一些静态常量结构实例,一个静态常量向量包含这些静态结构实例。 示例代码如下: use once_cell::sync::Lazy; pub struct
看了sync.Pool的设计,发现是两个逻辑,为什么要用localPool来解决锁竞争。我们可以只使用 chan 来实现一个。 使用 channel 比 sync.pool 快 4 倍! pool除了
我有一个编码为在模糊时运行 save_notes 函数的文本区域。当 save_notes 调用时,我在控制台中得到以下内容: TypeError: Cannot read property 'syn
如果 Waitgroups 和 Mutex 总是需要通过引用传递,我们不能把它做成引用类型(禁止使用它们作为值传递)吗?我的意思是有没有我们需要使用它们按值传递的用例? 最佳答案 当您将任何参数作为值
背景:我正在尝试创建一个完全异步 Node js 演示的小测试。然后我可以看到一个好的样本是什么样的,以便清理我完成的其他一些项目。 这是我的代码 //https://medium.com/@tkss
http://msdn.microsoft.com/en-us/library/dd918848.aspx “了解作用域是表和筛选器的组合很重要。例如,您可以定义一个名为 sales-WA 的筛选作用
我尝试同步我的 Visual Studio 代码设置/扩展。我手动执行的许多同步步骤。 然后我发现了这两个工具 https://code.visualstudio.com/docs/editor/se
我正在尝试移植一个扩展,但我的 JS 非常生疏。 https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chro
我是一名优秀的程序员,十分优秀!