Skip to content

Commit

Permalink
fix: next page (#115)
Browse files Browse the repository at this point in the history
* fix: next page
  • Loading branch information
yihuineng authored Oct 9, 2023
1 parent 3dafde5 commit 51deab6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/next/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]);
});
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macaca-wd",
"version": "4.2.1",
"version": "4.2.2",
"description": "Macaca webdirver API for Node.js",
"keywords": [
"macaca",
Expand Down
6 changes: 3 additions & 3 deletions test/utility.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 51deab6

Please sign in to comment.