diff --git a/lib/next/index.js b/lib/next/index.js index beac1e9..785f931 100644 --- a/lib/next/index.js +++ b/lib/next/index.js @@ -13,6 +13,7 @@ module.exports = wd => { [ 'page', 'pagePopup', + 'locator', 'browser', 'browserType', ].forEach(method => { diff --git a/package.json b/package.json index 0b75304..5898881 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macaca-wd", - "version": "4.3.3", + "version": "4.3.4", "description": "Macaca webdirver API for Node.js", "keywords": [ "macaca", diff --git a/test/utility.test.js b/test/utility.test.js index 9e555db..590820d 100644 --- a/test/utility.test.js +++ b/test/utility.test.js @@ -188,6 +188,23 @@ describe('test/utility.test.js', function() { }); }); }); + + /** + * https://macacajs.github.io/macaca-wd/#locator + */ + describe('locator', async () => { + it('should work', async () => { + await driver.locator(''); + 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: '', + }); + }); + }); + /** * https://macacajs.github.io/macaca-wd/#pageIframe */