Skip to content

Commit 5aff901

Browse files
committed
Always check chrome browser for appium.
1 parent 48dca67 commit 5aff901

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/commands/android/index.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,20 @@ export class AndroidSetup {
704704
return result;
705705
}
706706

707-
async verifyAndSetupBrowsers(browsers: SetupConfigs['browsers']): Promise<boolean> {
708-
if (!browsers || browsers === 'none') {
707+
async verifyAndSetupBrowsers(browsersConfig: SetupConfigs['browsers']): Promise<boolean> {
708+
const browsers: ('firefox' | 'chrome')[] = [];
709+
if (browsersConfig === 'both') {
710+
browsers.push('chrome', 'firefox');
711+
} else if (browsersConfig && browsersConfig !== 'none') {
712+
browsers.push(browsersConfig);
713+
}
714+
715+
// add chrome for web-view testing on Android Emulator
716+
if (this.options.appium && !browsers.includes('chrome')) {
717+
browsers.push('chrome');
718+
}
719+
720+
if (!browsers.length) {
709721
return true;
710722
}
711723

@@ -720,8 +732,8 @@ export class AndroidSetup {
720732
setupChrome: false
721733
};
722734

723-
const verifyFirefox = ['firefox', 'both'].includes(browsers);
724-
const verifyChrome = ['chrome', 'both'].includes(browsers);
735+
const verifyFirefox = browsers.includes('firefox');
736+
const verifyChrome = browsers.includes('chrome');
725737

726738
let firefoxLatestVersion = '';
727739
let installedChromeVersion = DEFAULT_CHROME_VERSION;
@@ -871,7 +883,7 @@ export class AndroidSetup {
871883
} else if (installFirefox) {
872884
message = 'Do you wish to install/upgrade the Firefox browser?';
873885
} else if (downloadChromedriver) {
874-
message = 'Do you wish to setup missing requirements for Chrome browser?';
886+
message = `Do you wish to setup the missing requirements for ${this.options.appium ? 'Appium' : 'Chrome browser'}?`;
875887
}
876888

877889
if (message) {

0 commit comments

Comments
 (0)