diff --git a/lib/next/index.js b/lib/next/index.js index 6b6e44d2..1366a377 100644 --- a/lib/next/index.js +++ b/lib/next/index.js @@ -6,7 +6,8 @@ module.exports = wd => { 'pagePopup' ].map(method => { wd.addPromiseChainMethod(method, function(...params) { - return this.next(method, params); + const [func, ...args] = params; + return this.next(method, [{ func, args }]); }); }); diff --git a/package.json b/package.json index 0fb7d401..34949da7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macaca-wd", - "version": "4.2.1", + "version": "4.2.2", "description": "Macaca webdirver API for Node.js", "keywords": [ "macaca", diff --git a/test/utility.test.js b/test/utility.test.js index 0e290ccf..a1ab57e1 100644 --- a/test/utility.test.js +++ b/test/utility.test.js @@ -199,11 +199,11 @@ describe('test/utility.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#page + * https://macacajs.github.io/macaca-wd/#pagePopup */ - describe('popup', async () => { + describe('pagePopup', async () => { it('should work', async () => { - await driver.popup('url'); + await driver.pagePopup('url'); assert.equal(server.ctx.url, '/wd/hub/session/sessionId/next'); assert.equal(server.ctx.method, 'POST'); assert.deepEqual(server.ctx.response.body, {