我想登錄在我的Wordpress網站,但似乎登錄無法成功。如何使用zombie.js登錄到WordPress的管理員?
describe('Administrator', function(){
const browser = new Browser();
this.timeout(10000);
before(function() {
return browser.visit(baseUrl+'wp-login.php');
});
it('Login into wp-admin', function(done){
browser.fill('#user_login', 'my_username')
.fill('#user_pass', 'my_password')
.pressButton('#wp-submit',
function(){
console.log(browser.text('title')); // My Wordpress ‹ Log In
//browser.assert.element('body.wp-admin');
//done();
});
});
after(function() {
browser.destroy();
});
});
當我做記錄由browser.text('title')
其返回我的WordPress <登錄沒有控制檯<我的WordPress
這意味着它不會成功。我嘗試用wait()
,then()
,setTimeout()
檢查之前,所以它的錯誤,如:
Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
任何想法?
感謝您的修復! – l2aelba