@nocobase/plugin-workflow-test 0.19.0-alpha.4 → 0.19.0-alpha.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.
- package/dist/e2e/e2ePageObjectModel.js +4 -4
- package/dist/e2e/e2eUtils.d.ts +2 -0
- package/dist/e2e/e2eUtils.js +18 -1
- package/dist/externalVersion.js +5 -5
- package/dist/server/triggers.d.ts +2 -0
- package/dist/server/triggers.js +6 -0
- package/package.json +2 -2
- package/src/e2e/e2ePageObjectModel.ts +4 -4
- package/src/e2e/e2eUtils.ts +39 -0
- package/src/server/triggers.ts +6 -0
|
@@ -431,11 +431,11 @@ class ManualNode {
|
|
|
431
431
|
this.assigneesDropDown = page.getByTestId("select-single");
|
|
432
432
|
this.configureUserInterfaceButton = page.getByRole("button", { name: "Configure user interface" });
|
|
433
433
|
this.addBlockButton = page.getByLabel("schema-initializer-Grid-AddBlockButton-workflows");
|
|
434
|
-
this.triggerDataMenu = page.
|
|
435
|
-
this.nodeDataMenu = page.
|
|
434
|
+
this.triggerDataMenu = page.getByRole("menuitem", { name: "Trigger data" });
|
|
435
|
+
this.nodeDataMenu = page.getByRole("menuitem", { name: "Node result right" });
|
|
436
436
|
this.customFormMenu = page.getByRole("menuitem", { name: "Custom form" });
|
|
437
|
-
this.createRecordFormMenu = page.getByRole("menuitem", { name: "Create record form" });
|
|
438
|
-
this.updateRecordFormMenu = page.getByRole("menuitem", { name: "Update record form" });
|
|
437
|
+
this.createRecordFormMenu = page.getByRole("menuitem", { name: "Create record form right" });
|
|
438
|
+
this.updateRecordFormMenu = page.getByRole("menuitem", { name: "Update record form right" });
|
|
439
439
|
this.submitButton = page.getByLabel("action-Action-Submit-workflows");
|
|
440
440
|
this.cancelButton = page.getByLabel("action-Action-Cancel-workflows");
|
|
441
441
|
this.addNodeButton = page.getByLabel(`add-button-manual-${nodeName}`, { exact: true });
|
package/dist/e2e/e2eUtils.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const apiGetWorkflowNodeExecutions: (id: number) => Promise<any>;
|
|
|
10
10
|
export declare const apiUpdateRecord: (collectionName: string, id: number, data: any) => Promise<any>;
|
|
11
11
|
export declare const apiGetRecord: (collectionName: string, id: number) => Promise<any>;
|
|
12
12
|
export declare const apiGetList: (collectionName: string) => Promise<any>;
|
|
13
|
+
export declare const apiFilterList: (collectionName: string, filter: string) => Promise<any>;
|
|
13
14
|
export declare const apiCreateRecordTriggerFormEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
14
15
|
export declare const apiSubmitRecordTriggerFormEvent: (triggerWorkflows: string, data: any) => Promise<any>;
|
|
15
16
|
declare const _default: {
|
|
@@ -27,5 +28,6 @@ declare const _default: {
|
|
|
27
28
|
apiGetList: (collectionName: string) => Promise<any>;
|
|
28
29
|
apiCreateRecordTriggerFormEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
29
30
|
apiSubmitRecordTriggerFormEvent: (triggerWorkflows: string, data: any) => Promise<any>;
|
|
31
|
+
apiFilterList: (collectionName: string, filter: string) => Promise<any>;
|
|
30
32
|
};
|
|
31
33
|
export default _default;
|
package/dist/e2e/e2eUtils.js
CHANGED
|
@@ -21,6 +21,7 @@ __export(e2eUtils_exports, {
|
|
|
21
21
|
apiCreateWorkflow: () => apiCreateWorkflow,
|
|
22
22
|
apiCreateWorkflowNode: () => apiCreateWorkflowNode,
|
|
23
23
|
apiDeleteWorkflow: () => apiDeleteWorkflow,
|
|
24
|
+
apiFilterList: () => apiFilterList,
|
|
24
25
|
apiGetList: () => apiGetList,
|
|
25
26
|
apiGetRecord: () => apiGetRecord,
|
|
26
27
|
apiGetWorkflow: () => apiGetWorkflow,
|
|
@@ -212,6 +213,20 @@ const apiGetList = async (collectionName) => {
|
|
|
212
213
|
}
|
|
213
214
|
return await result.json();
|
|
214
215
|
};
|
|
216
|
+
const apiFilterList = async (collectionName, filter) => {
|
|
217
|
+
const api = await import_e2e.request.newContext({
|
|
218
|
+
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
219
|
+
});
|
|
220
|
+
const state = await api.storageState();
|
|
221
|
+
const headers = getHeaders(state);
|
|
222
|
+
const result = await api.get(`/api/${collectionName}:list?${filter}`, {
|
|
223
|
+
headers
|
|
224
|
+
});
|
|
225
|
+
if (!result.ok()) {
|
|
226
|
+
throw new Error(await result.text());
|
|
227
|
+
}
|
|
228
|
+
return await result.json();
|
|
229
|
+
};
|
|
215
230
|
const apiCreateRecordTriggerFormEvent = async (collectionName, triggerWorkflows, data) => {
|
|
216
231
|
const api = await import_e2e.request.newContext({
|
|
217
232
|
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
@@ -297,7 +312,8 @@ var e2eUtils_default = module.exports = {
|
|
|
297
312
|
apiGetRecord,
|
|
298
313
|
apiGetList,
|
|
299
314
|
apiCreateRecordTriggerFormEvent,
|
|
300
|
-
apiSubmitRecordTriggerFormEvent
|
|
315
|
+
apiSubmitRecordTriggerFormEvent,
|
|
316
|
+
apiFilterList
|
|
301
317
|
};
|
|
302
318
|
// Annotate the CommonJS export names for ESM import in node:
|
|
303
319
|
0 && (module.exports = {
|
|
@@ -305,6 +321,7 @@ var e2eUtils_default = module.exports = {
|
|
|
305
321
|
apiCreateWorkflow,
|
|
306
322
|
apiCreateWorkflowNode,
|
|
307
323
|
apiDeleteWorkflow,
|
|
324
|
+
apiFilterList,
|
|
308
325
|
apiGetList,
|
|
309
326
|
apiGetRecord,
|
|
310
327
|
apiGetWorkflow,
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.19.0-alpha.
|
|
3
|
-
"@nocobase/utils": "0.19.0-alpha.
|
|
2
|
+
"@nocobase/client": "0.19.0-alpha.5",
|
|
3
|
+
"@nocobase/utils": "0.19.0-alpha.5",
|
|
4
4
|
"lodash": "4.17.21",
|
|
5
|
-
"@nocobase/test": "0.19.0-alpha.
|
|
6
|
-
"@nocobase/server": "0.19.0-alpha.
|
|
7
|
-
"@nocobase/database": "0.19.0-alpha.
|
|
5
|
+
"@nocobase/test": "0.19.0-alpha.5",
|
|
6
|
+
"@nocobase/server": "0.19.0-alpha.5",
|
|
7
|
+
"@nocobase/database": "0.19.0-alpha.5"
|
|
8
8
|
};
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
on(): void;
|
|
6
6
|
off(): void;
|
|
7
7
|
sync: boolean;
|
|
8
|
+
validateEvent(): boolean;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
10
11
|
asyncTrigger: {
|
|
@@ -12,6 +13,7 @@ declare const _default: {
|
|
|
12
13
|
readonly workflow: any;
|
|
13
14
|
on(): void;
|
|
14
15
|
off(): void;
|
|
16
|
+
validateEvent(): boolean;
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
19
|
};
|
package/dist/server/triggers.js
CHANGED
|
@@ -30,6 +30,9 @@ var triggers_default = {
|
|
|
30
30
|
off() {
|
|
31
31
|
}
|
|
32
32
|
sync = true;
|
|
33
|
+
validateEvent() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
33
36
|
},
|
|
34
37
|
asyncTrigger: class {
|
|
35
38
|
constructor(workflow) {
|
|
@@ -39,5 +42,8 @@ var triggers_default = {
|
|
|
39
42
|
}
|
|
40
43
|
off() {
|
|
41
44
|
}
|
|
45
|
+
validateEvent() {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@nocobase/plugin-workflow-test",
|
|
3
3
|
"displayName": "Workflow: test kit",
|
|
4
4
|
"displayName.zh-CN": "工作流:测试工具包",
|
|
5
|
-
"version": "0.19.0-alpha.
|
|
5
|
+
"version": "0.19.0-alpha.5",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"main": "dist/server/index.js",
|
|
8
8
|
"types": "./dist/server/index.d.ts",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"@nocobase/server": "0.x",
|
|
12
12
|
"@nocobase/test": "0.x"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "580eca25451ec731d17ddef285d0b8c52c48d501"
|
|
15
15
|
}
|
|
@@ -435,11 +435,11 @@ export class ManualNode {
|
|
|
435
435
|
this.assigneesDropDown = page.getByTestId('select-single');
|
|
436
436
|
this.configureUserInterfaceButton = page.getByRole('button', { name: 'Configure user interface' });
|
|
437
437
|
this.addBlockButton = page.getByLabel('schema-initializer-Grid-AddBlockButton-workflows');
|
|
438
|
-
this.triggerDataMenu = page.
|
|
439
|
-
this.nodeDataMenu = page.
|
|
438
|
+
this.triggerDataMenu = page.getByRole('menuitem', { name: 'Trigger data' });
|
|
439
|
+
this.nodeDataMenu = page.getByRole('menuitem', { name: 'Node result right' });
|
|
440
440
|
this.customFormMenu = page.getByRole('menuitem', { name: 'Custom form' });
|
|
441
|
-
this.createRecordFormMenu = page.getByRole('menuitem', { name: 'Create record form' });
|
|
442
|
-
this.updateRecordFormMenu = page.getByRole('menuitem', { name: 'Update record form' });
|
|
441
|
+
this.createRecordFormMenu = page.getByRole('menuitem', { name: 'Create record form right' });
|
|
442
|
+
this.updateRecordFormMenu = page.getByRole('menuitem', { name: 'Update record form right' });
|
|
443
443
|
this.submitButton = page.getByLabel('action-Action-Submit-workflows');
|
|
444
444
|
this.cancelButton = page.getByLabel('action-Action-Cancel-workflows');
|
|
445
445
|
this.addNodeButton = page.getByLabel(`add-button-manual-${nodeName}`, { exact: true });
|
package/src/e2e/e2eUtils.ts
CHANGED
|
@@ -605,6 +605,44 @@ export const apiGetList = async (collectionName: string) => {
|
|
|
605
605
|
return await result.json();
|
|
606
606
|
};
|
|
607
607
|
|
|
608
|
+
// 查询业务表list
|
|
609
|
+
export const apiFilterList = async (collectionName: string, filter: string) => {
|
|
610
|
+
const api = await request.newContext({
|
|
611
|
+
storageState: process.env.PLAYWRIGHT_AUTH_FILE,
|
|
612
|
+
});
|
|
613
|
+
const state = await api.storageState();
|
|
614
|
+
const headers = getHeaders(state);
|
|
615
|
+
const result = await api.get(`/api/${collectionName}:list?${filter}`, {
|
|
616
|
+
headers,
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
if (!result.ok()) {
|
|
620
|
+
throw new Error(await result.text());
|
|
621
|
+
}
|
|
622
|
+
/*
|
|
623
|
+
{
|
|
624
|
+
"data": [
|
|
625
|
+
{
|
|
626
|
+
"id": 1,
|
|
627
|
+
"createdAt": "2023-12-12T02:43:53.793Z",
|
|
628
|
+
"updatedAt": "2023-12-12T05:41:33.300Z",
|
|
629
|
+
"key": "fzk3j2oj4el",
|
|
630
|
+
"title": "a11",
|
|
631
|
+
"enabled": true,
|
|
632
|
+
"description": null
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
"meta": {
|
|
636
|
+
"count": 1,
|
|
637
|
+
"page": 1,
|
|
638
|
+
"pageSize": 20,
|
|
639
|
+
"totalPage": 1
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
*/
|
|
643
|
+
return await result.json();
|
|
644
|
+
};
|
|
645
|
+
|
|
608
646
|
// 添加业务表单条数据触发工作流表单事件,triggerWorkflows=key1!field,key2,key3!field.subfield
|
|
609
647
|
export const apiCreateRecordTriggerFormEvent = async (collectionName: string, triggerWorkflows: string, data: any) => {
|
|
610
648
|
const api = await request.newContext({
|
|
@@ -744,4 +782,5 @@ export default module.exports = {
|
|
|
744
782
|
apiGetList,
|
|
745
783
|
apiCreateRecordTriggerFormEvent,
|
|
746
784
|
apiSubmitRecordTriggerFormEvent,
|
|
785
|
+
apiFilterList,
|
|
747
786
|
};
|
package/src/server/triggers.ts
CHANGED