From a87a0e32cdf52c22a2680ac63e4366d76000e654 Mon Sep 17 00:00:00 2001 From: yihuineng <471110230@qq.com> Date: Thu, 12 Oct 2023 19:48:01 +0800 Subject: [PATCH] fix: ci --- test/utility.test.js | 26 ------------------------ test/window.test.js | 48 +++++++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/test/utility.test.js b/test/utility.test.js index 30519c2..7fcbc42 100644 --- a/test/utility.test.js +++ b/test/utility.test.js @@ -120,32 +120,6 @@ describe('test/utility.test.js', function() { }); }); - /** - * https://macacajs.github.io/macaca-wd/#initWindow - */ - describe('initWindow', async () => { - it('should work', async () => { - await driver.initWindow({ - width: 800, - height: 600, - }); - assert.equal( - server.ctx.url, - '/wd/hub/session/sessionId/window/current/size' - ); - assert.equal(server.ctx.method, 'POST'); - assert.deepEqual(server.ctx.request.body, { - width: 800, - height: 600, - }); - assert.deepEqual(server.ctx.response.body, { - sessionId: 'sessionId', - status: 0, - value: '', - }); - }); - }); - /** * https://macacajs.github.io/macaca-wd/#openReporter */ diff --git a/test/window.test.js b/test/window.test.js index bffbdf6..71069af 100644 --- a/test/window.test.js +++ b/test/window.test.js @@ -29,9 +29,10 @@ describe('test/window.test.js', function() { server.stop(); }); + /** - * https://macacajs.github.io/macaca-wd/#close - */ + * https://macacajs.github.io/macaca-wd/#close + */ describe('close', async () => { it('should work', async () => { await driver.close(); @@ -47,8 +48,8 @@ describe('test/window.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#close - */ + * https://macacajs.github.io/macaca-wd/#getWindowSize + */ describe('getWindowSize', async () => { it('should work', async () => { await driver.getWindowSize(); @@ -64,8 +65,8 @@ describe('test/window.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#setWindowSize - */ + * https://macacajs.github.io/macaca-wd/#setWindowSize + */ describe('setWindowSize', async () => { it('should work', async () => { await driver.setWindowSize(800, 600); @@ -84,8 +85,8 @@ describe('test/window.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#window - */ + * https://macacajs.github.io/macaca-wd/#window + */ describe('window', async () => { it('should work', async () => { await driver.window(); @@ -101,8 +102,8 @@ describe('test/window.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#windowHandle - */ + * https://macacajs.github.io/macaca-wd/#windowHandle + */ describe('windowHandle', async () => { it('should work', async () => { await driver.windowHandle(); @@ -118,8 +119,8 @@ describe('test/window.test.js', function() { }); /** - * https://macacajs.github.io/macaca-wd/#windowHandles - */ + * https://macacajs.github.io/macaca-wd/#windowHandles + */ describe('windowHandles', async () => { it('should work', async () => { await driver.windowHandles(); @@ -133,5 +134,28 @@ describe('test/window.test.js', function() { }); }); }); + + + /** + * https://macacajs.github.io/macaca-wd/#initWindow + */ + describe('initWindow', async () => { + it('should work', async () => { + await driver.initWindow({ + width: 800, + height: 600, + }); + assert.equal( + server.ctx.url, + '/wd/hub/session' + ); + assert.equal(server.ctx.method, 'POST'); + assert.deepEqual(server.ctx.response.body, { + sessionId: 'sessionId', + status: 0, + value: '', + }); + }); + }); });