我正在使用 Protractor 编写 AngularJS e2e 测试用例。我的应用程序使用 jqxGrid(来自 jqxWidgets)。在我的测试用例中,我需要测试 jqxGrid 的大小,这在 js 中由
gridSelector.jqxGrid('getrows').length
测试用例是
it('should check grid size', function() {
var grid = browser.findElement(by.id('jqxoutbox'));
grid.findElements( by.css('div:nth-child(2) > div')).then(function(results){
console.log(results[0].jqxGrid('getrows').length);
});
});
现在在我的测试用例中,我可以找到 gridSelector id,但无法执行 jqxGrid 函数来查找大小。
StackTrace :
Failures:
1) e2e: main should have grid element
Message:
TypeError: Object [object Object] has no method 'jqxGrid'
Stacktrace:
TypeError: Object [object Object] has no method 'jqxGrid'
请提供有关如何在我的测试用例中访问我的 jqxGrid 函数的任何帮助。