diff --git a/lib/next/index.js b/lib/next/index.js index 1366a377..e88376a4 100644 --- a/lib/next/index.js +++ b/lib/next/index.js @@ -6,21 +6,15 @@ module.exports = wd => { 'pagePopup' ].map(method => { wd.addPromiseChainMethod(method, function(...params) { - const [func, ...args] = params; - return this.next(method, [{ func, args }]); + const [ func, ...args ] = params; + return this.next(method, [ { func, args } ]); }); }); [ - 'elementStatus' - ].map(method => { - wd.addPromiseChainMethod(method, function(...params) { - return this.next(method, params); - }); - }); - - [ - 'fileChooser' + 'fileChooser', + 'elementStatus', + 'rebuildContextPage' ].map(method => { wd.addPromiseChainMethod(method, function(...params) { return this.next(method, params); @@ -32,8 +26,8 @@ module.exports = wd => { 'keyboard' ].map(method => { wd.addPromiseChainMethod(method, function(...params) { - const [type, ...args] = params; - return this.next(method, [{ type, args }]); + const [ type, ...args ] = params; + return this.next(method, [ { type, args } ]); }); }); }; diff --git a/package.json b/package.json index 34949da7..f294b8f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macaca-wd", - "version": "4.2.2", + "version": "4.2.3", "description": "Macaca webdirver API for Node.js", "keywords": [ "macaca", diff --git a/test/utility.test.js b/test/utility.test.js index a1ab57e1..54b3030a 100644 --- a/test/utility.test.js +++ b/test/utility.test.js @@ -213,4 +213,20 @@ describe('test/utility.test.js', function() { }); }); }); + + /** + * https://macacajs.github.io/macaca-wd/#rebuildContextPage + */ + describe('rebuildContextPage', async () => { + it('should work', async () => { + await driver.rebuildContextPage(null, {}); + assert.equal(server.ctx.url, '/wd/hub/session/sessionId/next'); + assert.equal(server.ctx.method, 'POST'); + assert.deepEqual(server.ctx.response.body, { + sessionId: 'sessionId', + status: 0, + value: '' + }); + }); + }); });