@nocobase/plugin-workflow-test 1.2.10-alpha → 1.2.12-alpha

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.
@@ -59,6 +59,7 @@ export declare class ApprovalTriggerNode {
59
59
  configureFieldsButton: Locator;
60
60
  configureActionsButton: Locator;
61
61
  saveDraftSwitch: Locator;
62
+ preloadAssociationsDropDown: Locator;
62
63
  submitButton: Locator;
63
64
  cancelButton: Locator;
64
65
  addNodeButton: Locator;
@@ -70,10 +71,13 @@ export declare class ApprovalPassthroughModeNode {
70
71
  nodeTitle: Locator;
71
72
  nodeConfigure: Locator;
72
73
  addAssigneesButton: Locator;
74
+ addSelectAssigneesMenu: Locator;
75
+ addQueryAssigneesMenu: Locator;
73
76
  assigneesDropDown: Locator;
74
77
  OrRadio: Locator;
75
78
  AndRadio: Locator;
76
79
  votingRadio: Locator;
80
+ votingThresholdEditBox: Locator;
77
81
  parallellyRadio: Locator;
78
82
  sequentiallyRadio: Locator;
79
83
  goToconfigureButton: Locator;
@@ -92,6 +96,41 @@ export declare class ApprovalPassthroughModeNode {
92
96
  addNodeButton: Locator;
93
97
  constructor(page: Page, nodeName: string, collectionName: string);
94
98
  }
99
+ export declare class ApprovalBranchModeNode {
100
+ readonly page: Page;
101
+ node: Locator;
102
+ nodeTitle: Locator;
103
+ nodeConfigure: Locator;
104
+ addAssigneesButton: Locator;
105
+ addSelectAssigneesMenu: Locator;
106
+ addQueryAssigneesMenu: Locator;
107
+ assigneesDropDown: Locator;
108
+ OrRadio: Locator;
109
+ AndRadio: Locator;
110
+ votingRadio: Locator;
111
+ votingThresholdEditBox: Locator;
112
+ parallellyRadio: Locator;
113
+ sequentiallyRadio: Locator;
114
+ goToconfigureButton: Locator;
115
+ addBlockButton: Locator;
116
+ addDetailsMenu: Locator;
117
+ detailsConfigureFieldsButton: Locator;
118
+ addActionsMenu: Locator;
119
+ actionsConfigureFieldsButton: Locator;
120
+ actionsConfigureActionsButton: Locator;
121
+ addApproveButton: Locator;
122
+ addRejectButton: Locator;
123
+ addReturnButton: Locator;
124
+ addNodeResult: Locator;
125
+ submitButton: Locator;
126
+ cancelButton: Locator;
127
+ addNodeButton: Locator;
128
+ addReturnBranchNodeButton: Locator;
129
+ addRejectBranchNodeButton: Locator;
130
+ addApproveBranchNodeButton: Locator;
131
+ endOnRejectCheckbox: Locator;
132
+ constructor(page: Page, nodeName: string, collectionName: string);
133
+ }
95
134
  export declare class ScheduleTriggerNode {
96
135
  readonly page: Page;
97
136
  node: Locator;
@@ -314,5 +353,6 @@ declare const _default: {
314
353
  ConditionBranchNode: typeof ConditionBranchNode;
315
354
  SQLNode: typeof SQLNode;
316
355
  ParallelBranchNode: typeof ParallelBranchNode;
356
+ ApprovalBranchModeNode: typeof ApprovalBranchModeNode;
317
357
  };
318
358
  export default _default;
@@ -27,6 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  var e2ePageObjectModel_exports = {};
28
28
  __export(e2ePageObjectModel_exports, {
29
29
  AggregateNode: () => AggregateNode,
30
+ ApprovalBranchModeNode: () => ApprovalBranchModeNode,
30
31
  ApprovalPassthroughModeNode: () => ApprovalPassthroughModeNode,
31
32
  ApprovalTriggerNode: () => ApprovalTriggerNode,
32
33
  CalculationNode: () => CalculationNode,
@@ -130,14 +131,15 @@ class ApprovalTriggerNode {
130
131
  configureFieldsButton;
131
132
  configureActionsButton;
132
133
  saveDraftSwitch;
134
+ preloadAssociationsDropDown;
133
135
  submitButton;
134
136
  cancelButton;
135
137
  addNodeButton;
136
138
  constructor(page, triggerName, collectionName) {
137
139
  this.page = page;
138
- this.node = page.getByText("TriggeraConfigure");
139
- this.nodeTitle = page.locator("textarea").filter({ hasText: triggerName });
140
- this.nodeConfigure = page.getByRole("button", { name: "Configure" });
140
+ this.node = page.getByLabel(`Trigger-${triggerName}`);
141
+ this.nodeTitle = page.getByLabel(`Trigger-${triggerName}`).getByRole("textbox");
142
+ this.nodeConfigure = page.getByLabel(`Trigger-${triggerName}`).getByRole("button", { name: "Configure" });
141
143
  this.collectionDropDown = page.getByLabel("block-item-DataSourceCollectionCascader-workflows-Collection").locator(".ant-select-selection-search-input");
142
144
  this.dataBlocksInitiationRadio = page.getByLabel("Initiate and approve in data blocks only");
143
145
  this.dataBlocksAndGlobalApprovalBlocksInitiationRadio = page.getByLabel(
@@ -148,10 +150,9 @@ class ApprovalTriggerNode {
148
150
  this.addBlockButton = page.getByLabel(`schema-initializer-Grid-ApprovalApplyAddBlockButton-${collectionName}`);
149
151
  this.addApplyFormMenu = page.getByRole("menuitem", { name: "Apply form" });
150
152
  this.configureFieldsButton = page.getByLabel(`schema-initializer-Grid-form:configureFields-${collectionName}`);
151
- this.configureActionsButton = page.getByLabel(
152
- `schema-initializer-ActionBar-ApprovalApplyAddActionButton-${collectionName}`
153
- );
153
+ this.configureActionsButton = page.getByLabel(`schema-initializer-ActionBar-ApprovalApplyAddActionButton-${collectionName}`);
154
154
  this.saveDraftSwitch = page.getByRole("menuitem", { name: "Save draft" }).getByRole("switch");
155
+ this.preloadAssociationsDropDown = page.getByTestId("select-field-Preload associations");
155
156
  this.submitButton = page.getByLabel("action-Action-Submit-workflows");
156
157
  this.cancelButton = page.getByLabel("action-Action-Cancel-workflows");
157
158
  this.addNodeButton = this.addNodeButton = page.getByLabel("add-button", { exact: true });
@@ -163,10 +164,13 @@ class ApprovalPassthroughModeNode {
163
164
  nodeTitle;
164
165
  nodeConfigure;
165
166
  addAssigneesButton;
167
+ addSelectAssigneesMenu;
168
+ addQueryAssigneesMenu;
166
169
  assigneesDropDown;
167
170
  OrRadio;
168
171
  AndRadio;
169
172
  votingRadio;
173
+ votingThresholdEditBox;
170
174
  parallellyRadio;
171
175
  sequentiallyRadio;
172
176
  goToconfigureButton;
@@ -189,18 +193,85 @@ class ApprovalPassthroughModeNode {
189
193
  this.nodeTitle = page.getByLabel(`Approval-${nodeName}`, { exact: true }).getByRole("textbox");
190
194
  this.nodeConfigure = page.getByLabel(`Approval-${nodeName}`, { exact: true }).getByRole("button", { name: "Configure" });
191
195
  this.addAssigneesButton = page.getByRole("button", { name: "plus Add assignee" });
196
+ this.addSelectAssigneesMenu = page.getByRole("button", { name: "Select assignees" });
197
+ this.addQueryAssigneesMenu = page.getByRole("button", { name: "Query assignees" });
192
198
  this.assigneesDropDown = page.getByTestId("select-single");
193
199
  this.OrRadio = page.getByLabel("Or", { exact: true });
194
200
  this.AndRadio = page.getByLabel("And", { exact: true });
195
201
  this.votingRadio = page.getByLabel("Voting", { exact: true });
202
+ this.votingThresholdEditBox = page.getByLabel("block-item-NegotiationConfig-workflows-Negotiation mode").getByRole("spinbutton");
196
203
  this.parallellyRadio = page.getByLabel("Parallelly", { exact: true });
197
204
  this.sequentiallyRadio = page.getByLabel("Sequentially", { exact: true });
198
205
  this.goToconfigureButton = page.getByRole("button", { name: "Go to configure" });
199
206
  this.addBlockButton = page.getByLabel("schema-initializer-Grid-ApprovalProcessAddBlockButton-workflows");
200
207
  this.addDetailsMenu = page.getByRole("menuitem", { name: "Details" });
201
- this.detailsConfigureFieldsButton = page.getByLabel(
202
- `schema-initializer-Grid-ReadPrettyFormItemInitializers-${collectionName}`
208
+ this.detailsConfigureFieldsButton = page.getByLabel(`schema-initializer-Grid-details:configureFields-${collectionName}`);
209
+ this.addActionsMenu = page.getByRole("menuitem", { name: "Actions" }).getByRole("switch");
210
+ this.actionsConfigureFieldsButton = page.getByLabel("schema-initializer-Grid-FormItemInitializers-approvalRecords");
211
+ this.actionsConfigureActionsButton = page.getByLabel(
212
+ "schema-initializer-ActionBar-ApprovalProcessAddActionButton-approvalRecords"
203
213
  );
214
+ this.addApproveButton = page.getByRole("menuitem", { name: "Approve" }).getByRole("switch");
215
+ this.addRejectButton = page.getByRole("menuitem", { name: "Reject" }).getByRole("switch");
216
+ this.addReturnButton = page.getByRole("menuitem", { name: "Return" }).getByRole("switch");
217
+ this.addNodeResult = page.getByRole("menuitem", { name: "Node result right" });
218
+ this.submitButton = page.getByLabel("action-Action-Submit-workflows");
219
+ this.cancelButton = page.getByLabel("action-Action-Cancel-workflows");
220
+ this.addNodeButton = page.getByLabel(`add-button-calculation-${nodeName}`, { exact: true });
221
+ }
222
+ }
223
+ class ApprovalBranchModeNode {
224
+ page;
225
+ node;
226
+ nodeTitle;
227
+ nodeConfigure;
228
+ addAssigneesButton;
229
+ addSelectAssigneesMenu;
230
+ addQueryAssigneesMenu;
231
+ assigneesDropDown;
232
+ OrRadio;
233
+ AndRadio;
234
+ votingRadio;
235
+ votingThresholdEditBox;
236
+ parallellyRadio;
237
+ sequentiallyRadio;
238
+ goToconfigureButton;
239
+ addBlockButton;
240
+ addDetailsMenu;
241
+ detailsConfigureFieldsButton;
242
+ addActionsMenu;
243
+ actionsConfigureFieldsButton;
244
+ actionsConfigureActionsButton;
245
+ addApproveButton;
246
+ addRejectButton;
247
+ addReturnButton;
248
+ addNodeResult;
249
+ submitButton;
250
+ cancelButton;
251
+ addNodeButton;
252
+ addReturnBranchNodeButton;
253
+ addRejectBranchNodeButton;
254
+ addApproveBranchNodeButton;
255
+ endOnRejectCheckbox;
256
+ constructor(page, nodeName, collectionName) {
257
+ this.page = page;
258
+ this.node = page.getByLabel(`Approval-${nodeName}`, { exact: true });
259
+ this.nodeTitle = page.getByLabel(`Approval-${nodeName}`, { exact: true }).getByRole("textbox");
260
+ this.nodeConfigure = page.getByLabel(`Approval-${nodeName}`, { exact: true }).getByRole("button", { name: "Configure" });
261
+ this.addAssigneesButton = page.getByRole("button", { name: "plus Add assignee" });
262
+ this.addSelectAssigneesMenu = page.getByRole("button", { name: "Select assignees" });
263
+ this.addQueryAssigneesMenu = page.getByRole("button", { name: "Query assignees" });
264
+ this.assigneesDropDown = page.getByTestId("select-single");
265
+ this.OrRadio = page.getByLabel("Or", { exact: true });
266
+ this.AndRadio = page.getByLabel("And", { exact: true });
267
+ this.votingRadio = page.getByLabel("Voting", { exact: true });
268
+ this.votingThresholdEditBox = page.getByLabel("block-item-NegotiationConfig-workflows-Negotiation mode").getByRole("spinbutton");
269
+ this.parallellyRadio = page.getByLabel("Parallelly", { exact: true });
270
+ this.sequentiallyRadio = page.getByLabel("Sequentially", { exact: true });
271
+ this.goToconfigureButton = page.getByRole("button", { name: "Go to configure" });
272
+ this.addBlockButton = page.getByLabel("schema-initializer-Grid-ApprovalProcessAddBlockButton-workflows");
273
+ this.addDetailsMenu = page.getByRole("menuitem", { name: "Details" });
274
+ this.detailsConfigureFieldsButton = page.getByLabel(`schema-initializer-Grid-details:configureFields-${collectionName}`);
204
275
  this.addActionsMenu = page.getByRole("menuitem", { name: "Actions" }).getByRole("switch");
205
276
  this.actionsConfigureFieldsButton = page.getByLabel("schema-initializer-Grid-FormItemInitializers-approvalRecords");
206
277
  this.actionsConfigureActionsButton = page.getByLabel(
@@ -213,6 +284,10 @@ class ApprovalPassthroughModeNode {
213
284
  this.submitButton = page.getByLabel("action-Action-Submit-workflows");
214
285
  this.cancelButton = page.getByLabel("action-Action-Cancel-workflows");
215
286
  this.addNodeButton = page.getByLabel(`add-button-calculation-${nodeName}`, { exact: true });
287
+ this.addReturnBranchNodeButton = page.getByLabel(`add-button-approval-${nodeName}-1`);
288
+ this.addApproveBranchNodeButton = page.getByLabel(`add-button-approval-${nodeName}-2`);
289
+ this.addRejectBranchNodeButton = page.getByLabel(`add-button-approval-${nodeName}--1`);
290
+ this.endOnRejectCheckbox = page.getByLabel("End the workflow after");
216
291
  }
217
292
  }
218
293
  class ScheduleTriggerNode {
@@ -612,11 +687,13 @@ var e2ePageObjectModel_default = module.exports = {
612
687
  ConditionYesNode,
613
688
  ConditionBranchNode,
614
689
  SQLNode,
615
- ParallelBranchNode
690
+ ParallelBranchNode,
691
+ ApprovalBranchModeNode
616
692
  };
617
693
  // Annotate the CommonJS export names for ESM import in node:
618
694
  0 && (module.exports = {
619
695
  AggregateNode,
696
+ ApprovalBranchModeNode,
620
697
  ApprovalPassthroughModeNode,
621
698
  ApprovalTriggerNode,
622
699
  CalculationNode,
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { Page } from '@nocobase/test/e2e';
9
+ import { Browser } from '@nocobase/test/e2e';
10
10
  export declare const apiCreateWorkflow: (data: any) => Promise<any>;
11
11
  export declare const apiUpdateWorkflow: (id: number, data: any) => Promise<any>;
12
12
  export declare const apiDeleteWorkflow: (id: number) => Promise<any>;
@@ -25,7 +25,8 @@ export declare const apiSubmitRecordTriggerFormEvent: (triggerWorkflows: string,
25
25
  export declare const apiGetDataSourceCount: () => Promise<any>;
26
26
  export declare const apiCreateRecordTriggerActionEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
27
27
  export declare const apiApplyApprovalEvent: (data: any) => Promise<any>;
28
- export declare const userLogin: (page: Page, approvalUserEmail: string, approvalUser: string) => Promise<Page>;
28
+ export declare const apiCreateField: (collectionName: string, data: any) => Promise<any>;
29
+ export declare const userLogin: (browser: Browser, approvalUserEmail: string, approvalUser: string) => Promise<import("playwright-core").BrowserContext>;
29
30
  declare const _default: {
30
31
  apiCreateWorkflow: (data: any) => Promise<any>;
31
32
  apiUpdateWorkflow: (id: number, data: any) => Promise<any>;
@@ -45,6 +46,7 @@ declare const _default: {
45
46
  apiGetDataSourceCount: () => Promise<any>;
46
47
  apiCreateRecordTriggerActionEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
47
48
  apiApplyApprovalEvent: (data: any) => Promise<any>;
48
- userLogin: (page: Page, approvalUserEmail: string, approvalUser: string) => Promise<Page>;
49
+ userLogin: (browser: Browser, approvalUserEmail: string, approvalUser: string) => Promise<import("playwright-core").BrowserContext>;
50
+ apiCreateField: (collectionName: string, data: any) => Promise<any>;
49
51
  };
50
52
  export default _default;
@@ -27,6 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  var e2eUtils_exports = {};
28
28
  __export(e2eUtils_exports, {
29
29
  apiApplyApprovalEvent: () => apiApplyApprovalEvent,
30
+ apiCreateField: () => apiCreateField,
30
31
  apiCreateRecordTriggerActionEvent: () => apiCreateRecordTriggerActionEvent,
31
32
  apiCreateRecordTriggerFormEvent: () => apiCreateRecordTriggerFormEvent,
32
33
  apiCreateWorkflow: () => apiCreateWorkflow,
@@ -314,6 +315,21 @@ const apiApplyApprovalEvent = async (data) => {
314
315
  }
315
316
  return (await result.json()).data;
316
317
  };
318
+ const apiCreateField = async (collectionName, data) => {
319
+ const api = await import_e2e.request.newContext({
320
+ storageState: process.env.PLAYWRIGHT_AUTH_FILE
321
+ });
322
+ const state = await api.storageState();
323
+ const headers = getHeaders(state);
324
+ const result = await api.post(`/api/collections/${collectionName}/fields:create`, {
325
+ headers,
326
+ data
327
+ });
328
+ if (!result.ok()) {
329
+ throw new Error(await result.text());
330
+ }
331
+ return (await result.json()).data;
332
+ };
317
333
  const getStorageItem = (key, storageState) => {
318
334
  var _a, _b;
319
335
  return (_b = (_a = storageState.origins.find((item) => item.origin === APP_BASE_URL)) == null ? void 0 : _a.localStorage.find((item) => item.name === key)) == null ? void 0 : _b.value;
@@ -355,13 +371,15 @@ function getHeaders(storageState) {
355
371
  }
356
372
  return headers;
357
373
  }
358
- const userLogin = async (page, approvalUserEmail, approvalUser) => {
359
- await page.goto(`${process.env.APP_BASE_URL}/signin`);
374
+ const userLogin = async (browser, approvalUserEmail, approvalUser) => {
375
+ const context = await browser.newContext();
376
+ const page = await context.newPage();
377
+ await page.goto("signin");
360
378
  await page.getByPlaceholder("Email").fill(approvalUserEmail);
361
379
  await page.getByPlaceholder("Password").fill(approvalUser);
362
380
  await page.getByRole("button", { name: "Sign in" }).click();
363
381
  await page.waitForLoadState("networkidle");
364
- return page;
382
+ return context;
365
383
  };
366
384
  var e2eUtils_default = module.exports = {
367
385
  apiCreateWorkflow,
@@ -382,11 +400,13 @@ var e2eUtils_default = module.exports = {
382
400
  apiGetDataSourceCount,
383
401
  apiCreateRecordTriggerActionEvent,
384
402
  apiApplyApprovalEvent,
385
- userLogin
403
+ userLogin,
404
+ apiCreateField
386
405
  };
387
406
  // Annotate the CommonJS export names for ESM import in node:
388
407
  0 && (module.exports = {
389
408
  apiApplyApprovalEvent,
409
+ apiCreateField,
390
410
  apiCreateRecordTriggerActionEvent,
391
411
  apiCreateRecordTriggerFormEvent,
392
412
  apiCreateWorkflow,
@@ -8,12 +8,12 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.2.10-alpha",
12
- "@nocobase/utils": "1.2.10-alpha",
11
+ "@nocobase/client": "1.2.12-alpha",
12
+ "@nocobase/utils": "1.2.12-alpha",
13
13
  "lodash": "4.17.21",
14
- "@nocobase/test": "1.2.10-alpha",
15
- "@nocobase/server": "1.2.10-alpha",
16
- "@nocobase/resourcer": "1.2.10-alpha",
17
- "@nocobase/data-source-manager": "1.2.10-alpha",
18
- "@nocobase/database": "1.2.10-alpha"
14
+ "@nocobase/test": "1.2.12-alpha",
15
+ "@nocobase/server": "1.2.12-alpha",
16
+ "@nocobase/resourcer": "1.2.12-alpha",
17
+ "@nocobase/data-source-manager": "1.2.12-alpha",
18
+ "@nocobase/database": "1.2.12-alpha"
19
19
  };
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": "1.2.10-alpha",
5
+ "version": "1.2.12-alpha",
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": "1.x",
12
12
  "@nocobase/test": "1.x"
13
13
  },
14
- "gitHead": "378bfb33c8d124ef79074e5474c1cf2199aeb8da"
14
+ "gitHead": "553231d4882496cb7f1f17fa7541899ce82a27ab"
15
15
  }