jqxグリッドの[すべて選択]ボタンが選択されているかどうかを確認するテストを作成しようとしています。分度器でチェックボックスが選択されているかどうかをテストできません
describe('should check jq widgets', function() {
it('should check if checkbox is checked or not', function() {
browser.ignoreSynchronization = true;
browser.get('http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/checkboxselection.htm?arctic');
browser.wait(protractor.ExpectedConditions.visibilityOf($('#contenttablejqxgrid')),50000);
$("#columntablejqxgrid>div>div>div").click();
expect($("#columntablejqxgrid>div>div>div").isSelected()).toEqual(true);
});
});
マイjq.conf.jsを::
exports.config = {
directConnect: true,
framework: 'jasmine',
specs: ['jq.spec.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeOutInterval: 3000000
},
}
でもchechbox私のテストが偽として実態を与えている
これは私が私のjq.spec.jsに書いたダミーテストコードですが選択される。
Failures:
1) should check jq widgets should check if checkbox is checked or not
Message:
Expected false to equal true.
Stack:
Error: Failed expectation
私のロケータを複数回変更して、ロケータが使用されているかどうかを確認しました(異なるchild div、spanを使用)。
チェックボックスが実際にチェックされているかどうかを確認できますか? – jdgower
あなたのセレクタが 'div'を見つけている場合、このdiv - expect($( "#columntablejqxgrid> div> div> div")内にある場合、チェックボックスを見つける必要があります。isSelected())... – Grasshopper
@jdgower:はい、私はいくつかのブラウザに入れました。それはチェックされていることを確認してください。 – Ravi