Skip to content

Commit 555a86e

Browse files
committed
fix(ie): Use 32-bit version by default for IEDriver
closes angular#180
1 parent 0dae035 commit 555a86e

File tree

7 files changed

+23
-12
lines changed

7 files changed

+23
-12
lines changed

lib/cmds/initialize.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ export function android(
245245
'android-sdk: Downloading more additional SDK updates ' +
246246
'(this may take a while)');
247247
return downloadAndroidUpdates(
248-
sdkPath, ['build-tools-24.0.0'].concat(
249-
getAndroidSDKTargets(apiLevels, architectures, platforms, oldAVDs)),
248+
sdkPath,
249+
['build-tools-24.0.0'].concat(
250+
getAndroidSDKTargets(apiLevels, architectures, platforms, oldAVDs)),
250251
true, acceptLicenses, verbose);
251252
})
252253
.then(() => {

lib/cmds/opts.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const STANDALONE = 'standalone';
1313
export const CHROME = 'chrome';
1414
export const IE = 'ie';
1515
export const IE32 = 'ie32';
16+
export const IE64 = 'ie64';
1617
export const EDGE = 'edge';
1718
export const GECKO = 'gecko';
1819
export const ANDROID = 'android';
@@ -58,8 +59,11 @@ opts[STANDALONE] = new Option(
5859
opts[CHROME] =
5960
new Option(CHROME, 'Install or update chromedriver', 'boolean', ChromeDriver.isDefault);
6061
opts[GECKO] = new Option(GECKO, 'Install or update geckodriver', 'boolean', GeckoDriver.isDefault);
61-
opts[IE] = new Option(IE, 'Install or update ie driver', 'boolean', IEDriver.isDefault);
62+
opts[IE] = new Option(
63+
IE, 'Install or update ie driver (defaults downloading 32-bit version)', 'boolean',
64+
IEDriver.isDefault);
6265
opts[IE32] = new Option(IE32, 'Install or update 32-bit ie driver', 'boolean', IEDriver.isDefault);
66+
opts[IE64] = new Option(IE64, 'Install or update x64 iedriver', 'boolean', IEDriver.isDefault);
6367
opts[EDGE] = new Option(
6468
EDGE, 'Use installed Microsoft Edge driver', 'string',
6569
'C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe');
@@ -105,7 +109,8 @@ opts[STARTED_SIGNIFIER] = new Option(
105109
'A string to be outputted once the selenium server is up and running. Useful if you are writing a script which uses webdriver-manager.',
106110
'string');
107111
opts[SIGNAL_VIA_IPC] = new Option(
108-
SIGNAL_VIA_IPC, 'If you are using --' + STARTED_SIGNIFIER +
112+
SIGNAL_VIA_IPC,
113+
'If you are using --' + STARTED_SIGNIFIER +
109114
', this flag will emit the signal string using process.send(), rather than writing it to stdout',
110115
'boolean', false);
111116
opts[DETACH] = new Option(

lib/cmds/start.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ if (Config.osType() === 'Windows_NT') {
4646
prog.addOption(Opts[Opt.VERSIONS_IE])
4747
.addOption(Opts[Opt.IE32])
4848
.addOption(Opts[Opt.IE])
49+
.addOption(Opts[Opt.IE64])
4950
.addOption(Opts[Opt.EDGE]);
5051
}
5152

@@ -153,7 +154,7 @@ function start(options: Options) {
153154
path.resolve(outputDir, binaries[GeckoDriver.id].executableFilename(osType)));
154155
}
155156
if (downloadedBinaries[IEDriver.id] != null) {
156-
if (options[Opt.IE32].getBoolean()) {
157+
if (options[Opt.IE32].getBoolean() || options[Opt.IE].getBoolean()) {
157158
binaries[IEDriver.id].arch = 'Win32';
158159
}
159160
args.push(

lib/cmds/status.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function status(options: Options) {
5959
updateConfig = {};
6060
}
6161

62-
6362
let downloadedBinaries = FileManager.downloadedBinaries(outputDir);
63+
6464
// Log which binaries have been downloaded.
6565
for (let bin in downloadedBinaries) {
6666
let downloaded = downloadedBinaries[bin];

lib/cmds/update.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (Config.osType() === 'Darwin') {
3939
}
4040

4141
if (Config.osType() === 'Windows_NT') {
42-
prog.addOption(Opts[Opt.IE]).addOption(Opts[Opt.IE32]);
42+
prog.addOption(Opts[Opt.IE]).addOption(Opts[Opt.IE32]).addOption(Opts[Opt.IE64]);
4343
}
4444

4545
prog.addOption(Opts[Opt.VERSIONS_STANDALONE])
@@ -74,12 +74,16 @@ function update(options: Options): Promise<void> {
7474
let gecko = options[Opt.GECKO].getBoolean();
7575
let ie: boolean = false;
7676
let ie32: boolean = false;
77+
let ie64: boolean = false;
7778
if (options[Opt.IE]) {
7879
ie = options[Opt.IE].getBoolean();
7980
}
8081
if (options[Opt.IE32]) {
8182
ie32 = options[Opt.IE32].getBoolean();
8283
}
84+
if (options[Opt.IE64]) {
85+
ie64 = options[Opt.IE64].getBoolean();
86+
}
8387
let android: boolean = options[Opt.ANDROID].getBoolean();
8488
let ios: boolean = false;
8589
if (options[Opt.IOS]) {
@@ -150,13 +154,13 @@ function update(options: Options): Promise<void> {
150154
updateBrowserFile(binary, outputDir);
151155
promises.push(updateBinary(binary, outputDir, proxy, ignoreSSL));
152156
}
153-
if (ie) {
157+
if (ie64) {
154158
let binary = binaries[IEDriver.id];
155159
binary.arch = Config.osArch(); // Win32 or x64
156160
updateBrowserFile(binary, outputDir);
157161
promises.push(updateBinary(binary, outputDir, proxy, ignoreSSL));
158162
}
159-
if (ie32) {
163+
if (ie || ie32) {
160164
let binary = binaries[IEDriver.id];
161165
binary.arch = 'Win32';
162166
updateBrowserFile(binary, outputDir);

lib/files/file_manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ export class FileManager {
122122
}
123123
// if the suffix does not match the executable,
124124
// the binary is something like: .exe and .zip
125-
else if (existFile.indexOf(binary.suffix(osType, arch)) === -1) {
125+
else if (
126+
!existFile.endsWith('.zip') && !existFile.endsWith('.tar.gz') &&
127+
existFile.indexOf(binary.suffix(osType, arch)) === -1) {
126128
editExistFile = editExistFile.replace(binary.executableSuffix(osType), '');
127129
editExistFile = editExistFile.indexOf('_') === 0 ?
128130
editExistFile.substring(1, editExistFile.length) :

spec/cmds/status_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ describe('status', () => {
1818
// geckodriver {{config version}} [last] [default]
1919
// standalone 2.24 [last], {{config version}} [default]
2020
beforeAll((done) => {
21-
Config.osType_ = 'Linux';
22-
Config.osArch_ = 'x64';
2321
argv = {
2422
'_': ['update'],
2523
'versions': {'chrome': '2.24', 'standalone': '2.44.0'},

0 commit comments

Comments
 (0)