Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connect info for mobile app testing. #3577

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/transport/selenium-webdriver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,15 @@ class Transport extends BaseTransport {
}

if (this.outputEnabled) {
const {platform, browserVersion, platformVersion, browserName} = sessionInfo;
const {platform, browserVersion, platformVersion, browserName, appId} = sessionInfo;

const appName = appId.split('.').pop() || browserName;
const appVersion = browserVersion && ` (${browserVersion})`;
const platName = platform.toUpperCase();
const platVersion = platformVersion && ` (${platformVersion})`;

// eslint-disable-next-line no-console
console.info(` Using: ${colors.light_blue(browserName)} ${colors.brown('(' + (browserVersion) + ')')} on ${colors.cyan(platform.toUpperCase() + (platformVersion ? (' (' + platformVersion + ')') : ''))}.\n`);
console.info(` Using: ${colors.light_blue(appName)}${colors.brown(appVersion)} on ${colors.cyan(platName + platVersion)}.\n`);
}
}

Expand Down
4 changes: 3 additions & 1 deletion lib/transport/selenium-webdriver/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = class Session {
const platformVersion = sessionCapabilities.get('platformVersion') || '';
const browserName = sessionCapabilities.getBrowserName();
const browserVersion = sessionCapabilities.getBrowserVersion() || sessionCapabilities.get('version') || '';
const appId = sessionCapabilities.get('appPackage') || sessionCapabilities.get('bundleId') || '';

const executor = await this.driver.getExecutor();
const elementKey = executor.w3c ? Session.WEB_ELEMENT_ID : 'ELEMENT';
Expand All @@ -38,7 +39,8 @@ module.exports = class Session {
platform,
platformVersion,
browserName,
browserVersion
browserVersion,
appId
},
capabilities: Session.serializeCapabilities(sessionCapabilities)
};
Expand Down