Files
enviPy-bayer/static/js/ketcher2/node_modules/webdriverio/lib/protocol/gridTestSession.js
2025-06-23 20:13:54 +02:00

45 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
*
* Get the details of the Selenium Grid node running a session
*
* <example>
:grid.js
it('should get current session information', function () {
var details = browser.gridTestSession();
console.log(details);
// {
// msg: 'slot found !',
// success: true,
// session: '51797b64-43e1-4018-b7fb-f900d80a37a4',
// internalKey: '413741ea-d48e-4346-844b-b1a90a69b3ed',
// inactivityTime: 219,
// proxyId: 'MacMiniA10
// }
});
* </example>
*
* @type grid
*/
import { ProtocolError } from '../utils/ErrorHandler'
export default function gridTestSession (sessionId) {
/*!
* parameter check
*/
if (typeof sessionId !== 'string') {
if (!this.requestHandler.sessionID) {
throw new ProtocolError('The gridTestSession command needs a sessionID to work with.')
}
sessionId = this.requestHandler.sessionID
}
return this.requestHandler.create({
path: `/testsession?session=${sessionId}`,
method: 'GET',
requiresSession: false,
gridCommand: true
})
}