complexqa_frontend_core 1.29.1 → 1.30.2
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/package.json +1 -1
- package/publish/api/autotest_case_api.js +78 -0
- package/publish/api/autotest_result_api.js +17 -0
- package/publish/api/autotest_run_api.js +36 -0
- package/publish/api/autotest_step_api.js +88 -0
- package/publish/api/autotest_suite_api.js +17 -0
- package/publish/api/file_app_api.js +76 -0
- package/publish/api/index.js +16 -0
- package/publish/api/object_repository_element_api.js +17 -0
- package/publish/api/object_repository_folder_api.js +17 -0
- package/publish/api/object_repository_page_api.js +17 -0
- package/publish/app_configuration/menu_configuration_main.js +14 -0
- package/publish/app_configuration/table/helpers/table_element_models.js +16 -0
- package/publish/app_configuration/table/sections/autotest_case.js +73 -0
- package/publish/app_configuration/table/sections/autotest_result.js +59 -0
- package/publish/app_configuration/table/sections/autotest_run.js +66 -0
- package/publish/app_configuration/table/sections/autotest_step.js +82 -0
- package/publish/app_configuration/table/sections/autotest_suite.js +42 -0
- package/publish/app_configuration/table/sections/object_repository_element.js +59 -0
- package/publish/app_configuration/table/sections/object_repository_folder.js +41 -0
- package/publish/app_configuration/table/sections/object_repository_page.js +55 -0
- package/publish/app_configuration/table/table_configuration.js +16 -0
- package/publish/index.js +28 -0
- package/publish/services/FileAppService.js +48 -0
- package/publish/types/element_translate/typeAttachment.i18n.js +22 -11
- package/publish/types/element_translate/typeAutotestCase.i18n.js +95 -0
- package/publish/types/element_translate/typeAutotestResult.i18n.js +77 -0
- package/publish/types/element_translate/typeAutotestRun.i18n.js +110 -0
- package/publish/types/element_translate/typeAutotestStep.i18n.js +80 -0
- package/publish/types/element_translate/typeAutotestSuite.i18n.js +40 -0
- package/publish/types/element_translate/typeBug.i18n.js +1 -1
- package/publish/types/element_translate/typeCustomProperty.i18n.js +21 -6
- package/publish/types/element_translate/typeCustomPropertyValue.i18n.js +21 -6
- package/publish/types/element_translate/typeFile.i18n.js +21 -15
- package/publish/types/element_translate/typeObjectRepositoryElement.i18n.js +92 -0
- package/publish/types/element_translate/typeObjectRepositoryFolder.i18n.js +62 -0
- package/publish/types/element_translate/typeObjectRepositoryPage.i18n.js +43 -0
- package/publish/types/element_translate/typeTagRelation.i18n.js +18 -0
- package/publish/types/family_elements/autotest_step_actions/autotestStepActionCatalog.js +54 -0
- package/publish/types/family_elements/autotest_step_actions/autotestStepLocatorKind.js +56 -0
- package/publish/types/family_elements/autotest_step_actions/autotestStepTargetNormalizer.js +134 -0
- package/publish/types/family_elements/autotest_step_actions/typeAutotestStepAction.js +35 -0
- package/publish/types/family_elements/autotest_step_actions/typeAutotestStepActionVariants.js +148 -0
- package/publish/types/family_elements/autotest_step_actions/typeAutotestStepLocatorAction.js +12 -0
- package/publish/types/family_elements/autotest_step_actions/typeAutotestStepLocatorValueAction.js +13 -0
- package/publish/types/family_elements/typeAttachment.js +1 -1
- package/publish/types/family_elements/typeAutotestCase.js +220 -0
- package/publish/types/family_elements/typeAutotestResult.js +81 -0
- package/publish/types/family_elements/typeAutotestRun.js +165 -0
- package/publish/types/family_elements/typeAutotestStep.js +297 -0
- package/publish/types/family_elements/typeAutotestStepTarget.js +50 -0
- package/publish/types/family_elements/typeAutotestSuite.js +74 -0
- package/publish/types/family_elements/typeCustomProperty.js +1 -1
- package/publish/types/family_elements/typeObjectRepositoryElement.js +88 -0
- package/publish/types/family_elements/typeObjectRepositoryFolder.js +81 -0
- package/publish/types/family_elements/typeObjectRepositoryPage.js +77 -0
- package/publish/types/family_files/familyFile.js +2 -0
- package/publish/types/family_files/typeFileAutotestScreenshot.js +33 -0
- package/publish/types/family_files/typeFileFactory.js +3 -0
- package/publish/types/family_relation/typeCustomPropertyValue.js +7 -2
- package/publish/types/family_relation/typeTagRelation.js +30 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explicit locator kinds. Same ids as PHP AutotestStepLocatorKind.
|
|
3
|
+
*
|
|
4
|
+
* @version v.1.0 (05/09/2026)
|
|
5
|
+
*/
|
|
6
|
+
export const AUTOTEST_STEP_LOCATOR_KINDS = [
|
|
7
|
+
'ROLE',
|
|
8
|
+
'LABEL',
|
|
9
|
+
'PLACEHOLDER',
|
|
10
|
+
'TESTID',
|
|
11
|
+
'TEXT',
|
|
12
|
+
'CSS',
|
|
13
|
+
'ID',
|
|
14
|
+
'NAME',
|
|
15
|
+
'XPATH',
|
|
16
|
+
'SELECTOR',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Playwright getByRole names. Subset used in the Role select.
|
|
22
|
+
*
|
|
23
|
+
* @version v.1.0 (05/09/2026)
|
|
24
|
+
*/
|
|
25
|
+
export const AUTOTEST_STEP_PLAYWRIGHT_ROLES = [
|
|
26
|
+
'alert',
|
|
27
|
+
'alertdialog',
|
|
28
|
+
'button',
|
|
29
|
+
'checkbox',
|
|
30
|
+
'combobox',
|
|
31
|
+
'dialog',
|
|
32
|
+
'heading',
|
|
33
|
+
'img',
|
|
34
|
+
'link',
|
|
35
|
+
'list',
|
|
36
|
+
'listitem',
|
|
37
|
+
'menuitem',
|
|
38
|
+
'navigation',
|
|
39
|
+
'option',
|
|
40
|
+
'radio',
|
|
41
|
+
'searchbox',
|
|
42
|
+
'switch',
|
|
43
|
+
'tab',
|
|
44
|
+
'table',
|
|
45
|
+
'textbox',
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} kind
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
53
|
+
export function is_autotest_step_locator_kind(kind)
|
|
54
|
+
{
|
|
55
|
+
return AUTOTEST_STEP_LOCATOR_KINDS.indexOf(String(kind || '').toUpperCase()) !== -1;
|
|
56
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { is_autotest_step_locator_kind, AUTOTEST_STEP_LOCATOR_KINDS } from './autotestStepLocatorKind.js';
|
|
2
|
+
import { is_object } from '../../../utils/utils.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const LEGACY_KIND_ORDER = [
|
|
6
|
+
[ 'selector', 'SELECTOR' ],
|
|
7
|
+
[ 'css', 'CSS' ],
|
|
8
|
+
[ 'id', 'ID' ],
|
|
9
|
+
[ 'name', 'NAME' ],
|
|
10
|
+
[ 'placeholder', 'PLACEHOLDER' ],
|
|
11
|
+
[ 'label', 'LABEL' ],
|
|
12
|
+
[ 'testid', 'TESTID' ],
|
|
13
|
+
[ 'role', 'ROLE' ],
|
|
14
|
+
[ 'accessible_name', 'TEXT' ],
|
|
15
|
+
[ 'text', 'TEXT' ],
|
|
16
|
+
[ 'xpath', 'XPATH' ],
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Canonical target: { kind, value, name? }. expected_value is a sibling of the locator in storage JSON.
|
|
22
|
+
*
|
|
23
|
+
* @version v.1.0 (05/09/2026)
|
|
24
|
+
*/
|
|
25
|
+
export function hydrate_autotest_step_target(decoded)
|
|
26
|
+
{
|
|
27
|
+
if (!decoded || !is_object(decoded))
|
|
28
|
+
{
|
|
29
|
+
return { target: null, expected_value: null };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const copy = { ...decoded };
|
|
33
|
+
let expected_value = null;
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(copy, 'expected_value'))
|
|
35
|
+
{
|
|
36
|
+
if (copy.expected_value !== null && copy.expected_value !== '')
|
|
37
|
+
{
|
|
38
|
+
expected_value = String(copy.expected_value);
|
|
39
|
+
}
|
|
40
|
+
delete copy.expected_value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
target : locator_from_decoded(copy),
|
|
45
|
+
expected_value: expected_value,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {object|null} target
|
|
52
|
+
* @param {string|null} expected_value
|
|
53
|
+
* @returns {object|null}
|
|
54
|
+
*/
|
|
55
|
+
export function build_autotest_step_target_storage(target, expected_value)
|
|
56
|
+
{
|
|
57
|
+
const payload = {};
|
|
58
|
+
if (target && is_object(target))
|
|
59
|
+
{
|
|
60
|
+
const kind = String(target.kind || '').toUpperCase();
|
|
61
|
+
if (kind && is_autotest_step_locator_kind(kind))
|
|
62
|
+
{
|
|
63
|
+
payload.kind = kind;
|
|
64
|
+
payload.value = String(target.value ?? '');
|
|
65
|
+
if (target.name)
|
|
66
|
+
{
|
|
67
|
+
payload.name = String(target.name);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (expected_value !== null && expected_value !== undefined && expected_value !== '')
|
|
72
|
+
{
|
|
73
|
+
payload.expected_value = String(expected_value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Object.keys(payload).length ? payload : null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {object} decoded
|
|
82
|
+
* @returns {object|null}
|
|
83
|
+
*/
|
|
84
|
+
function locator_from_decoded(decoded)
|
|
85
|
+
{
|
|
86
|
+
const kind = String(decoded.kind || '').toUpperCase();
|
|
87
|
+
if (kind)
|
|
88
|
+
{
|
|
89
|
+
if (!is_autotest_step_locator_kind(kind))
|
|
90
|
+
{
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const locator = {
|
|
94
|
+
kind : kind,
|
|
95
|
+
value: String(decoded.value ?? ''),
|
|
96
|
+
};
|
|
97
|
+
const name = decoded.name || decoded.accessible_name || '';
|
|
98
|
+
if (name)
|
|
99
|
+
{
|
|
100
|
+
locator.name = String(name);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return locator;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
for (let i = 0; i < LEGACY_KIND_ORDER.length; i++)
|
|
107
|
+
{
|
|
108
|
+
const key = LEGACY_KIND_ORDER[ i ][ 0 ];
|
|
109
|
+
const map = LEGACY_KIND_ORDER[ i ][ 1 ];
|
|
110
|
+
if (decoded[ key ] === undefined || decoded[ key ] === null || decoded[ key ] === '')
|
|
111
|
+
{
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const locator = {
|
|
115
|
+
kind : map,
|
|
116
|
+
value: String(decoded[ key ]),
|
|
117
|
+
};
|
|
118
|
+
if (map === 'ROLE')
|
|
119
|
+
{
|
|
120
|
+
const name = decoded.accessible_name || decoded.text || '';
|
|
121
|
+
if (name)
|
|
122
|
+
{
|
|
123
|
+
locator.name = String(name);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return locator;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
export { AUTOTEST_STEP_LOCATOR_KINDS };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base ACTION type. Shell (sort, clone, delete, timeout) lives on typeAutotestStep.
|
|
3
|
+
* Subclasses own only action fields and target rules.
|
|
4
|
+
*
|
|
5
|
+
* @version v.1.0 (05/09/2026)
|
|
6
|
+
*/
|
|
7
|
+
export class typeAutotestStepAction
|
|
8
|
+
{
|
|
9
|
+
static type_id = 'ACTION';
|
|
10
|
+
static action_name = '';
|
|
11
|
+
static group = 'page';
|
|
12
|
+
static value_need = 'unused';
|
|
13
|
+
static target_need = 'unused';
|
|
14
|
+
static has_expected_value = false;
|
|
15
|
+
static value_field_key = 'value_text';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @returns {object}
|
|
20
|
+
*/
|
|
21
|
+
catalog_entry()
|
|
22
|
+
{
|
|
23
|
+
const ctor = this.constructor;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
type_id : ctor.action_name || ctor.type_id,
|
|
27
|
+
action_name : ctor.action_name,
|
|
28
|
+
group : ctor.group,
|
|
29
|
+
value_need : ctor.value_need,
|
|
30
|
+
target_need : ctor.target_need,
|
|
31
|
+
has_expected_value: ctor.has_expected_value,
|
|
32
|
+
value_field_key : ctor.value_field_key,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { typeAutotestStepAction } from './typeAutotestStepAction.js';
|
|
2
|
+
import { typeAutotestStepLocatorAction } from './typeAutotestStepLocatorAction.js';
|
|
3
|
+
import { typeAutotestStepLocatorValueAction } from './typeAutotestStepLocatorValueAction.js';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class typeAutotestStepGoto extends typeAutotestStepAction
|
|
7
|
+
{
|
|
8
|
+
static action_name = 'goto';
|
|
9
|
+
static value_need = 'optional';
|
|
10
|
+
static value_field_key = 'url';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class typeAutotestStepClick extends typeAutotestStepLocatorAction
|
|
14
|
+
{
|
|
15
|
+
static action_name = 'click';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class typeAutotestStepDblclick extends typeAutotestStepLocatorAction
|
|
19
|
+
{
|
|
20
|
+
static action_name = 'dblclick';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class typeAutotestStepFill extends typeAutotestStepLocatorValueAction
|
|
24
|
+
{
|
|
25
|
+
static action_name = 'fill';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class typeAutotestStepType extends typeAutotestStepLocatorValueAction
|
|
29
|
+
{
|
|
30
|
+
static action_name = 'type';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class typeAutotestStepPress extends typeAutotestStepLocatorValueAction
|
|
34
|
+
{
|
|
35
|
+
static action_name = 'press';
|
|
36
|
+
static value_field_key = 'key';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class typeAutotestStepCheck extends typeAutotestStepLocatorAction
|
|
40
|
+
{
|
|
41
|
+
static action_name = 'check';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class typeAutotestStepUncheck extends typeAutotestStepLocatorAction
|
|
45
|
+
{
|
|
46
|
+
static action_name = 'uncheck';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class typeAutotestStepSelectOption extends typeAutotestStepLocatorValueAction
|
|
50
|
+
{
|
|
51
|
+
static action_name = 'selectOption';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class typeAutotestStepHover extends typeAutotestStepLocatorAction
|
|
55
|
+
{
|
|
56
|
+
static action_name = 'hover';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class typeAutotestStepFocus extends typeAutotestStepLocatorAction
|
|
60
|
+
{
|
|
61
|
+
static action_name = 'focus';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class typeAutotestStepWaitForSelector extends typeAutotestStepLocatorAction
|
|
65
|
+
{
|
|
66
|
+
static action_name = 'waitForSelector';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class typeAutotestStepWaitForURL extends typeAutotestStepAction
|
|
70
|
+
{
|
|
71
|
+
static action_name = 'waitForURL';
|
|
72
|
+
static value_need = 'required';
|
|
73
|
+
static value_field_key = 'url';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class typeAutotestStepWaitForTimeout extends typeAutotestStepAction
|
|
77
|
+
{
|
|
78
|
+
static action_name = 'waitForTimeout';
|
|
79
|
+
static value_need = 'required';
|
|
80
|
+
static value_field_key = 'duration_ms';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class typeAutotestStepGoBack extends typeAutotestStepAction
|
|
84
|
+
{
|
|
85
|
+
static action_name = 'goBack';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class typeAutotestStepGoForward extends typeAutotestStepAction
|
|
89
|
+
{
|
|
90
|
+
static action_name = 'goForward';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class typeAutotestStepReload extends typeAutotestStepAction
|
|
94
|
+
{
|
|
95
|
+
static action_name = 'reload';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export class typeAutotestStepToBeVisible extends typeAutotestStepLocatorAction
|
|
99
|
+
{
|
|
100
|
+
static action_name = 'toBeVisible';
|
|
101
|
+
static group = 'expect';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export class typeAutotestStepToHaveText extends typeAutotestStepLocatorValueAction
|
|
105
|
+
{
|
|
106
|
+
static action_name = 'toHaveText';
|
|
107
|
+
static group = 'expect';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class typeAutotestStepToHaveURL extends typeAutotestStepAction
|
|
111
|
+
{
|
|
112
|
+
static action_name = 'toHaveURL';
|
|
113
|
+
static group = 'expect';
|
|
114
|
+
static value_need = 'required';
|
|
115
|
+
static value_field_key = 'url';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class typeAutotestStepToHaveAttribute extends typeAutotestStepLocatorValueAction
|
|
119
|
+
{
|
|
120
|
+
static action_name = 'toHaveAttribute';
|
|
121
|
+
static group = 'expect';
|
|
122
|
+
static value_field_key = 'attribute_name';
|
|
123
|
+
static has_expected_value = true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const AUTOTEST_STEP_ACTION_CLASSES = [
|
|
127
|
+
typeAutotestStepGoto,
|
|
128
|
+
typeAutotestStepClick,
|
|
129
|
+
typeAutotestStepDblclick,
|
|
130
|
+
typeAutotestStepFill,
|
|
131
|
+
typeAutotestStepType,
|
|
132
|
+
typeAutotestStepPress,
|
|
133
|
+
typeAutotestStepCheck,
|
|
134
|
+
typeAutotestStepUncheck,
|
|
135
|
+
typeAutotestStepSelectOption,
|
|
136
|
+
typeAutotestStepHover,
|
|
137
|
+
typeAutotestStepFocus,
|
|
138
|
+
typeAutotestStepWaitForSelector,
|
|
139
|
+
typeAutotestStepWaitForURL,
|
|
140
|
+
typeAutotestStepWaitForTimeout,
|
|
141
|
+
typeAutotestStepGoBack,
|
|
142
|
+
typeAutotestStepGoForward,
|
|
143
|
+
typeAutotestStepReload,
|
|
144
|
+
typeAutotestStepToBeVisible,
|
|
145
|
+
typeAutotestStepToHaveText,
|
|
146
|
+
typeAutotestStepToHaveURL,
|
|
147
|
+
typeAutotestStepToHaveAttribute,
|
|
148
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { typeAutotestStepAction } from './typeAutotestStepAction.js';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ACTION with a required locator target.
|
|
6
|
+
*
|
|
7
|
+
* @version v.1.0 (05/09/2026)
|
|
8
|
+
*/
|
|
9
|
+
export class typeAutotestStepLocatorAction extends typeAutotestStepAction
|
|
10
|
+
{
|
|
11
|
+
static target_need = 'required';
|
|
12
|
+
}
|
package/publish/types/family_elements/autotest_step_actions/typeAutotestStepLocatorValueAction.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { typeAutotestStepLocatorAction } from './typeAutotestStepLocatorAction.js';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ACTION with locator target and value_text.
|
|
6
|
+
*
|
|
7
|
+
* @version v.1.0 (05/09/2026)
|
|
8
|
+
*/
|
|
9
|
+
export class typeAutotestStepLocatorValueAction extends typeAutotestStepLocatorAction
|
|
10
|
+
{
|
|
11
|
+
static value_need = 'required';
|
|
12
|
+
static value_field_key = 'text';
|
|
13
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { is_object } from "../../utils/utils.js";
|
|
2
|
+
import { familyTestAutomation } from "../core/1_familyTestAutomation.js";
|
|
3
|
+
import { typeAutotestCase_i18n } from "../element_translate/typeAutotestCase.i18n.js";
|
|
4
|
+
import _ from 'underscore';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Исполняемый автотест платформы (не Git-спека).
|
|
9
|
+
*
|
|
10
|
+
* @version v.1.0 (04/09/2026)
|
|
11
|
+
*/
|
|
12
|
+
export class typeAutotestCase extends familyTestAutomation
|
|
13
|
+
{
|
|
14
|
+
autotest_case_id;
|
|
15
|
+
team_id;
|
|
16
|
+
project_id;
|
|
17
|
+
autotest_suite_id;
|
|
18
|
+
test_case_id;
|
|
19
|
+
execution_context_id;
|
|
20
|
+
autotest_case_title;
|
|
21
|
+
autotest_case_description;
|
|
22
|
+
autotest_case_status;
|
|
23
|
+
autotest_case_kind;
|
|
24
|
+
test_account_id;
|
|
25
|
+
pre_autotest_case_ids;
|
|
26
|
+
created_at;
|
|
27
|
+
updated_at;
|
|
28
|
+
|
|
29
|
+
primary_key = 'autotest_case_id';
|
|
30
|
+
api_key = 'autotest_case';
|
|
31
|
+
|
|
32
|
+
structure_scheme = {
|
|
33
|
+
autotest_case_id : 'integer | require',
|
|
34
|
+
team_id : 'integer | require',
|
|
35
|
+
project_id : 'integer | require',
|
|
36
|
+
autotest_suite_id : 'integer | optional',
|
|
37
|
+
test_case_id : 'integer | optional',
|
|
38
|
+
execution_context_id : 'integer | optional',
|
|
39
|
+
autotest_case_title : 'string | optional',
|
|
40
|
+
autotest_case_description: 'string | optional',
|
|
41
|
+
autotest_case_status : 'string | enum | optional',
|
|
42
|
+
autotest_case_kind : 'string | enum | optional',
|
|
43
|
+
test_account_id : 'integer | optional',
|
|
44
|
+
pre_autotest_case_ids: 'array | optional',
|
|
45
|
+
created_at : 'timestamp | optional',
|
|
46
|
+
updated_at : 'timestamp | optional',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
create_scheme = [
|
|
50
|
+
'project_id',
|
|
51
|
+
'autotest_case_title',
|
|
52
|
+
'autotest_suite_id',
|
|
53
|
+
'test_case_id',
|
|
54
|
+
'test_account_id',
|
|
55
|
+
'autotest_case_kind',
|
|
56
|
+
'pre_autotest_case_ids',
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
available_enum_values = {
|
|
60
|
+
autotest_case_status: [ 'PENDING', 'READY', 'DISABLED' ],
|
|
61
|
+
autotest_case_kind : [ 'CASE', 'COMMON' ],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
enum_value_translate_matrix = typeAutotestCase_i18n.enum_value_translate_matrix;
|
|
65
|
+
attribute_name_translate_matrix = typeAutotestCase_i18n.attribute_name_translate_matrix;
|
|
66
|
+
|
|
67
|
+
status_color = {
|
|
68
|
+
PENDING : '#C4B040',
|
|
69
|
+
READY : '#009688',
|
|
70
|
+
DISABLED: '#E0E0E0',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
kind_color = {
|
|
74
|
+
CASE : '#009688',
|
|
75
|
+
COMMON: '#5C6BC0',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {object|false|undefined} data
|
|
81
|
+
*/
|
|
82
|
+
constructor(data = false)
|
|
83
|
+
{
|
|
84
|
+
super();
|
|
85
|
+
|
|
86
|
+
if (data && is_object(data))
|
|
87
|
+
{
|
|
88
|
+
_.mapObject(data, (value, key) =>
|
|
89
|
+
{
|
|
90
|
+
if (this.hasOwnProperty(key))
|
|
91
|
+
{
|
|
92
|
+
this[ key ] = value;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @returns {string}
|
|
103
|
+
*/
|
|
104
|
+
get_element_name()
|
|
105
|
+
{
|
|
106
|
+
return this.autotest_case_title;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Compile from typeTestCase. Separate entry from empty create.
|
|
112
|
+
*
|
|
113
|
+
* @param {object} payload
|
|
114
|
+
* @param {number} payload.test_case_id
|
|
115
|
+
* @param {object|typeFunctionCallback} callback
|
|
116
|
+
* @returns {Promise<void>}
|
|
117
|
+
*/
|
|
118
|
+
async create_from_test_case(payload, callback)
|
|
119
|
+
{
|
|
120
|
+
if (typeof callback?.before === 'function')
|
|
121
|
+
{
|
|
122
|
+
callback.before({ payload });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return ApiService[ this.api_key ].create_from_test_case(payload).then((response) =>
|
|
126
|
+
{
|
|
127
|
+
if (typeof callback?.success === 'function')
|
|
128
|
+
{
|
|
129
|
+
callback.success({ response, payload });
|
|
130
|
+
}
|
|
131
|
+
}).catch((error) =>
|
|
132
|
+
{
|
|
133
|
+
if (typeof callback?.error === 'function')
|
|
134
|
+
{
|
|
135
|
+
callback.error({ error, payload });
|
|
136
|
+
}
|
|
137
|
+
}).finally((response) =>
|
|
138
|
+
{
|
|
139
|
+
if (typeof callback?.final === 'function')
|
|
140
|
+
{
|
|
141
|
+
callback.final({ response, payload });
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Replace explicit predecessors. Dedicated entry: not update_property.
|
|
149
|
+
*
|
|
150
|
+
* @param {object} payload
|
|
151
|
+
* @param {number} payload.autotest_case_id
|
|
152
|
+
* @param {array} payload.pre_autotest_case_ids
|
|
153
|
+
* @param {object} callback
|
|
154
|
+
* @returns {Promise<void>}
|
|
155
|
+
*/
|
|
156
|
+
async replace_pre_cases(payload, callback)
|
|
157
|
+
{
|
|
158
|
+
if (typeof callback?.before === 'function')
|
|
159
|
+
{
|
|
160
|
+
callback.before({ payload });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return ApiService[ this.api_key ].replace_pre_cases(payload).then((response) =>
|
|
164
|
+
{
|
|
165
|
+
if (typeof callback?.success === 'function')
|
|
166
|
+
{
|
|
167
|
+
callback.success({ response, payload });
|
|
168
|
+
}
|
|
169
|
+
}).catch((error) =>
|
|
170
|
+
{
|
|
171
|
+
if (typeof callback?.error === 'function')
|
|
172
|
+
{
|
|
173
|
+
callback.error({ error, payload });
|
|
174
|
+
}
|
|
175
|
+
}).finally((response) =>
|
|
176
|
+
{
|
|
177
|
+
if (typeof callback?.final === 'function')
|
|
178
|
+
{
|
|
179
|
+
callback.final({ response, payload });
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Read-only syntax of stored steps. Does not open the target site.
|
|
187
|
+
*
|
|
188
|
+
* @param {object} payload
|
|
189
|
+
* @param {number} payload.autotest_case_id
|
|
190
|
+
* @param {object} callback
|
|
191
|
+
* @returns {Promise<void>}
|
|
192
|
+
*/
|
|
193
|
+
async check_syntax(payload, callback)
|
|
194
|
+
{
|
|
195
|
+
if (typeof callback?.before === 'function')
|
|
196
|
+
{
|
|
197
|
+
callback.before({ payload });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return ApiService[ this.api_key ].check_syntax(payload).then((response) =>
|
|
201
|
+
{
|
|
202
|
+
if (typeof callback?.success === 'function')
|
|
203
|
+
{
|
|
204
|
+
callback.success({ response, payload });
|
|
205
|
+
}
|
|
206
|
+
}).catch((error) =>
|
|
207
|
+
{
|
|
208
|
+
if (typeof callback?.error === 'function')
|
|
209
|
+
{
|
|
210
|
+
callback.error({ error, payload });
|
|
211
|
+
}
|
|
212
|
+
}).finally((response) =>
|
|
213
|
+
{
|
|
214
|
+
if (typeof callback?.final === 'function')
|
|
215
|
+
{
|
|
216
|
+
callback.final({ response, payload });
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { is_object } from "../../utils/utils.js";
|
|
2
|
+
import { familyTestAutomation } from "../core/1_familyTestAutomation.js";
|
|
3
|
+
import { typeAutotestResult_i18n } from "../element_translate/typeAutotestResult.i18n.js";
|
|
4
|
+
import _ from 'underscore';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Результат одного автотеста в запуске. FAILED = шаг на странице; ERROR = инфра / allowlist.
|
|
9
|
+
*
|
|
10
|
+
* @version v.1.0 (04/09/2026)
|
|
11
|
+
*/
|
|
12
|
+
export class typeAutotestResult extends familyTestAutomation
|
|
13
|
+
{
|
|
14
|
+
autotest_result_id;
|
|
15
|
+
autotest_run_id;
|
|
16
|
+
autotest_case_id;
|
|
17
|
+
team_id;
|
|
18
|
+
autotest_result_status;
|
|
19
|
+
report_json;
|
|
20
|
+
screenshot_file_uuid;
|
|
21
|
+
started_at;
|
|
22
|
+
finished_at;
|
|
23
|
+
created_at;
|
|
24
|
+
updated_at;
|
|
25
|
+
|
|
26
|
+
primary_key = 'autotest_result_id';
|
|
27
|
+
api_key = 'autotest_result';
|
|
28
|
+
|
|
29
|
+
structure_scheme = {
|
|
30
|
+
autotest_result_id : 'integer | require',
|
|
31
|
+
autotest_run_id : 'integer | require',
|
|
32
|
+
autotest_case_id : 'integer | require',
|
|
33
|
+
team_id : 'integer | require',
|
|
34
|
+
autotest_result_status : 'string | enum | optional',
|
|
35
|
+
report_json : 'string | optional',
|
|
36
|
+
screenshot_file_uuid : 'string | optional',
|
|
37
|
+
started_at : 'timestamp | optional',
|
|
38
|
+
finished_at : 'timestamp | optional',
|
|
39
|
+
created_at : 'timestamp | optional',
|
|
40
|
+
updated_at : 'timestamp | optional',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
create_scheme = [];
|
|
44
|
+
|
|
45
|
+
available_enum_values = {
|
|
46
|
+
autotest_result_status: [ 'PENDING', 'PASSED', 'FAILED', 'SKIPPED', 'ERROR' ],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
enum_value_translate_matrix = typeAutotestResult_i18n.enum_value_translate_matrix;
|
|
50
|
+
attribute_name_translate_matrix = typeAutotestResult_i18n.attribute_name_translate_matrix;
|
|
51
|
+
|
|
52
|
+
status_color = {
|
|
53
|
+
PENDING: '#C4B040',
|
|
54
|
+
PASSED : '#009688',
|
|
55
|
+
FAILED : '#E53935',
|
|
56
|
+
SKIPPED: '#90A4AE',
|
|
57
|
+
ERROR : '#6A1B9A',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {object|false|undefined} data
|
|
63
|
+
*/
|
|
64
|
+
constructor(data = false)
|
|
65
|
+
{
|
|
66
|
+
super();
|
|
67
|
+
|
|
68
|
+
if (data && is_object(data))
|
|
69
|
+
{
|
|
70
|
+
_.mapObject(data, (value, key) =>
|
|
71
|
+
{
|
|
72
|
+
if (this.hasOwnProperty(key))
|
|
73
|
+
{
|
|
74
|
+
this[ key ] = value;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
}
|