Support pre-W3C element screenshot endpoint
MODIFY
lib/mjsonwp/routes.js
lib/mjsonwp/routes.js
@@ -507,6 +507,10 @@ const METHOD_MAP = {
'/wd/hub/session/:sessionId/execute/async': {
POST: {command: 'executeAsync', payloadParams: {required: ['script', 'args']}}
},
+ // Pre-W3C endpoint for element screenshot
+ '/wd/hub/session/:sessionId/screenshot/:elementId': {
+ GET: {command: 'getElementScreenshot'}
+ },
'/wd/hub/session/:sessionId/element/:elementId/screenshot': {
GET: {command: 'getElementScreenshot'}
},

MODIFY
test/mjsonwp/routes-specs.js
test/mjsonwp/routes-specs.js
@@ -40,7 +40,7 @@ describe('MJSONWP', () => {
}
let hash = shasum.digest('hex').substring(0, 8);
// Modify the hash whenever the protocol has intentionally been modified.
- hash.should.equal('346c41c1');
+ hash.should.equal('a991dc46');
});
});

Support pre-W3C element screenshot endpoint (#154)