This repository was archived by the owner on Apr 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathchrome_xml_spec.ts
More file actions
104 lines (94 loc) · 3.24 KB
/
chrome_xml_spec.ts
File metadata and controls
104 lines (94 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import * as path from 'path';
import * as rimraf from 'rimraf';
import {ChromeXml} from '../../lib/binaries/chrome_xml';
describe('chrome xml reader', () => {
let out_dir = path.resolve('selenium_test');
afterAll(() => {
rimraf.sync(out_dir);
});
it('should get a list', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'x64';
chromeXml.getVersionList().then(list => {
for (let item of list) {
expect(item).toContain('/chromedriver_mac');
expect(item).not.toContain('m1');
}
done();
});
});
it('should get the 2.27, 64-bit version (arch = x64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'x64';
chromeXml.getUrl('2.27').then(binaryUrl => {
expect(binaryUrl.url).toContain('2.27/chromedriver_mac64.zip');
done();
});
});
it('should get the 2.27, 64-bit version (arch = x86)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'x86';
chromeXml.getUrl('2.27').then(binaryUrl => {
expect(binaryUrl.url).toEqual('');
done();
});
});
it('should get the 2.20, 32-bit version (arch = x64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'x64';
chromeXml.getUrl('2.20').then(binaryUrl => {
expect(binaryUrl.url).toContain('2.20/chromedriver_mac32.zip');
done();
});
});
it('should get the 2.20, 32-bit version (arch = x86)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'x86';
chromeXml.getUrl('2.20').then((binaryUrl) => {
expect(binaryUrl.url).toContain('2.20/chromedriver_mac32.zip');
done();
});
});
// This test case covers a bug when all the following conditions were true.
// arch was 64 with multiple major versions available.
it('should not get the 85.0.4183.38, 32-bit version (arch = x64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Windows_NT';
chromeXml.osarch = 'x64';
chromeXml.getUrl('85.0.4183.87').then((binaryUrl) => {
expect(binaryUrl.url).toContain('85.0.4183.87/chromedriver_win32.zip');
done();
});
});
it('should get the 87.0.4280.88, 64-bit, m1 version (arch = arm64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'arm64';
chromeXml.getUrl('87.0.4280.88').then((binaryUrl) => {
expect(binaryUrl.url).toContain('87.0.4280.88/chromedriver_mac64_m1.zip');
done();
});
});
it('should get the 91.0.4472.101, 64-bit, m1 version (arch = arm64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Darwin';
chromeXml.osarch = 'arm64';
chromeXml.getUrl('91.0.4472.101').then((binaryUrl) => {
expect(binaryUrl.url).toContain('91.0.4472.101/chromedriver_mac64_m1.zip');
done();
});
});
});