зеркало из https://github.com/xamarin/appium.old.git
Add version string to driver announcement
This commit is contained in:
Родитель
ca3233c097
Коммит
cea2448c55
|
@ -96,6 +96,25 @@ class AppiumDriver extends BaseDriver {
|
||||||
throw new Error(`${msg} Please check your desired capabilities.`);
|
throw new Error(`${msg} Please check your desired capabilities.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDriverVersion (driver) {
|
||||||
|
const NAME_DRIVER_MAP = {
|
||||||
|
SelendroidDriver: 'appium-selendroid-driver',
|
||||||
|
AndroidUiautomator2Driver: 'appium-uiautomator2-driver',
|
||||||
|
XCUITestDriver: 'appium-xcuitest-driver',
|
||||||
|
YouiEngineDriver: 'appium-youiengine-driver',
|
||||||
|
FakeDriver: 'appium-fake-driver',
|
||||||
|
AndroidDriver: 'appium-android-driver',
|
||||||
|
IosDriver: 'appium-ios-driver',
|
||||||
|
WindowsDriver: 'appium-windows-driver',
|
||||||
|
};
|
||||||
|
if (!NAME_DRIVER_MAP[driver.name]) {
|
||||||
|
log.warn(`Unable to get version of driver '${driver.name}'`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let {version} = require(`${NAME_DRIVER_MAP[driver.name]}/package.json`);
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
async getStatus () {
|
async getStatus () {
|
||||||
let config = await getAppiumConfig();
|
let config = await getAppiumConfig();
|
||||||
let gitSha = config['git-sha'];
|
let gitSha = config['git-sha'];
|
||||||
|
@ -114,16 +133,23 @@ class AppiumDriver extends BaseDriver {
|
||||||
return sessions;
|
return sessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createSession (caps, reqCaps) {
|
printNewSessionAnnouncement (driver, caps) {
|
||||||
caps = _.defaults(_.clone(caps), this.args.defaultCapabilities);
|
let driverVersion = this.getDriverVersion(driver);
|
||||||
let InnerDriver = this.getDriverForCaps(caps);
|
let introString = driverVersion ?
|
||||||
let curSessions;
|
`Creating new ${driver.name} (v${driverVersion}) session` :
|
||||||
log.info(`Creating new ${InnerDriver.name} session`);
|
`Creating new ${driver.name} session`;
|
||||||
|
log.info(introString);
|
||||||
log.info('Capabilities:');
|
log.info('Capabilities:');
|
||||||
util.inspect(caps);
|
util.inspect(caps);
|
||||||
for (let [cap, value] of _.toPairs(caps)) {
|
for (let [cap, value] of _.toPairs(caps)) {
|
||||||
log.info(` ${cap}: ${util.inspect(value)}`);
|
log.info(` ${cap}: ${util.inspect(value)}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async createSession (caps, reqCaps) {
|
||||||
|
caps = _.defaults(_.clone(caps), this.args.defaultCapabilities);
|
||||||
|
let InnerDriver = this.getDriverForCaps(caps);
|
||||||
|
this.printNewSessionAnnouncement(InnerDriver, caps);
|
||||||
|
|
||||||
// sessionOverride server flag check
|
// sessionOverride server flag check
|
||||||
// this will need to be re-thought when we go to multiple session support
|
// this will need to be re-thought when we go to multiple session support
|
||||||
|
@ -140,6 +166,7 @@ class AppiumDriver extends BaseDriver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let curSessions;
|
||||||
try {
|
try {
|
||||||
curSessions = this.curSessionDataForDriver(InnerDriver);
|
curSessions = this.curSessionDataForDriver(InnerDriver);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче