Skip to content

Commit

Permalink
[javascript] Tracking SM language binding in JavaScript
Browse files Browse the repository at this point in the history
Helps with SeleniumHQ#13288
  • Loading branch information
diemol committed Dec 13, 2023
1 parent 793a5e4 commit 1ecfb88
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions javascript/node/selenium-webdriver/common/seleniumManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let debugMessagePrinted = false
* Determines the path of the correct Selenium Manager binary
* @returns {string}
*/
function getBinary() {
function getBinary () {
const directory = {
darwin: 'macos',
win32: 'windows',
Expand All @@ -48,7 +48,8 @@ function getBinary() {

let seleniumManagerBasePath = path.join(__dirname, '..', '/bin')

const filePath = process.env.SE_MANAGER_PATH || path.join(seleniumManagerBasePath, directory, file)
const filePath = process.env.SE_MANAGER_PATH || path.join(
seleniumManagerBasePath, directory, file)

if (!fs.existsSync(filePath)) {
throw new Error(`Unable to obtain Selenium Manager at ${filePath}`)
Expand All @@ -69,8 +70,9 @@ function getBinary() {
* browser location
*/

function driverLocation(options) {
let args = ['--browser', options.getBrowserName(), '--output', 'json']
function driverLocation (options) {
let args = ['--browser', options.getBrowserName(), '--language-binding',
'javascript', '--output', 'json']

if (options.getBrowserVersion() && options.getBrowserVersion() !== '') {
args.push('--browser-version', options.getBrowserVersion())
Expand Down Expand Up @@ -139,7 +141,7 @@ function driverLocation(options) {
}
}

function logOutput(output) {
function logOutput (output) {
for (const key in output.logs) {
if (output.logs[key].level === 'WARN') {
log_.warning(`${output.logs[key].message}`)
Expand Down

0 comments on commit 1ecfb88

Please sign in to comment.