@applitools/core 4.20.2 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/automation/utils/take-screenshot.js +1 -0
- package/dist/automation/utils/to-base-check-settings.js +1 -1
- package/dist/autonomous/core.js +2 -2
- package/dist/check.js +7 -1
- package/dist/classic/core.js +2 -2
- package/dist/core.js +2 -2
- package/dist/make-manager.js +2 -1
- package/dist/open-eyes.js +79 -23
- package/dist/run-offline-snapshots.js +0 -2
- package/dist/ufg/core.js +2 -2
- package/dist/universal/core.js +4 -0
- package/dist/utils/extract-git-info.js +165 -0
- package/dist/utils/populate-eyes-server-settings.js +6 -0
- package/package.json +10 -10
- package/types/automation/types.d.ts +1 -0
- package/types/autonomous/core.d.ts +1 -2
- package/types/classic/core.d.ts +1 -2
- package/types/open-eyes.d.ts +2 -1
- package/types/ufg/core.d.ts +1 -2
- package/types/utils/extract-git-info.d.ts +59 -0
- package/types/utils/populate-eyes-server-settings.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.21.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.20.2...js/core@4.21.0) (2024-10-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add chrome emulation devices ([#2559](https://github.com/Applitools-Dev/sdk/issues/2559)) ([0499aaf](https://github.com/Applitools-Dev/sdk/commit/0499aaf3bb809d2ac0105b4493e6f6bb8730ea3f))
|
|
9
|
+
* capture status bar ([#2571](https://github.com/Applitools-Dev/sdk/issues/2571)) ([5e1c75e](https://github.com/Applitools-Dev/sdk/commit/5e1c75ef9cf34af80f08806a3bceaf06a94f2780))
|
|
10
|
+
* dynamic regions ([#2538](https://github.com/Applitools-Dev/sdk/issues/2538)) ([d8b5c48](https://github.com/Applitools-Dev/sdk/commit/d8b5c48fb35f9789c702447314dc72b4f415ade1))
|
|
11
|
+
* setting up SCM information automatically ([#2542](https://github.com/Applitools-Dev/sdk/issues/2542)) ([696461a](https://github.com/Applitools-Dev/sdk/commit/696461af3f8e2e3ed94eb78fed5ead6233bd16b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* don't remove offline execution folder after running ([654e195](https://github.com/Applitools-Dev/sdk/commit/654e195dd50dc7dab93dd907ec26d788549c6e81))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
|
|
21
|
+
* @applitools/snippets bumped to 2.5.1
|
|
22
|
+
#### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* isStaleElement error ([#2567](https://github.com/Applitools-Dev/sdk/issues/2567)) ([2675086](https://github.com/Applitools-Dev/sdk/commit/2675086aa28589082249e2958942ee29a5f2ef12))
|
|
25
|
+
* @applitools/screenshoter bumped to 3.9.0
|
|
26
|
+
#### Features
|
|
27
|
+
|
|
28
|
+
* capture status bar ([#2571](https://github.com/Applitools-Dev/sdk/issues/2571)) ([5e1c75e](https://github.com/Applitools-Dev/sdk/commit/5e1c75ef9cf34af80f08806a3bceaf06a94f2780))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
* @applitools/driver bumped to 1.19.3
|
|
33
|
+
|
|
34
|
+
* @applitools/spec-driver-webdriver bumped to 1.1.15
|
|
35
|
+
|
|
36
|
+
* @applitools/spec-driver-selenium bumped to 1.5.86
|
|
37
|
+
|
|
38
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.15
|
|
39
|
+
|
|
40
|
+
* @applitools/nml-client bumped to 1.8.13
|
|
41
|
+
|
|
42
|
+
* @applitools/core-base bumped to 1.18.0
|
|
43
|
+
#### Features
|
|
44
|
+
|
|
45
|
+
* ability to download side by side with highlighted diffs (2419) ([#2530](https://github.com/Applitools-Dev/sdk/issues/2530)) ([e06ce69](https://github.com/Applitools-Dev/sdk/commit/e06ce699f30e9e444ac58dafdf5989ff1c96ca1c))
|
|
46
|
+
* dynamic regions ([#2538](https://github.com/Applitools-Dev/sdk/issues/2538)) ([d8b5c48](https://github.com/Applitools-Dev/sdk/commit/d8b5c48fb35f9789c702447314dc72b4f415ade1))
|
|
47
|
+
* setting up SCM information automatically ([#2542](https://github.com/Applitools-Dev/sdk/issues/2542)) ([696461a](https://github.com/Applitools-Dev/sdk/commit/696461af3f8e2e3ed94eb78fed5ead6233bd16b2))
|
|
48
|
+
* @applitools/ec-client bumped to 1.9.9
|
|
49
|
+
|
|
50
|
+
|
|
3
51
|
## [4.20.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.20.1...js/core@4.20.2) (2024-10-03)
|
|
4
52
|
|
|
5
53
|
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.toBaseCheckSettings = exports.extractMobileElementsIntoCheckSettings = exports.hasCodedRegions = void 0;
|
|
27
27
|
const utils = __importStar(require("@applitools/utils"));
|
|
28
|
-
const regionTypes = ['ignore', 'layout', 'strict', 'content', 'floating', 'accessibility'];
|
|
28
|
+
const regionTypes = ['ignore', 'layout', 'strict', 'content', 'floating', 'accessibility', 'dynamic'];
|
|
29
29
|
function hasCodedRegions(settings) {
|
|
30
30
|
for (const regionType of regionTypes) {
|
|
31
31
|
if (settings[`${regionType}Regions`])
|
package/dist/autonomous/core.js
CHANGED
|
@@ -9,9 +9,9 @@ const start_renders_1 = require("./start-renders");
|
|
|
9
9
|
const get_render_results_1 = require("./get-render-results");
|
|
10
10
|
const create_render_results_1 = require("./create-render-results");
|
|
11
11
|
const open_eyes_1 = require("./open-eyes");
|
|
12
|
-
function makeAutonomousCore({ spec, clients, base: defaultBase, asyncCache, agentId = 'core-autonomous',
|
|
12
|
+
function makeAutonomousCore({ spec, clients, base: defaultBase, asyncCache, agentId = 'core-autonomous', logger: defaultLogger, } = {}) {
|
|
13
13
|
const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core-autonomous' } });
|
|
14
|
-
const core = (0, core_1.makeCore)({ spec, clients, base: defaultBase, asyncCache, agentId,
|
|
14
|
+
const core = (0, core_1.makeCore)({ spec, clients, base: defaultBase, asyncCache, agentId, logger });
|
|
15
15
|
return {
|
|
16
16
|
type: 'autonomous',
|
|
17
17
|
takeSnapshots: spec && (0, take_snapshots_1.makeTakeSnapshots)({ core, spec, logger }),
|
package/dist/check.js
CHANGED
|
@@ -45,7 +45,13 @@ function makeCheck({ type: defaultType = 'classic', eyes, target: defaultTarget,
|
|
|
45
45
|
settings.overlap = { top: 10, bottom: 50, ...settings === null || settings === void 0 ? void 0 : settings.overlap };
|
|
46
46
|
(_e = settings.matchLevel) !== null && _e !== void 0 ? _e : (settings.matchLevel = 'Strict');
|
|
47
47
|
(_f = settings.ignoreCaret) !== null && _f !== void 0 ? _f : (settings.ignoreCaret = true);
|
|
48
|
-
(_g = settings.sendDom) !== null && _g !== void 0 ? _g : (settings.sendDom = eyes.test.account.rcaEnabled ||
|
|
48
|
+
(_g = settings.sendDom) !== null && _g !== void 0 ? _g : (settings.sendDom = eyes.test.account.rcaEnabled ||
|
|
49
|
+
settings.matchLevel === 'Layout' ||
|
|
50
|
+
settings.matchLevel === 'Dynamic' ||
|
|
51
|
+
settings.enablePatterns ||
|
|
52
|
+
settings.useDom ||
|
|
53
|
+
!utils.types.isEmpty(settings.dynamicRegions) ||
|
|
54
|
+
!utils.types.isEmpty(settings.layoutRegions));
|
|
49
55
|
(_h = settings.autProxy) !== null && _h !== void 0 ? _h : (settings.autProxy = eyes.test.eyesServer.proxy);
|
|
50
56
|
(_j = settings.useDom) !== null && _j !== void 0 ? _j : (settings.useDom = false);
|
|
51
57
|
(_k = (_q = settings).retryTimeout) !== null && _k !== void 0 ? _k : (_q.retryTimeout = 0);
|
package/dist/classic/core.js
CHANGED
|
@@ -34,10 +34,10 @@ const extract_text_1 = require("../automation/extract-text");
|
|
|
34
34
|
const get_nml_client_1 = require("../automation/get-nml-client");
|
|
35
35
|
const open_eyes_1 = require("./open-eyes");
|
|
36
36
|
const utils = __importStar(require("@applitools/utils"));
|
|
37
|
-
function makeCore({ spec, clients, base: defaultBase, concurrency, agentId = 'core-classic',
|
|
37
|
+
function makeCore({ spec, clients, base: defaultBase, concurrency, agentId = 'core-classic', logger: defaultLogger, offlineLocationPath, }) {
|
|
38
38
|
const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core-classic' } });
|
|
39
39
|
logger.log(`Core classic is initialized ${defaultBase ? 'with' : 'without'} custom base core`);
|
|
40
|
-
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency,
|
|
40
|
+
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, logger, offlineLocationPath });
|
|
41
41
|
return utils.general.extend(base, core => {
|
|
42
42
|
return {
|
|
43
43
|
type: 'classic',
|
package/dist/core.js
CHANGED
|
@@ -53,7 +53,7 @@ function makeCore({ spec, clients, base: defaultBase, concurrency = utils.genera
|
|
|
53
53
|
logger.log(`[pid=${process.pid} Core is initialized ${defaultBase ? 'with' : 'without'} custom base core ${offlineLocationPath ? `and offline location ${offlineLocationPath} ` : ''}and environment `, environment);
|
|
54
54
|
if (environment.sdk)
|
|
55
55
|
(0, validate_sdk_version_1.validateSdkVersion)(environment.sdk, { logger });
|
|
56
|
-
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency,
|
|
56
|
+
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, logger, offlineLocationPath });
|
|
57
57
|
const cores = {
|
|
58
58
|
ufg: (0, core_2.makeCore)({ spec, clients, base, asyncCache, logger, offlineLocationPath }),
|
|
59
59
|
classic: (0, core_1.makeCore)({ spec, clients, base, logger, offlineLocationPath }),
|
|
@@ -83,7 +83,7 @@ function makeCore({ spec, clients, base: defaultBase, concurrency = utils.genera
|
|
|
83
83
|
locate: (0, locate_1.makeLocate)({ spec, core, logger }),
|
|
84
84
|
locateText: (0, locate_text_1.makeLocateText)({ spec, core, logger }),
|
|
85
85
|
extractText: (0, extract_text_1.makeExtractText)({ spec, core, logger }),
|
|
86
|
-
openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, clients, core, cores, environment, asyncCache, logger }),
|
|
86
|
+
openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, clients, core, cores, environment, asyncCache, cwd, logger }),
|
|
87
87
|
closeBatch: (0, close_batch_1.makeCloseBatch)({ core, logger }),
|
|
88
88
|
deleteTest: (0, delete_test_1.makeDeleteTest)({ core, logger }),
|
|
89
89
|
};
|
package/dist/make-manager.js
CHANGED
|
@@ -42,7 +42,7 @@ function makeMakeManager({ spec, clients, core, base: defaultBase, agentId: defa
|
|
|
42
42
|
(_f = (_j = settings.batch).buildId) !== null && _f !== void 0 ? _f : (_j.buildId = utils.general.getEnvValue('BATCH_BUILD_ID'));
|
|
43
43
|
(_g = settings.agentId) !== null && _g !== void 0 ? _g : (settings.agentId = type === 'ufg' ? defaultAgentId === null || defaultAgentId === void 0 ? void 0 : defaultAgentId.replace(/(\/\d)/, '.visualgrid$1') : defaultAgentId);
|
|
44
44
|
logger.log('Command "makeManager" is called with settings', settings);
|
|
45
|
-
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency,
|
|
45
|
+
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, logger, offlineLocationPath });
|
|
46
46
|
const fetchConcurrency = settings.fetchConcurrency;
|
|
47
47
|
const cores = {
|
|
48
48
|
ufg: (0, core_2.makeCore)({ spec, clients, base, fetchConcurrency, asyncCache, logger, offlineLocationPath }),
|
|
@@ -64,6 +64,7 @@ function makeMakeManager({ spec, clients, core, base: defaultBase, agentId: defa
|
|
|
64
64
|
cores,
|
|
65
65
|
environment,
|
|
66
66
|
asyncCache,
|
|
67
|
+
cwd,
|
|
67
68
|
logger,
|
|
68
69
|
}), async (openEyes, options) => {
|
|
69
70
|
const eyes = await openEyes(options);
|
package/dist/open-eyes.js
CHANGED
|
@@ -36,30 +36,58 @@ const get_eyes_results_1 = require("./get-eyes-results");
|
|
|
36
36
|
const populate_eyes_server_settings_1 = require("./utils/populate-eyes-server-settings");
|
|
37
37
|
const utils = __importStar(require("@applitools/utils"));
|
|
38
38
|
const core_base_1 = require("@applitools/core-base");
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
39
|
+
const extract_git_info_1 = require("./utils/extract-git-info");
|
|
40
|
+
function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDuplicateTests, core, cores, spec, environment, logger: mainLogger, asyncCache, cwd = process.cwd(), }) {
|
|
41
|
+
return async function openEyes({ type = defaultType, settings: openSettings, config, target, logger = mainLogger, }) {
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
43
|
+
var _y, _z, _0, _1, _2, _3;
|
|
43
44
|
logger = logger.extend(mainLogger, { tags: [`eyes-${type}-${utils.general.shortid()}`] });
|
|
44
|
-
settings = { ...config === null || config === void 0 ? void 0 : config.open, ...
|
|
45
|
-
(0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
|
|
45
|
+
const settings = { ...config === null || config === void 0 ? void 0 : config.open, ...openSettings };
|
|
46
|
+
const eyesServerSettings = (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
|
|
46
47
|
(_a = settings.userTestId) !== null && _a !== void 0 ? _a : (settings.userTestId = `${settings.testName}--${utils.general.guid()}`);
|
|
47
48
|
settings.batch = { ...batch, ...settings.batch };
|
|
48
|
-
(_b = (
|
|
49
|
-
(
|
|
50
|
-
(
|
|
51
|
-
(
|
|
52
|
-
(
|
|
53
|
-
(
|
|
54
|
-
(
|
|
55
|
-
(
|
|
56
|
-
(
|
|
57
|
-
(
|
|
58
|
-
(
|
|
59
|
-
(
|
|
60
|
-
(
|
|
61
|
-
(
|
|
62
|
-
(
|
|
49
|
+
(_b = (_y = settings.batch).id) !== null && _b !== void 0 ? _b : (_y.id = utils.general.getEnvValue('BATCH_ID'));
|
|
50
|
+
(_c = (_z = settings.batch).buildId) !== null && _c !== void 0 ? _c : (_z.buildId = utils.general.getEnvValue('BATCH_BUILD_ID'));
|
|
51
|
+
(_d = (_0 = settings.batch).name) !== null && _d !== void 0 ? _d : (_0.name = utils.general.getEnvValue('BATCH_NAME'));
|
|
52
|
+
(_e = (_1 = settings.batch).sequenceName) !== null && _e !== void 0 ? _e : (_1.sequenceName = utils.general.getEnvValue('BATCH_SEQUENCE'));
|
|
53
|
+
(_f = (_2 = settings.batch).notifyOnCompletion) !== null && _f !== void 0 ? _f : (_2.notifyOnCompletion = utils.general.getEnvValue('BATCH_NOTIFY', 'boolean'));
|
|
54
|
+
(_g = settings.keepBatchOpen) !== null && _g !== void 0 ? _g : (settings.keepBatchOpen = utils.general.getEnvValue('DONT_CLOSE_BATCHES', 'boolean'));
|
|
55
|
+
(_h = settings.branchName) !== null && _h !== void 0 ? _h : (settings.branchName = utils.general.getEnvValue('BRANCH'));
|
|
56
|
+
(_j = settings.parentBranchName) !== null && _j !== void 0 ? _j : (settings.parentBranchName = utils.general.getEnvValue('PARENT_BRANCH'));
|
|
57
|
+
(_k = settings.baselineBranchName) !== null && _k !== void 0 ? _k : (settings.baselineBranchName = utils.general.getEnvValue('BASELINE_BRANCH'));
|
|
58
|
+
(_l = settings.gitBranchingTimestamp) !== null && _l !== void 0 ? _l : (settings.gitBranchingTimestamp = utils.general.getEnvValue('GIT_MERGE_BASE_TIMESTAMP'));
|
|
59
|
+
(_m = settings.latestCommitInfo) !== null && _m !== void 0 ? _m : (settings.latestCommitInfo = getLatestCommitInfoFromEnvVars(logger));
|
|
60
|
+
(_o = settings.ufgServerUrl) !== null && _o !== void 0 ? _o : (settings.ufgServerUrl = utils.general.getEnvValue('UFG_SERVER_URL'));
|
|
61
|
+
(_p = settings.ignoreBaseline) !== null && _p !== void 0 ? _p : (settings.ignoreBaseline = false);
|
|
62
|
+
(_q = settings.compareWithParentBranch) !== null && _q !== void 0 ? _q : (settings.compareWithParentBranch = false);
|
|
63
|
+
(_r = settings.removeDuplicateTests) !== null && _r !== void 0 ? _r : (settings.removeDuplicateTests = removeDuplicateTests);
|
|
64
|
+
(_s = settings.latestCommitInfo) !== null && _s !== void 0 ? _s : (settings.latestCommitInfo = await (0, extract_git_info_1.extractLatestCommitInfo)({ execOptions: { cwd }, logger }));
|
|
65
|
+
if (settings.latestCommitInfo && !(0, extract_git_info_1.isISODate)(settings.latestCommitInfo.timestamp)) {
|
|
66
|
+
logger.warn(`latestCommitInfo.timestamp is an invalid ISO date string: ${settings.latestCommitInfo.timestamp}`);
|
|
67
|
+
settings.latestCommitInfo = undefined;
|
|
68
|
+
}
|
|
69
|
+
if (process.env.CI && (((_t = settings.batch) === null || _t === void 0 ? void 0 : _t.id) || settings.latestCommitInfo)) {
|
|
70
|
+
await populateAutoScmInfo(((_u = settings.batch) === null || _u === void 0 ? void 0 : _u.id) || settings.latestCommitInfo.sha);
|
|
71
|
+
}
|
|
72
|
+
(_v = (_3 = settings.batch).id) !== null && _v !== void 0 ? _v : (_3.id = `generated-${utils.general.guid()}`);
|
|
73
|
+
if (settings.ignoreGitBranching) {
|
|
74
|
+
settings.gitBranchingTimestamp = undefined;
|
|
75
|
+
}
|
|
76
|
+
else if (!settings.gitBranchingTimestamp) {
|
|
77
|
+
const { branchName, parentBranchName } = settings;
|
|
78
|
+
if (branchName && parentBranchName && branchName !== parentBranchName) {
|
|
79
|
+
settings.gitBranchingTimestamp = await (0, extract_git_info_1.extractBranchingTimestamp)({
|
|
80
|
+
branchName,
|
|
81
|
+
parentBranchName,
|
|
82
|
+
execOptions: { cwd },
|
|
83
|
+
logger,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (settings.gitBranchingTimestamp && !(0, extract_git_info_1.isISODate)(settings.gitBranchingTimestamp)) {
|
|
88
|
+
logger.warn(`gitBranchingTimestamp is an invalid ISO date string: ${settings.gitBranchingTimestamp}`);
|
|
89
|
+
settings.gitBranchingTimestamp = undefined;
|
|
90
|
+
}
|
|
63
91
|
const driver = target && (await (0, driver_1.makeDriver)({ spec, driver: target, logger, customConfig: settings }));
|
|
64
92
|
const driverEnvironment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
|
|
65
93
|
const driverUrl = await (driver === null || driver === void 0 ? void 0 : driver.getDriverUrl());
|
|
@@ -70,7 +98,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
|
|
|
70
98
|
event: {
|
|
71
99
|
type: 'openEyes',
|
|
72
100
|
userTestId: settings.userTestId,
|
|
73
|
-
concurrency: (
|
|
101
|
+
concurrency: (_w = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _w !== void 0 ? _w : core.concurrency,
|
|
74
102
|
environment,
|
|
75
103
|
driver: {
|
|
76
104
|
deviceName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.deviceName,
|
|
@@ -78,7 +106,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
|
|
|
78
106
|
browserVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.browserVersion,
|
|
79
107
|
platformName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformName,
|
|
80
108
|
platformVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformVersion,
|
|
81
|
-
isApplitoolsLib: (
|
|
109
|
+
isApplitoolsLib: (_x = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _x === void 0 ? void 0 : _x.instrumented,
|
|
82
110
|
isEC: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.isEC,
|
|
83
111
|
},
|
|
84
112
|
driverUrl,
|
|
@@ -113,6 +141,34 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
|
|
|
113
141
|
getResults: (0, get_eyes_results_1.makeGetEyesResults)({ eyes, logger }),
|
|
114
142
|
});
|
|
115
143
|
}); // TODO solve the types issue
|
|
144
|
+
/////// END FUNCTION BODY ///////////////////
|
|
145
|
+
async function populateAutoScmInfo(batchId) {
|
|
146
|
+
var _a, _b, _c, _d, _e;
|
|
147
|
+
var _f, _g;
|
|
148
|
+
const branchName = await (0, extract_git_info_1.extractGitBranch)({ execOptions: { cwd }, logger });
|
|
149
|
+
const { owner: repoOwner, name: repoName } = await (0, extract_git_info_1.extractGitRepo)({ execOptions: { cwd }, logger });
|
|
150
|
+
const buildId = await (0, extract_git_info_1.extractBuildIdFromCI)();
|
|
151
|
+
if (branchName && repoOwner && repoName) {
|
|
152
|
+
const scmInfo = await core.base
|
|
153
|
+
.updateIfScm({
|
|
154
|
+
settings: { ...eyesServerSettings, batchId, branchName, repoOwner, repoName, buildId },
|
|
155
|
+
logger,
|
|
156
|
+
})
|
|
157
|
+
.catch(error => {
|
|
158
|
+
throw refineMissingApiKeyException(error, environment === null || environment === void 0 ? void 0 : environment.sdk);
|
|
159
|
+
});
|
|
160
|
+
if (scmInfo) {
|
|
161
|
+
(_a = settings.batch) !== null && _a !== void 0 ? _a : (settings.batch = {});
|
|
162
|
+
(_b = (_f = settings.batch).id) !== null && _b !== void 0 ? _b : (_f.id = batchId);
|
|
163
|
+
(_c = (_g = settings.batch).buildId) !== null && _c !== void 0 ? _c : (_g.buildId = buildId);
|
|
164
|
+
(_d = settings.branchName) !== null && _d !== void 0 ? _d : (settings.branchName = branchName);
|
|
165
|
+
(_e = settings.parentBranchName) !== null && _e !== void 0 ? _e : (settings.parentBranchName = scmInfo.scmTargetBranch);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
logger.log(`Skipping check for SCM integration due to missing information: branchName=${branchName} repoName=${repoName} repoOwner=${repoOwner}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
116
172
|
};
|
|
117
173
|
}
|
|
118
174
|
exports.makeOpenEyes = makeOpenEyes;
|
|
@@ -84,8 +84,6 @@ async function runOfflineSnapshots(options) {
|
|
|
84
84
|
const batchIds = [...new Set(results.map(t => t.batchId))];
|
|
85
85
|
const allTestResults = results.map(t => t.results);
|
|
86
86
|
executionLogger.log('done running all tests', allTestResults);
|
|
87
|
-
// @ts-expect-error // we use node v12 types, therefore it's not aware of the existence of `fs.promises.rm`
|
|
88
|
-
await fs_1.default.promises.rm(executionPath, { recursive: true });
|
|
89
87
|
await core.closeBatch({ settings: batchIds.map(batchId => ({ batchId, ...account.eyesServer })) });
|
|
90
88
|
executionLogger.log('done execution', executionName);
|
|
91
89
|
return allTestResults;
|
package/dist/ufg/core.js
CHANGED
|
@@ -36,10 +36,10 @@ const take_snapshots_1 = require("./take-snapshots");
|
|
|
36
36
|
const get_ufg_client_1 = require("./get-ufg-client");
|
|
37
37
|
const open_eyes_1 = require("./open-eyes");
|
|
38
38
|
const utils = __importStar(require("@applitools/utils"));
|
|
39
|
-
function makeCore({ spec, clients, base: defaultBase, asyncCache, concurrency, offlineLocationPath, fetchConcurrency, agentId = 'core-ufg',
|
|
39
|
+
function makeCore({ spec, clients, base: defaultBase, asyncCache, concurrency, offlineLocationPath, fetchConcurrency, agentId = 'core-ufg', logger: defaultLogger, }) {
|
|
40
40
|
const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core-ufg' } });
|
|
41
41
|
logger.log(`Core ufg is initialized ${defaultBase ? 'with' : 'without'} custom base core`);
|
|
42
|
-
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency,
|
|
42
|
+
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, logger, offlineLocationPath });
|
|
43
43
|
const ufgClient = clients === null || clients === void 0 ? void 0 : clients.ufg;
|
|
44
44
|
return utils.general.extend(base, core => {
|
|
45
45
|
return {
|
package/dist/universal/core.js
CHANGED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.isISODate = exports.extractBranchingTimestamp = exports.extractBuildIdFromCI = exports.extractGitRepo = exports.extractGitBranch = exports.extractLatestCommitInfo = exports.cacheKey = void 0;
|
|
30
|
+
const utils = __importStar(require("@applitools/utils"));
|
|
31
|
+
const fs_1 = __importDefault(require("fs"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const logger_1 = require("@applitools/logger");
|
|
34
|
+
exports.cacheKey = 'default';
|
|
35
|
+
exports.extractLatestCommitInfo = utils.general.cachify(async function ({ execOptions, logger = (0, logger_1.makeLogger)(), }) {
|
|
36
|
+
let result;
|
|
37
|
+
try {
|
|
38
|
+
const githubPullRequestLastCommitSha = await extractGithubPullRequestLastCommitSha();
|
|
39
|
+
result = await executeWithLog(`git log ${githubPullRequestLastCommitSha !== null && githubPullRequestLastCommitSha !== void 0 ? githubPullRequestLastCommitSha : ''} -1 --format="%aI %H"`, {
|
|
40
|
+
execOptions,
|
|
41
|
+
logger,
|
|
42
|
+
});
|
|
43
|
+
if (result.stderr) {
|
|
44
|
+
logger.log(`Error during extracting commit information from git`, result.stderr);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const [timestamp, sha] = result.stdout.trim().split(' ');
|
|
48
|
+
if (isISODate(timestamp)) {
|
|
49
|
+
return { sha, timestamp };
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
logger.log(`latestCommitInfo.timestamp is an invalid ISO date string: ${timestamp}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
logger.log(`Error during parsing commit hash from git`, err, result === null || result === void 0 ? void 0 : result.stdout);
|
|
58
|
+
}
|
|
59
|
+
async function extractGithubPullRequestLastCommitSha() {
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
if (((_a = process.env.GITHUB_EVENT_NAME) === null || _a === void 0 ? void 0 : _a.startsWith('pull_request')) && process.env.GITHUB_EVENT_PATH) {
|
|
62
|
+
await executeWithLog(`git fetch origin --depth=2`, { execOptions, logger });
|
|
63
|
+
const event = await fs_1.default.promises.readFile(process.env.GITHUB_EVENT_PATH, 'utf-8').then(JSON.parse);
|
|
64
|
+
return (_c = (_b = event === null || event === void 0 ? void 0 : event.pull_request) === null || _b === void 0 ? void 0 : _b.head) === null || _c === void 0 ? void 0 : _c.sha;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, () => exports.cacheKey);
|
|
68
|
+
exports.extractGitBranch = utils.general.cachify(async function ({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
69
|
+
if (process.env.GITHUB_HEAD_REF) {
|
|
70
|
+
return process.env.GITHUB_HEAD_REF;
|
|
71
|
+
}
|
|
72
|
+
if (process.env.GITHUB_REF) {
|
|
73
|
+
return process.env.GITHUB_REF.split('/')[2]; // refs/heads/<branch_name>
|
|
74
|
+
}
|
|
75
|
+
const result = await executeWithLog('git branch --show-current', { execOptions, logger });
|
|
76
|
+
if (result.stderr) {
|
|
77
|
+
logger.log(`Error during extracting current branch from git`, result.stderr);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const branch = result.stdout.trim();
|
|
81
|
+
logger.log(`Extracted current git branch: "${branch}"`);
|
|
82
|
+
return branch;
|
|
83
|
+
}
|
|
84
|
+
}, () => exports.cacheKey);
|
|
85
|
+
exports.extractGitRepo = utils.general.cachify(async function ({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
86
|
+
const remotes = await extractRemotes();
|
|
87
|
+
logger.log(`Extracted remotes from git: ${remotes}`);
|
|
88
|
+
const remote = remotes.includes('origin') ? 'origin' : remotes[0];
|
|
89
|
+
const result = await executeWithLog(`git remote get-url ${remote}`, { execOptions, logger });
|
|
90
|
+
if (result.stderr) {
|
|
91
|
+
logger.log(`Error during extracting remote url from git`, result.stderr);
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const remoteUrl = result.stdout.trim();
|
|
96
|
+
logger.log(`Extracted url for git remote ${remote}: ${remoteUrl}`);
|
|
97
|
+
return extractRepoFromRemoteUrl(remoteUrl);
|
|
98
|
+
}
|
|
99
|
+
async function extractRemotes() {
|
|
100
|
+
const result = await executeWithLog('git remote show', { execOptions, logger });
|
|
101
|
+
if (result.stderr) {
|
|
102
|
+
logger.log(`Error during extracting remotes from git`, result.stderr);
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return result.stdout.trim().split(/\s+/);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function extractRepoFromRemoteUrl(remoteUrl) {
|
|
110
|
+
try {
|
|
111
|
+
const url = new URL(remoteUrl);
|
|
112
|
+
return { name: path_1.default.basename(url.pathname, '.git'), owner: path_1.default.dirname(url.pathname).replace(/^\//, '') };
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return { name: path_1.default.basename(remoteUrl, '.git'), owner: path_1.default.dirname(remoteUrl).replace(/^[^:]+:/, '') };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, () => exports.cacheKey);
|
|
119
|
+
async function extractBuildIdFromCI() {
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
121
|
+
return ((_k = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = process.env.GITHUB_RUN_ID) !== null && _a !== void 0 ? _a : process.env.CI_JOB_ID) !== null && _b !== void 0 ? _b : process.env.CIRCLE_BUILD_NUM) !== null && _c !== void 0 ? _c : process.env.BUILD_BUILDID) !== null && _d !== void 0 ? _d : process.env.BITBUCKET_BUILD_NUMBER) !== null && _e !== void 0 ? _e : process.env.CODEBUILD_BUILD_ID) !== null && _f !== void 0 ? _f : process.env.BUILD_ID) !== null && _g !== void 0 ? _g : process.env.BUILD_NUMBER) !== null && _h !== void 0 ? _h : process.env.TRAVIS_BUILD_ID) !== null && _j !== void 0 ? _j : process.env.BUILDKITE_BUILD_ID) !== null && _k !== void 0 ? _k : process.env.BAMBOO // TODO: Bamboo
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
exports.extractBuildIdFromCI = extractBuildIdFromCI;
|
|
125
|
+
exports.extractBranchingTimestamp = utils.general.cachify(async function ({ branchName, parentBranchName, execOptions, logger = (0, logger_1.makeLogger)(), }) {
|
|
126
|
+
var _a;
|
|
127
|
+
logger = logger.extend({ tags: [`extract-branching-timestamp-${utils.general.shortid()}`] });
|
|
128
|
+
const command = `HASH=$(git merge-base ${branchName} ${parentBranchName}) && git show -q --format=%aI $HASH`;
|
|
129
|
+
let result = await executeWithLog(command, { execOptions, logger });
|
|
130
|
+
if (result.stderr) {
|
|
131
|
+
const [, missingBranch] = (_a = result.stderr.match(/Not a valid object name ([^\s]+)/)) !== null && _a !== void 0 ? _a : [];
|
|
132
|
+
if (missingBranch) {
|
|
133
|
+
result = await executeWithLog(`git fetch origin ${missingBranch}:${missingBranch} && ${command}`, {
|
|
134
|
+
execOptions,
|
|
135
|
+
logger,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (!result.stdout) {
|
|
140
|
+
result = await executeWithLog(`git fetch origin --unshallow && ${command}`, { execOptions, logger });
|
|
141
|
+
}
|
|
142
|
+
const timestamp = result.stdout.replace(/\s/g, '');
|
|
143
|
+
if (isISODate(timestamp)) {
|
|
144
|
+
logger.log('git branching timestamp successfully extracted', timestamp);
|
|
145
|
+
return timestamp;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
logger.log(`Error during extracting merge timestamp: git branching timestamp is an invalid ISO date string: ${timestamp}. stderr: ${result.stderr}, stdout: ${result.stdout}`);
|
|
149
|
+
}
|
|
150
|
+
}, () => exports.cacheKey);
|
|
151
|
+
async function executeWithLog(command, { execOptions, logger = (0, logger_1.makeLogger)() } = {
|
|
152
|
+
execOptions: {},
|
|
153
|
+
logger: (0, logger_1.makeLogger)(),
|
|
154
|
+
}) {
|
|
155
|
+
logger.log(`executing command: ${command}`);
|
|
156
|
+
const result = await utils.process.execute(command, execOptions);
|
|
157
|
+
if (result.stderr && result.code) {
|
|
158
|
+
logger.log(`exit code: ${result.code}, stderr: ${result.stderr}`);
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function isISODate(str) {
|
|
163
|
+
return /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\+\d{2}:\d{2})?/.test(str);
|
|
164
|
+
}
|
|
165
|
+
exports.isISODate = isISODate;
|
|
@@ -31,5 +31,11 @@ function populateEyesServerSettings(settings) {
|
|
|
31
31
|
(_d = settings.apiKey) !== null && _d !== void 0 ? _d : (settings.apiKey = utils.general.getEnvValue('API_KEY'));
|
|
32
32
|
(_e = settings.proxy) !== null && _e !== void 0 ? _e : (settings.proxy = utils.general.getEnvValue('PROXY_URL') ? { url: utils.general.getEnvValue('PROXY_URL') } : undefined);
|
|
33
33
|
(_f = settings.useDnsCache) !== null && _f !== void 0 ? _f : (settings.useDnsCache = utils.general.getEnvValue('USE_DNS_CACHE', 'boolean'));
|
|
34
|
+
return {
|
|
35
|
+
eyesServerUrl: settings.eyesServerUrl,
|
|
36
|
+
apiKey: settings.apiKey,
|
|
37
|
+
proxy: settings.proxy,
|
|
38
|
+
useDnsCache: settings.useDnsCache,
|
|
39
|
+
};
|
|
34
40
|
}
|
|
35
41
|
exports.populateEyesServerSettings = populateEyesServerSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.21.0",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -74,18 +74,18 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@applitools/core-base": "1.
|
|
77
|
+
"@applitools/core-base": "1.18.0",
|
|
78
78
|
"@applitools/dom-capture": "11.5.0",
|
|
79
79
|
"@applitools/dom-snapshot": "4.11.3",
|
|
80
|
-
"@applitools/driver": "1.19.
|
|
81
|
-
"@applitools/ec-client": "1.9.
|
|
80
|
+
"@applitools/driver": "1.19.3",
|
|
81
|
+
"@applitools/ec-client": "1.9.9",
|
|
82
82
|
"@applitools/logger": "2.0.18",
|
|
83
|
-
"@applitools/nml-client": "1.8.
|
|
83
|
+
"@applitools/nml-client": "1.8.13",
|
|
84
84
|
"@applitools/req": "1.7.2",
|
|
85
|
-
"@applitools/screenshoter": "3.
|
|
86
|
-
"@applitools/snippets": "2.5.
|
|
85
|
+
"@applitools/screenshoter": "3.9.0",
|
|
86
|
+
"@applitools/snippets": "2.5.1",
|
|
87
87
|
"@applitools/socket": "1.1.18",
|
|
88
|
-
"@applitools/spec-driver-webdriver": "1.1.
|
|
88
|
+
"@applitools/spec-driver-webdriver": "1.1.15",
|
|
89
89
|
"@applitools/ufg-client": "1.13.1",
|
|
90
90
|
"@applitools/utils": "1.7.4",
|
|
91
91
|
"@types/ws": "8.5.5",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@applitools/bongo": "^5.10.0",
|
|
102
102
|
"@applitools/sea": "^1.0.0",
|
|
103
|
-
"@applitools/spec-driver-puppeteer": "^1.4.
|
|
104
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
103
|
+
"@applitools/spec-driver-puppeteer": "^1.4.15",
|
|
104
|
+
"@applitools/spec-driver-selenium": "^1.5.86",
|
|
105
105
|
"@applitools/test-server": "^1.2.2",
|
|
106
106
|
"@applitools/test-utils": "^1.5.17",
|
|
107
107
|
"@applitools/tunnel-client": "^1.5.8",
|
|
@@ -148,6 +148,7 @@ export interface ScreenshotSettings<TSpec extends SpecType> extends BaseCore.Ima
|
|
|
148
148
|
waitBetweenStitches?: number;
|
|
149
149
|
lazyLoad?: boolean | LazyLoadOptions;
|
|
150
150
|
sendDom?: boolean;
|
|
151
|
+
captureStatusBar?: boolean;
|
|
151
152
|
}
|
|
152
153
|
export type LocateSettings<TLocator extends string, TSpec extends SpecType> = BaseCore.LocateSettings<TLocator, Region | ElementReference<TSpec>> & ScreenshotSettings<TSpec>;
|
|
153
154
|
export type LocateTextSettings<TPattern extends string, TSpec extends SpecType> = BaseCore.LocateTextSettings<TPattern, Region | ElementReference<TSpec>> & ScreenshotSettings<TSpec>;
|
|
@@ -13,8 +13,7 @@ type Options<TSpec extends SpecType> = {
|
|
|
13
13
|
base?: BaseCore;
|
|
14
14
|
asyncCache?: AsyncCache;
|
|
15
15
|
agentId?: string;
|
|
16
|
-
cwd?: string;
|
|
17
16
|
logger?: Logger;
|
|
18
17
|
};
|
|
19
|
-
export declare function makeAutonomousCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, asyncCache, agentId,
|
|
18
|
+
export declare function makeAutonomousCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, asyncCache, agentId, logger: defaultLogger, }?: Options<TSpec>): AutonomousCore<TSpec>;
|
|
20
19
|
export {};
|
package/types/classic/core.d.ts
CHANGED
|
@@ -11,9 +11,8 @@ type Options<TSpec extends SpecType> = {
|
|
|
11
11
|
base?: BaseCore;
|
|
12
12
|
concurrency?: number;
|
|
13
13
|
agentId?: string;
|
|
14
|
-
cwd?: string;
|
|
15
14
|
logger?: Logger;
|
|
16
15
|
offlineLocationPath?: string;
|
|
17
16
|
};
|
|
18
|
-
export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, concurrency, agentId,
|
|
17
|
+
export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, concurrency, agentId, logger: defaultLogger, offlineLocationPath, }: Options<TSpec>): Core<TSpec>;
|
|
19
18
|
export {};
|
package/types/open-eyes.d.ts
CHANGED
|
@@ -19,8 +19,9 @@ type Options<TSpec extends SpecType, TType extends 'classic' | 'ufg'> = {
|
|
|
19
19
|
environment?: Record<string, any>;
|
|
20
20
|
logger: Logger;
|
|
21
21
|
asyncCache?: AsyncCache;
|
|
22
|
+
cwd?: string;
|
|
22
23
|
};
|
|
23
|
-
export declare function makeOpenEyes<TSpec extends SpecType, TDefaultType extends 'classic' | 'ufg' = 'classic'>({ type: defaultType, clients, batch, removeDuplicateTests, core, cores, spec, environment, logger: mainLogger, asyncCache, }: Options<TSpec, TDefaultType>): <TType extends "classic" | "ufg" = TDefaultType>({ type, settings, config, target, logger, }: {
|
|
24
|
+
export declare function makeOpenEyes<TSpec extends SpecType, TDefaultType extends 'classic' | 'ufg' = 'classic'>({ type: defaultType, clients, batch, removeDuplicateTests, core, cores, spec, environment, logger: mainLogger, asyncCache, cwd, }: Options<TSpec, TDefaultType>): <TType extends "classic" | "ufg" = TDefaultType>({ type, settings: openSettings, config, target, logger, }: {
|
|
24
25
|
type?: TType | undefined;
|
|
25
26
|
settings?: Partial<OpenSettings<TDefaultType> & OpenSettings<TType>> | undefined;
|
|
26
27
|
config?: (Config<TSpec, TDefaultType> & Config<TSpec, TType>) | undefined;
|
package/types/ufg/core.d.ts
CHANGED
|
@@ -15,9 +15,8 @@ type Options<TSpec extends SpecType> = {
|
|
|
15
15
|
concurrency?: number;
|
|
16
16
|
fetchConcurrency?: number;
|
|
17
17
|
agentId?: string;
|
|
18
|
-
cwd?: string;
|
|
19
18
|
logger?: Logger;
|
|
20
19
|
offlineLocationPath?: string;
|
|
21
20
|
};
|
|
22
|
-
export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, asyncCache, concurrency, offlineLocationPath, fetchConcurrency, agentId,
|
|
21
|
+
export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, asyncCache, concurrency, offlineLocationPath, fetchConcurrency, agentId, logger: defaultLogger, }: Options<TSpec>): Core<TSpec>;
|
|
23
22
|
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { ExecOptions } from 'child_process';
|
|
3
|
+
import { type Logger } from '@applitools/logger';
|
|
4
|
+
type Options = {
|
|
5
|
+
execOptions?: ExecOptions;
|
|
6
|
+
logger: Logger;
|
|
7
|
+
};
|
|
8
|
+
type ExtractGitBranchingTimestampOptions = {
|
|
9
|
+
branchName: string;
|
|
10
|
+
execOptions?: ExecOptions;
|
|
11
|
+
logger?: Logger;
|
|
12
|
+
parentBranchName: string;
|
|
13
|
+
};
|
|
14
|
+
type ExtractCurrentCommitTimestampOptions = {
|
|
15
|
+
execOptions?: ExecOptions;
|
|
16
|
+
logger?: Logger;
|
|
17
|
+
};
|
|
18
|
+
export declare const cacheKey = "default";
|
|
19
|
+
export declare const extractLatestCommitInfo: (({ execOptions, logger, }: ExtractCurrentCommitTimestampOptions) => Promise<{
|
|
20
|
+
timestamp: string;
|
|
21
|
+
sha: string;
|
|
22
|
+
} | undefined>) & {
|
|
23
|
+
getCachedValues(): Promise<{
|
|
24
|
+
timestamp: string;
|
|
25
|
+
sha: string;
|
|
26
|
+
} | undefined>[];
|
|
27
|
+
setCachedValue(key: any, value: Promise<{
|
|
28
|
+
timestamp: string;
|
|
29
|
+
sha: string;
|
|
30
|
+
} | undefined>): void;
|
|
31
|
+
clearCache(): void;
|
|
32
|
+
};
|
|
33
|
+
export declare const extractGitBranch: (({ execOptions, logger }: Options) => Promise<string | undefined>) & {
|
|
34
|
+
getCachedValues(): Promise<string | undefined>[];
|
|
35
|
+
setCachedValue(key: any, value: Promise<string | undefined>): void;
|
|
36
|
+
clearCache(): void;
|
|
37
|
+
};
|
|
38
|
+
export declare const extractGitRepo: (({ execOptions, logger }: Options) => Promise<{
|
|
39
|
+
name?: string;
|
|
40
|
+
owner?: string;
|
|
41
|
+
}>) & {
|
|
42
|
+
getCachedValues(): Promise<{
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
owner?: string | undefined;
|
|
45
|
+
}>[];
|
|
46
|
+
setCachedValue(key: any, value: Promise<{
|
|
47
|
+
name?: string | undefined;
|
|
48
|
+
owner?: string | undefined;
|
|
49
|
+
}>): void;
|
|
50
|
+
clearCache(): void;
|
|
51
|
+
};
|
|
52
|
+
export declare function extractBuildIdFromCI(): Promise<string | undefined>;
|
|
53
|
+
export declare const extractBranchingTimestamp: (({ branchName, parentBranchName, execOptions, logger, }: ExtractGitBranchingTimestampOptions) => Promise<string | undefined>) & {
|
|
54
|
+
getCachedValues(): Promise<string | undefined>[];
|
|
55
|
+
setCachedValue(key: any, value: Promise<string | undefined>): void;
|
|
56
|
+
clearCache(): void;
|
|
57
|
+
};
|
|
58
|
+
export declare function isISODate(str: string): boolean;
|
|
59
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { EyesServerSettings } from '../types';
|
|
2
|
-
export declare function populateEyesServerSettings(settings: Partial<EyesServerSettings>):
|
|
2
|
+
export declare function populateEyesServerSettings(settings: Partial<EyesServerSettings>): EyesServerSettings;
|