-
Notifications
You must be signed in to change notification settings - Fork 682
Expand file tree
/
Copy pathtest.js
More file actions
41 lines (34 loc) · 1.4 KB
/
test.js
File metadata and controls
41 lines (34 loc) · 1.4 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
const path = require('path');
const { expect } = require('chai');
const createTestCafe = require('../../../../../lib');
const config = require('../../../config');
const needSkip = !config.hasBrowser('firefox');
function getFirefoxBrowserName () {
const firefoxSettings = config.currentEnvironment.browsers.find(browser => browser.alias.includes('firefox'));
return firefoxSettings ? firefoxSettings.browserName : 'firefox';
}
async function runFirefoxProxyModeCryptoTest () {
// NOTE: host is intentionally unset to exercise the hostname calculation path.
const testCafe = await createTestCafe({ port1: 1335, port2: 1336 });
try {
const failedCount = await testCafe
.createRunner()
.src(path.join(__dirname, 'testcafe-fixtures/index.js'))
.browsers(getFirefoxBrowserName())
.run({
disableNativeAutomation: true,
pageLoadTimeout: 45000,
selectorTimeout: 5000,
testExecutionTimeout: 120000,
});
expect(failedCount).eql(0);
}
finally {
await testCafe.close();
}
}
(needSkip ? describe.skip : describe)('[Regression](GH-8391)', function () {
it('Should keep WebCrypto available in Firefox proxy mode when all browsers are local', function () {
return runFirefoxProxyModeCryptoTest();
});
});