jqueryに依存しないWebアプリケーションがあります。
私は(素晴らしい:))casperjsのおかげで機能テストを行っています。
ここで、テストでjqueryを使用したいと思います。そこで、ここhttp://casperjs.org/faq.html#faq-jqueryに示されているように注入しようとしました。まあ、それは機能していません。
あなたが私を助けることができるなら、これが私のコードです-何か問題がありますか?:
casper.start('http://localhost:8080/xxxxxx/xxxxxDialogTests.html');
casper.echo("page = " + casper.page); // -> it works, the page is there
casper.page.injectJs("../tools/jquery-1.7.2.js");
casper.waitFor(function check()
{
return this.visible('#button_create');
},
function then()
{
this.click('#button_create');
casper.waitFor(function check()
{
return this.visible('#dialog_document_name');
},
function then()
{
console.log("element : ", this.evaluate(function ()
{
var el = $("input#dialog_document_name");
return el;
}));
});
});
それがポイントではないので、私はテストを削除しました...
ありがとう!