Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuineng committed Oct 12, 2023
1 parent ac60023 commit a87a0e3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 38 deletions.
26 changes: 0 additions & 26 deletions test/utility.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
48 changes: 36 additions & 12 deletions test/window.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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: '',
});
});
});
});

0 comments on commit a87a0e3

Please sign in to comment.