android-midscene-automation 0.1.33 → 0.1.34
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/CHANGELOG.md +4 -0
- package/README.md +4 -0
- package/package.json +1 -1
- package/src/appium-recorder/flow-graph.ts +22 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1229,6 +1229,10 @@ Linux: ~/.local/share/android-midscene-automation
|
|
|
1229
1229
|
|
|
1230
1230
|
# 项目更新记录
|
|
1231
1231
|
|
|
1232
|
+
## v0.1.34
|
|
1233
|
+
- 修复同一分支内显式跳转被画布误画为顺序连接的问题,失效跳转目标不再错误连接到相邻节点。
|
|
1234
|
+
- 修复判断分支默认返回公共后续节点时画布漏连线、节点重叠的问题,嵌套分支显示与回放路径保持一致。
|
|
1235
|
+
|
|
1232
1236
|
## v0.1.33
|
|
1233
1237
|
- 操作菜单移除“断言存在”和“断言文本”,统一保留“判断存在”及其文本匹配配置;旧脚本中的断言节点仍兼容原有执行行为。
|
|
1234
1238
|
- “点击坐标”节点支持编辑 X、Y 坐标,保存后回放使用新坐标;默认节点名称同步更新,自定义名称保持不变。
|
package/package.json
CHANGED
|
@@ -233,6 +233,24 @@ function addUniqueLink(links: Link[], seen: Set<string>, link: Link) {
|
|
|
233
233
|
links.push(link);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
// 与回放的默认分支返回一致;循环体的虚拟回边不参与有向无环布局。
|
|
237
|
+
function continuationTargetId(items: StepItem[], step: AppiumRecordedStep, seen = new Set<string>()): string {
|
|
238
|
+
if (seen.has(step.id)) return '';
|
|
239
|
+
seen.add(step.id);
|
|
240
|
+
if (step.flow?.successTargetId) return step.flow.successTargetId;
|
|
241
|
+
if (defaultKind(step) === 'condition') {
|
|
242
|
+
const index = items.findIndex(item => item.step.id === step.id);
|
|
243
|
+
const sibling = items.slice(index + 1).find(({ step: candidate }) => (
|
|
244
|
+
candidate.flow?.parentConditionId === step.flow?.parentConditionId
|
|
245
|
+
&& candidate.flow?.parentBranch === step.flow?.parentBranch
|
|
246
|
+
));
|
|
247
|
+
if (sibling) return sibling.step.id;
|
|
248
|
+
}
|
|
249
|
+
const parent = items.find(item => item.step.id === step.flow?.parentConditionId)?.step;
|
|
250
|
+
if (!parent || (parent.type === 'loop' && step.flow?.parentBranch === 'yes')) return '';
|
|
251
|
+
return continuationTargetId(items, parent, seen);
|
|
252
|
+
}
|
|
253
|
+
|
|
236
254
|
function branchConnectionTargetId(items: StepItem[], condition: AppiumRecordedStep, branch: FlowBranch) {
|
|
237
255
|
const branchItems = directBranchItems(items, condition.id, branch);
|
|
238
256
|
if (branchItems.length) {
|
|
@@ -240,6 +258,7 @@ function branchConnectionTargetId(items: StepItem[], condition: AppiumRecordedSt
|
|
|
240
258
|
return defaultKind(last) === 'condition' ? '' : last.flow?.successTargetId || '';
|
|
241
259
|
}
|
|
242
260
|
const targetId = branch === 'yes' ? condition.flow?.yesTargetId : condition.flow?.noTargetId;
|
|
261
|
+
if (!targetId) return condition.type === 'loop' && branch === 'yes' ? '' : continuationTargetId(items, condition);
|
|
243
262
|
const target = items.find(({ step }) => step.id === targetId)?.step;
|
|
244
263
|
return target && target.flow?.parentConditionId === condition.flow?.parentConditionId ? target.id : '';
|
|
245
264
|
}
|
|
@@ -547,11 +566,8 @@ export function buildFlowGraph(
|
|
|
547
566
|
|
|
548
567
|
const targetId = item.step.flow?.successTargetId;
|
|
549
568
|
const explicitTarget = targetId ? stepById.get(targetId) : undefined;
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
? explicitTarget
|
|
553
|
-
: undefined;
|
|
554
|
-
const target = explicitMainTarget || nextSibling;
|
|
569
|
+
// 显式跳转优先于顺序关系,包括同一分支内的跳转;失效目标不能悄悄改走相邻节点。
|
|
570
|
+
const target = targetId ? explicitTarget : nextSibling || stepById.get(continuationTargetId(items, item.step));
|
|
555
571
|
const insertId = addInsertNode(
|
|
556
572
|
item.index,
|
|
557
573
|
branch,
|
|
@@ -559,10 +575,6 @@ export function buildFlowGraph(
|
|
|
559
575
|
);
|
|
560
576
|
addVisibleLink(nodeIdForStep(item.step), insertId, branch);
|
|
561
577
|
if (!target) return;
|
|
562
|
-
if (branch && explicitMainTarget) {
|
|
563
|
-
addVisibleLink(insertId, nodeIdForStep(target.step), branch);
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
578
|
addVisibleLink(insertId, nodeIdForStep(target.step), branch);
|
|
567
579
|
}
|
|
568
580
|
|
|
@@ -742,7 +754,7 @@ export function buildFlowGraph(
|
|
|
742
754
|
// 公共起点从两侧汇入,不能被最后一条分支连线拉到左列或右列。
|
|
743
755
|
const joins = new Map<string, string>();
|
|
744
756
|
items.forEach(({ step }) => {
|
|
745
|
-
const target = step
|
|
757
|
+
const target = defaultKind(step) === 'condition' && stepById.get(continuationTargetId(items, step));
|
|
746
758
|
if (defaultKind(step) === 'condition' && target && !joins.has(nodeIdForStep(target.step))) {
|
|
747
759
|
joins.set(nodeIdForStep(target.step), nodeIdForStep(step));
|
|
748
760
|
}
|