diff --git a/lib/next/index.js b/lib/next/index.js index cb79e5e1..6cf2194f 100644 --- a/lib/next/index.js +++ b/lib/next/index.js @@ -3,7 +3,8 @@ module.exports = wd => { [ 'page', - 'pagePopup' + 'pagePopup', + 'browser' ].map(method => { wd.addPromiseChainMethod(method, function(...params) { const [ func, ...args ] = params; diff --git a/test/utility.test.js b/test/utility.test.js index a1ab57e1..d4052291 100644 --- a/test/utility.test.js +++ b/test/utility.test.js @@ -213,4 +213,19 @@ describe('test/utility.test.js', function() { }); }); }); + /** + * https://macacajs.github.io/macaca-wd/#browser + */ + describe('browser', async () => { + it('should work', async () => { + await driver.browser('version'); + 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: '' + }); + }); + }); });