testit-adapter-codecept 1.1.3 → 1.1.5

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.
Files changed (68) hide show
  1. package/README.md +180 -203
  2. package/build/bootstrap.d.ts +1 -1
  3. package/build/bootstrap.js +37 -34
  4. package/build/common/__tests/box.class.spec.d.ts +1 -1
  5. package/build/common/__tests/box.class.spec.js +15 -15
  6. package/build/common/__tests/test.utils.d.ts +4 -4
  7. package/build/common/__tests/test.utils.js +71 -71
  8. package/build/common/classes/box.class.d.ts +5 -5
  9. package/build/common/classes/box.class.js +18 -18
  10. package/build/common/classes/config.class.d.ts +6 -6
  11. package/build/common/classes/config.class.js +67 -67
  12. package/build/common/classes/logger.class.d.ts +9 -9
  13. package/build/common/classes/logger.class.js +28 -28
  14. package/build/common/classes/outcome.factory.d.ts +7 -7
  15. package/build/common/classes/outcome.factory.js +19 -19
  16. package/build/common/functions/compose.function.d.ts +1 -1
  17. package/build/common/functions/compose.function.js +5 -5
  18. package/build/common/functions/hash.function.d.ts +1 -1
  19. package/build/common/functions/hash.function.js +15 -15
  20. package/build/common/functions/humanize.function.d.ts +1 -1
  21. package/build/common/functions/humanize.function.js +7 -7
  22. package/build/common/functions/is-passed.function.d.ts +2 -2
  23. package/build/common/functions/is-passed.function.js +7 -7
  24. package/build/common/functions/to-iso-string.function.d.ts +1 -1
  25. package/build/common/functions/to-iso-string.function.js +10 -10
  26. package/build/common/functions/use-hash.function.d.ts +9 -9
  27. package/build/common/functions/use-hash.function.js +13 -13
  28. package/build/common/types/nullable.type.d.ts +1 -1
  29. package/build/common/types/nullable.type.js +2 -2
  30. package/build/helper.d.ts +9 -9
  31. package/build/helper.js +37 -37
  32. package/build/http/default-http-client.class.d.ts +22 -22
  33. package/build/http/default-http-client.class.js +123 -123
  34. package/build/http/http-client.errors.d.ts +7 -7
  35. package/build/http/http-client.errors.js +18 -18
  36. package/build/index.d.ts +2 -2
  37. package/build/index.js +18 -18
  38. package/build/jest.config.d.ts +7 -7
  39. package/build/jest.config.js +12 -12
  40. package/build/services/__tests/attachments.class.spec.d.ts +1 -1
  41. package/build/services/__tests/attachments.class.spec.js +23 -23
  42. package/build/services/__tests/runs.builder.spec.d.ts +1 -1
  43. package/build/services/__tests/runs.builder.spec.js +79 -79
  44. package/build/services/__tests/tests.builder.spec.d.ts +1 -1
  45. package/build/services/__tests/tests.builder.spec.js +32 -32
  46. package/build/services/attachments.service.d.ts +11 -11
  47. package/build/services/attachments.service.js +28 -28
  48. package/build/services/runs.builder.d.ts +10 -10
  49. package/build/services/runs.builder.js +65 -65
  50. package/build/services/tests.builder.d.ts +10 -10
  51. package/build/services/tests.builder.js +57 -57
  52. package/build/strategies/base-strategy.class.d.ts +24 -24
  53. package/build/strategies/base-strategy.class.js +66 -66
  54. package/build/strategies/default-strategy.class.d.ts +16 -16
  55. package/build/strategies/default-strategy.class.js +44 -44
  56. package/build/strategies/partial-startegy.class.d.ts +20 -20
  57. package/build/strategies/partial-startegy.class.js +72 -72
  58. package/build/strategies/scratch-strategy.class.d.ts +18 -18
  59. package/build/strategies/scratch-strategy.class.js +49 -49
  60. package/build/strategies/strategy.factory.d.ts +8 -8
  61. package/build/strategies/strategy.factory.js +21 -21
  62. package/build/types/codecept.type.d.ts +28 -27
  63. package/build/types/codecept.type.js +2 -2
  64. package/build/types/origin.type.d.ts +46 -46
  65. package/build/types/origin.type.js +2 -2
  66. package/build/types/strategy.type.d.ts +14 -10
  67. package/build/types/strategy.type.js +2 -2
  68. package/package.json +50 -46
@@ -1,8 +1,8 @@
1
- import { Logger } from '../common/classes/logger.class';
2
- import { DefaultHttpClient } from '../http/default-http-client.class';
3
- import { Strategy } from '../types/strategy.type';
4
- import { Origin } from '../types/origin.type';
5
- export type AdapterMode = 0 | 1 | 2;
6
- export declare class StrategyFactory {
7
- static create(http: DefaultHttpClient, logger: Logger, config: Origin.Config): Strategy;
8
- }
1
+ import { Logger } from '../common/classes/logger.class';
2
+ import { DefaultHttpClient } from '../http/default-http-client.class';
3
+ import { Strategy } from '../types/strategy.type';
4
+ import { Origin } from '../types/origin.type';
5
+ export type AdapterMode = 0 | 1 | 2;
6
+ export declare class StrategyFactory {
7
+ static create(http: DefaultHttpClient, logger: Logger, config: Origin.Config): Strategy;
8
+ }
@@ -1,21 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StrategyFactory = void 0;
4
- const default_strategy_class_1 = require("./default-strategy.class");
5
- const partial_startegy_class_1 = require("./partial-startegy.class");
6
- const scratch_strategy_class_1 = require("./scratch-strategy.class");
7
- class StrategyFactory {
8
- static create(http, logger, config) {
9
- var _a;
10
- const strategies = {
11
- 0: () => new partial_startegy_class_1.PartialStrategy(http, logger, config),
12
- 1: () => new default_strategy_class_1.DefaultStrategy(http, logger, config),
13
- 2: () => new scratch_strategy_class_1.ScratchStrategy(http, logger, config)
14
- };
15
- if (!strategies[config === null || config === void 0 ? void 0 : config.adapterMode]) {
16
- logger.warn(`This mode ${config === null || config === void 0 ? void 0 : config.adapterMode} is invalid. Use mode 0, 1, 2`);
17
- }
18
- return strategies[(_a = config === null || config === void 0 ? void 0 : config.adapterMode) !== null && _a !== void 0 ? _a : 0]();
19
- }
20
- }
21
- exports.StrategyFactory = StrategyFactory;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StrategyFactory = void 0;
4
+ const default_strategy_class_1 = require("./default-strategy.class");
5
+ const partial_startegy_class_1 = require("./partial-startegy.class");
6
+ const scratch_strategy_class_1 = require("./scratch-strategy.class");
7
+ class StrategyFactory {
8
+ static create(http, logger, config) {
9
+ var _a;
10
+ const strategies = {
11
+ 0: () => new partial_startegy_class_1.PartialStrategy(http, logger, config),
12
+ 1: () => new default_strategy_class_1.DefaultStrategy(http, logger, config),
13
+ 2: () => new scratch_strategy_class_1.ScratchStrategy(http, logger, config)
14
+ };
15
+ if (!strategies[config === null || config === void 0 ? void 0 : config.adapterMode]) {
16
+ logger.warn(`This mode ${config === null || config === void 0 ? void 0 : config.adapterMode} is invalid. Use mode 0, 1, 2`);
17
+ }
18
+ return strategies[(_a = config === null || config === void 0 ? void 0 : config.adapterMode) !== null && _a !== void 0 ? _a : 0]();
19
+ }
20
+ }
21
+ exports.StrategyFactory = StrategyFactory;
@@ -1,27 +1,28 @@
1
- /// <reference types="codeceptjs" />
2
- export declare namespace Codecept {
3
- type Status = 'success' | 'failure';
4
- interface Step {
5
- name: string;
6
- args: string[];
7
- status: Status;
8
- duration: number;
9
- startTime: number;
10
- endTime: number;
11
- finishedAt: number;
12
- steps: Step[];
13
- startedAt: number;
14
- }
15
- interface Test<T = any> extends Mocha.Test {
16
- id: string;
17
- steps: Step[];
18
- startedAt: number;
19
- config: any;
20
- inject: any;
21
- artifacts: any;
22
- err?: {
23
- cliMessage?: () => string;
24
- };
25
- opts: T;
26
- }
27
- }
1
+ /// <reference types="codeceptjs" />
2
+ export declare namespace Codecept {
3
+ type Status = 'success' | 'failure';
4
+ interface Step {
5
+ name: string;
6
+ args: string[];
7
+ status: Status;
8
+ duration: number;
9
+ startTime: number;
10
+ endTime: number;
11
+ finishedAt: number;
12
+ steps: Step[];
13
+ startedAt: number;
14
+ }
15
+ interface Test<T = any> extends Mocha.Test {
16
+ id: string;
17
+ steps: Step[];
18
+ startedAt: number;
19
+ config: any;
20
+ inject: any;
21
+ artifacts: any;
22
+ err?: {
23
+ stack: string;
24
+ cliMessage?: () => string;
25
+ };
26
+ opts: T;
27
+ }
28
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,46 +1,46 @@
1
- import { LinkPost } from 'testit-api-client';
2
- import { AdapterMode } from '../strategies/strategy.factory';
3
- export declare namespace Origin {
4
- interface TestConfig {
5
- title?: string;
6
- displayName?: string;
7
- description?: string;
8
- externalId?: string;
9
- links: LinkPost[];
10
- labels?: string[];
11
- workitemIds?: [];
12
- }
13
- interface TestText {
14
- name: string;
15
- content: string;
16
- }
17
- interface TestMetadata {
18
- links?: LinkPost[];
19
- attachments?: string[];
20
- message?: string;
21
- text?: TestText;
22
- }
23
- interface Config {
24
- url?: string;
25
- privateToken?: string;
26
- projectId?: string;
27
- configurationId?: string;
28
- testRunId?: string;
29
- testRunName?: string;
30
- adapterMode?: AdapterMode;
31
- automaticCreationTestCases?: boolean;
32
- configFile?: string;
33
- __DEV?: boolean;
34
- }
35
- type EnvironmentsConfig = Partial<{
36
- TMS_URL: string;
37
- TMS_PRIVATE_TOKEN: string;
38
- TMS_PROJECT_ID: string;
39
- TMS_CONFIGURATION_ID: string;
40
- TMS_TEST_RUN_ID: string;
41
- TMS_TEST_RUN_NAME: string;
42
- TMS_ADAPTER_MODE: AdapterMode;
43
- TMS_AUTOMATIC_CREATION_TEST_CASES: boolean;
44
- TMS_CONFIG_FILE: string;
45
- }>;
46
- }
1
+ import { LinkPost } from 'testit-api-client';
2
+ import { AdapterMode } from '../strategies/strategy.factory';
3
+ export declare namespace Origin {
4
+ interface TestConfig {
5
+ title?: string;
6
+ displayName?: string;
7
+ description?: string;
8
+ externalId?: string;
9
+ links: LinkPost[];
10
+ labels?: string[];
11
+ workitemIds?: [];
12
+ }
13
+ interface TestText {
14
+ name: string;
15
+ content: string;
16
+ }
17
+ interface TestMetadata {
18
+ links?: LinkPost[];
19
+ attachments?: string[];
20
+ message?: string;
21
+ text?: TestText;
22
+ }
23
+ interface Config {
24
+ url?: string;
25
+ privateToken?: string;
26
+ projectId?: string;
27
+ configurationId?: string;
28
+ testRunId?: string;
29
+ testRunName?: string;
30
+ adapterMode?: AdapterMode;
31
+ automaticCreationTestCases?: boolean;
32
+ configFile?: string;
33
+ __DEV?: boolean;
34
+ }
35
+ type EnvironmentsConfig = Partial<{
36
+ TMS_URL: string;
37
+ TMS_PRIVATE_TOKEN: string;
38
+ TMS_PROJECT_ID: string;
39
+ TMS_CONFIGURATION_ID: string;
40
+ TMS_TEST_RUN_ID: string;
41
+ TMS_TEST_RUN_NAME: string;
42
+ TMS_ADAPTER_MODE: AdapterMode;
43
+ TMS_AUTOMATIC_CREATION_TEST_CASES: boolean;
44
+ TMS_CONFIG_FILE: string;
45
+ }>;
46
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,14 @@
1
- /// <reference types="codeceptjs" />
2
- import { Origin } from './origin.type';
3
- export interface Strategy {
4
- bootstrap(): Promise<any>;
5
- teardown(): Promise<any>;
6
- beforeTest(test: Mocha.Test): Promise<void>;
7
- transferTestsToSystem(suite: Mocha.Suite): Promise<void>;
8
- transferRunsToSystem(suite: Mocha.Suite): Promise<void>;
9
- collect(id: string, data: Origin.TestMetadata): void;
10
- }
1
+ /// <reference types="codeceptjs" />
2
+ import { Origin } from './origin.type';
3
+ export interface Strategy {
4
+ bootstrap(): Promise<any>;
5
+ teardown(): Promise<any>;
6
+ beforeTest(test: Mocha.Test): Promise<void>;
7
+ transferTestsToSystem(suite: {
8
+ tests: Mocha.Test[];
9
+ }): Promise<void>;
10
+ transferRunsToSystem(suite: {
11
+ tests: Mocha.Test[];
12
+ }): Promise<void>;
13
+ collect(id: string, data: Origin.TestMetadata): void;
14
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,46 +1,50 @@
1
- {
2
- "name": "testit-adapter-codecept",
3
- "version": "1.1.3",
4
- "description": "Codecept adapter for TestIT",
5
- "keywords": [],
6
- "main": "build/index.js",
7
- "types": "build/index.d.ts",
8
- "scripts": {
9
- "build": "run-p build:*",
10
- "build:main": "tsc -p tsconfig.publish.json",
11
- "build:dev": "tsc -p tsconfig.json",
12
- "publish:local": "npm run build:main && npm pack --pack-destination ~/Packages",
13
- "watch:dev": "tsc -p tsconfig.publish.json -w",
14
- "test": "jest"
15
- },
16
- "dependencies": {
17
- "dotenv": "^16.0.3",
18
- "npm-run-all": "^4.1.5",
19
- "testit-api-client": "^1.0.8"
20
- },
21
- "devDependencies": {
22
- "@codeceptjs/configure": "^0.10.0",
23
- "@codeceptjs/examples": "^1.2.1",
24
- "@codeceptjs/ui": "^0.4.7",
25
- "@types/jest": "^29.2.2",
26
- "@types/node": "^18.11.9",
27
- "@typescript-eslint/eslint-plugin": "^5.42.0",
28
- "@typescript-eslint/parser": "^5.42.0",
29
- "codeceptjs": "^3.3.6",
30
- "eslint": "^8.27.0",
31
- "jest": "^29.2.2",
32
- "playwright": "^1.27.1",
33
- "prettier": "2.7.1",
34
- "ts-jest": "^29.0.3",
35
- "ts-node": "^10.9.1",
36
- "typescript": "^4.8.4"
37
- },
38
- "bugs": {
39
- "url": "https://github.com/testit-tms/adapters-js/issues"
40
- },
41
- "homepage": "https://github.com/testit-tms/adapters-js",
42
- "repository": {
43
- "type": "git",
44
- "url": "git+https://github.com/testit-tms/adapters-js.git"
45
- }
46
- }
1
+ {
2
+ "name": "testit-adapter-codecept",
3
+ "version": "1.1.5",
4
+ "description": "Codecept adapter for Test IT",
5
+ "keywords": [],
6
+ "author": {
7
+ "name": "Integration team",
8
+ "email": "integrations@testit.software"
9
+ },
10
+ "main": "build/index.js",
11
+ "types": "build/index.d.ts",
12
+ "scripts": {
13
+ "build": "run-p build:*",
14
+ "build:main": "tsc -p tsconfig.publish.json",
15
+ "build:dev": "tsc -p tsconfig.json",
16
+ "publish:local": "npm run build:main && npm pack --pack-destination ~/Packages",
17
+ "watch:dev": "tsc -p tsconfig.publish.json -w",
18
+ "test": "jest"
19
+ },
20
+ "dependencies": {
21
+ "dotenv": "^16.0.3",
22
+ "npm-run-all": "^4.1.5",
23
+ "testit-api-client": "^1.0.8"
24
+ },
25
+ "devDependencies": {
26
+ "@codeceptjs/configure": "^0.10.0",
27
+ "@codeceptjs/examples": "^1.2.1",
28
+ "@codeceptjs/ui": "^0.4.7",
29
+ "@types/jest": "^29.2.2",
30
+ "@types/node": "^18.11.9",
31
+ "@typescript-eslint/eslint-plugin": "^5.42.0",
32
+ "@typescript-eslint/parser": "^5.42.0",
33
+ "codeceptjs": "^3.3.6",
34
+ "eslint": "^8.27.0",
35
+ "jest": "^29.2.2",
36
+ "playwright": "^1.27.1",
37
+ "prettier": "2.7.1",
38
+ "ts-jest": "^29.0.3",
39
+ "ts-node": "^10.9.1",
40
+ "typescript": "^4.8.4"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/testit-tms/adapters-js/issues"
44
+ },
45
+ "homepage": "https://github.com/testit-tms/adapters-js",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/testit-tms/adapters-js.git"
49
+ }
50
+ }