1 | "use strict";
|
2 |
|
3 | var _child_process = require("child_process");
|
4 |
|
5 | var _path = _interopRequireDefault(require("path"));
|
6 |
|
7 | var _shelljs = require("shelljs");
|
8 |
|
9 | var _terminate = _interopRequireDefault(require("terminate"));
|
10 |
|
11 | var _util = require("util");
|
12 |
|
13 | var _candyToolExecutable = require("./candyToolExecutable");
|
14 |
|
15 | var _consoleApplication = require("./Commons/consoleApplication");
|
16 |
|
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18 |
|
19 | _shelljs.config.fatal = true;
|
20 | const terminateAsync = (0, _util.promisify)(_terminate.default);
|
21 | const uiTestForms = ["104812", "104813", "104814", "104815", "104816", "110202", "110303", "1700202",
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | "400506", "400605",
|
27 |
|
28 | "401605", "403403", "407403", "407502", "431001", "431201",
|
29 |
|
30 | "600203",
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | "7000901", "7001001", "7100101", "7100201", "7100301"];
|
38 | (0, _consoleApplication.runConsoleApplication)(async () => {
|
39 | const pathToCandyFarmDir = _path.default.resolve("../candy.farm");
|
40 |
|
41 | console.log(pathToCandyFarmDir);
|
42 | const candyTool = (0, _candyToolExecutable.getPathCandyToolExecutable)();
|
43 | (0, _shelljs.pushd)(pathToCandyFarmDir);
|
44 | (0, _shelljs.exec)(`${candyTool} dev-build --no-reformat ${uiTestForms.join(" ")}`);
|
45 | const child = (0, _child_process.spawn)(_path.default.join(candyTool), ["test-server", "--proxy-to", "https://api.testkontur.ru/candy"], {
|
46 | cwd: pathToCandyFarmDir,
|
47 | shell: true
|
48 | });
|
49 |
|
50 | try {
|
51 | (0, _shelljs.exec)(`${candyTool} run-ui-tests *:with-ui-tests --reporter teamcity --headless`);
|
52 | } finally {
|
53 | await terminateAsync(child.pid);
|
54 | }
|
55 |
|
56 | (0, _shelljs.popd)();
|
57 | });
|
58 |
|
\ | No newline at end of file |