mirror of
https://github.com/appium/appium.git
synced 2026-01-28 05:09:10 -06:00
Fix handling of grid node id
This commit is contained in:
@@ -51,10 +51,14 @@ async function postRequest (data, addr, port) {
|
||||
jsonObject.configuration.url = `http://${addr}:${port}/wd/hub`;
|
||||
jsonObject.configuration.host = addr;
|
||||
jsonObject.configuration.port = port;
|
||||
|
||||
// re-serialize the configuration with the auto populated data
|
||||
data = JSON.stringify(jsonObject);
|
||||
}
|
||||
// if the node config does not have id automatically add it
|
||||
if (!jsonObject.configuration.id) {
|
||||
jsonObject.configuration.id = `http://${jsonObject.configuration.host}:${jsonObject.configuration.port}`;
|
||||
}
|
||||
|
||||
// re-serialize the configuration with the auto populated data
|
||||
data = JSON.stringify(jsonObject);
|
||||
|
||||
// prepare the header
|
||||
let post_headers = {
|
||||
@@ -97,7 +101,7 @@ async function postRequest (data, addr, port) {
|
||||
|
||||
async function isAlreadyRegistered (jsonObject) {
|
||||
//check if node is already registered
|
||||
let id = `http://${jsonObject.configuration.host}:${jsonObject.configuration.port}`;
|
||||
let id = jsonObject.configuration.id;
|
||||
try {
|
||||
let response = await request({
|
||||
uri: `http://${jsonObject.configuration.hubHost}:${jsonObject.configuration.hubPort}/grid/api/proxy?id=${id}`,
|
||||
|
||||
Reference in New Issue
Block a user