Skip to content

Commit b459f5a

Browse files
authored
Update compute-download-urls.js (#590)
* Update compute-download-urls.js Updating generic URL for all downloads * Replacing path <version> with selenium-<version> in tests as now selenium uses selenium-<version> in path for download * Fixing lint issues
1 parent a0d4c97 commit b459f5a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/compute-download-urls.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ async function computeDownloadUrls(opts) {
4444
util.format(
4545
isSelenium4(opts.seleniumVersion) ? urls.seleniumV4 : urls.selenium,
4646
opts.seleniumBaseURL,
47-
isSelenium4(opts.seleniumVersion)
48-
? `selenium-${opts.seleniumVersion}`
49-
: opts.seleniumVersion.replace(/(\d+\.\d+)\.\d+/, '$1'),
47+
`selenium-${opts.seleniumVersion}`,
5048
opts.seleniumVersion
5149
),
5250
};

test/compute-download-urls-test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('compute-download-urls', () => {
3636
drivers: {},
3737
});
3838

39-
assert.strictEqual(actual.selenium, 'https://localhost/1.0/selenium-server-standalone-1.0.jar');
39+
assert.strictEqual(actual.selenium, 'https://localhost/selenium-1.0/selenium-server-standalone-1.0.jar');
4040
});
4141

4242
it('version with patch', async () => {
@@ -46,7 +46,7 @@ describe('compute-download-urls', () => {
4646
drivers: {},
4747
});
4848

49-
assert.strictEqual(actual.selenium, 'https://localhost/1.0/selenium-server-standalone-1.0.1.jar');
49+
assert.strictEqual(actual.selenium, 'https://localhost/selenium-1.0.1/selenium-server-standalone-1.0.1.jar');
5050
});
5151

5252
it('version with beta string', async () => {
@@ -56,7 +56,10 @@ describe('compute-download-urls', () => {
5656
drivers: {},
5757
});
5858

59-
assert.strictEqual(actual.selenium, 'https://localhost/3.0-beta2/selenium-server-standalone-3.0.0-beta2.jar');
59+
assert.strictEqual(
60+
actual.selenium,
61+
'https://localhost/selenium-3.0.0-beta2/selenium-server-standalone-3.0.0-beta2.jar'
62+
);
6063
});
6164

6265
it('fullURL', async () => {

0 commit comments

Comments
 (0)