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
90 lines (81 loc) · 2.62 KB
/
chrome_xml_spec.ts
File metadata and controls
90 lines (81 loc) · 2.62 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
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');
}
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();
});
});
it('should get 76.0.3809.68 version', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Windows_NT';
chromeXml.osarch = 'x64';
chromeXml.getUrl('76.0.3809.68').then((binaryUrl) => {
expect(binaryUrl.url).toContain('76.0.3809.68/chromedriver_win32.zip');
done();
});
});
it('should get 76.0.3809.12 version', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Windows_NT';
chromeXml.osarch = 'x64';
chromeXml.getUrl('76.0.3809.12').then((binaryUrl) => {
expect(binaryUrl.url).toContain('76.0.3809.12/chromedriver_win32.zip');
done();
});
});
});