android-midscene-automation 0.1.13 → 0.1.14

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.
@@ -66,6 +66,7 @@ export type AppiumRecordedStep = {
66
66
  | 'pinch'
67
67
  | 'runScript';
68
68
  label: string;
69
+ note?: string;
69
70
  selector?: AppiumSelector;
70
71
  contextSelector?: AppiumSelector;
71
72
  selectorChain?: AppiumSelector[];
@@ -82,6 +83,7 @@ export type AppiumRecordedStep = {
82
83
  parentBranch?: 'yes' | 'no';
83
84
  successTargetId?: string;
84
85
  failureTargetId?: string;
86
+ textMatch?: 'contains' | 'exact';
85
87
  collapsed?: boolean;
86
88
  };
87
89
  pageBefore?: AppiumPageSnapshot;
@@ -84,6 +84,34 @@ const updateMidsceneProvider = (value: string) => {
84
84
  <template>
85
85
  <div class="config-page">
86
86
  <section class="config-grid">
87
+ <el-card shadow="never" class="config-module-card">
88
+ <template #header>
89
+ <div class="panel-header">
90
+ <span>运行配置</span>
91
+ <el-button type="primary" :loading="isSavingModelConfig" @click="$emit('saveModelConfig')">
92
+ 保存运行配置
93
+ </el-button>
94
+ </div>
95
+ </template>
96
+
97
+ <el-form label-position="top">
98
+ <el-form-item label="Android SDK 路径">
99
+ <el-input
100
+ v-model="configForm.runtime.androidSdkPath"
101
+ clearable
102
+ placeholder="留空时读取 ANDROID_SDK_ROOT、ANDROID_HOME 或系统默认路径"
103
+ />
104
+ </el-form-item>
105
+ <el-form-item label="回放报告目录">
106
+ <el-input
107
+ v-model="configForm.runtime.reportOutputPath"
108
+ clearable
109
+ placeholder="留空时保存到启动目录下的 output"
110
+ />
111
+ </el-form-item>
112
+ </el-form>
113
+ </el-card>
114
+
87
115
  <el-card shadow="never" class="config-module-card">
88
116
  <template #header>
89
117
  <div class="panel-header">
package/src/style.css CHANGED
@@ -192,7 +192,7 @@ select {
192
192
  .appium-recorder-layout {
193
193
  display: grid;
194
194
  flex: 1 1 auto;
195
- grid-template-columns: minmax(0, 4fr) minmax(320px, 3fr) minmax(0, 3fr);
195
+ grid-template-columns: minmax(0, 3fr) minmax(320px, 3fr) minmax(0, 4fr);
196
196
  gap: 12px;
197
197
  align-items: stretch;
198
198
  height: auto;
@@ -354,7 +354,7 @@ select {
354
354
  .appium-current-activity {
355
355
  display: grid;
356
356
  grid-template-columns: auto minmax(0, 1fr);
357
- align-items: center;
357
+ align-items: start;
358
358
  gap: 12px;
359
359
  padding: 12px 0 0;
360
360
  border-top: 1px solid #e4e7ed;
@@ -363,11 +363,15 @@ select {
363
363
  }
364
364
 
365
365
  .appium-current-activity code {
366
+ display: -webkit-box;
366
367
  overflow: hidden;
367
368
  color: #303133;
368
369
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
369
- text-overflow: ellipsis;
370
- white-space: nowrap;
370
+ line-height: 1.45;
371
+ overflow-wrap: anywhere;
372
+ white-space: normal;
373
+ -webkit-box-orient: vertical;
374
+ -webkit-line-clamp: 3;
371
375
  }
372
376
 
373
377
  .appium-node-detail__title {
@@ -390,6 +394,16 @@ select {
390
394
  padding: 16px;
391
395
  }
392
396
 
397
+ .appium-script-list__toolbar {
398
+ display: flex;
399
+ justify-content: flex-end;
400
+ align-items: center;
401
+ }
402
+
403
+ .appium-script-list__file-input {
404
+ display: none;
405
+ }
406
+
393
407
  .appium-script-list__item {
394
408
  display: grid;
395
409
  grid-template-columns: minmax(0, 1fr) auto;
@@ -676,6 +690,8 @@ select {
676
690
  }
677
691
 
678
692
  .appium-flow-content {
693
+ --appium-flow-line-width: 3px;
694
+ --appium-flow-line-color: #dbe5f1;
679
695
  display: grid;
680
696
  gap: 8px;
681
697
  align-content: start;
@@ -699,13 +715,19 @@ select {
699
715
  background:
700
716
  radial-gradient(circle at 1px 1px, #e7edf6 1px, transparent 0) 0 0 / 18px 18px,
701
717
  #fff;
718
+ cursor: grab;
719
+ touch-action: none;
720
+ user-select: none;
721
+ }
722
+
723
+ .appium-flow-dialog-canvas--dragging {
724
+ cursor: grabbing;
702
725
  }
703
726
 
704
727
  .appium-flow-content--overview {
705
728
  width: min(980px, 100%);
706
729
  margin: 0 auto;
707
- transform: none;
708
- user-select: text;
730
+ transform-origin: 0 0;
709
731
  }
710
732
 
711
733
  .appium-flow-content .el-empty {
@@ -713,10 +735,11 @@ select {
713
735
  }
714
736
 
715
737
  .appium-flow-item {
738
+ --flow-axis: 50%;
716
739
  position: relative;
717
740
  display: grid;
718
741
  gap: 6px;
719
- justify-items: stretch;
742
+ justify-items: center;
720
743
  min-width: 0;
721
744
  }
722
745
 
@@ -724,19 +747,33 @@ select {
724
747
  position: relative;
725
748
  z-index: 1;
726
749
  display: grid;
727
- justify-items: start;
750
+ justify-items: center;
728
751
  gap: 6px;
729
752
  }
730
753
 
731
- .appium-flow-start--has-next::after {
732
- content: "";
754
+ .appium-flow-line {
733
755
  position: absolute;
734
756
  z-index: 0;
757
+ width: 10px;
758
+ overflow: visible;
759
+ pointer-events: none;
760
+ }
761
+
762
+ .appium-flow-line path {
763
+ fill: none;
764
+ stroke: var(--appium-flow-line-color);
765
+ stroke-width: var(--appium-flow-line-width);
766
+ stroke-linecap: round;
767
+ stroke-linejoin: round;
768
+ vector-effect: non-scaling-stroke;
769
+ }
770
+
771
+ .appium-flow-start__line {
735
772
  top: 30px;
736
773
  bottom: -8px;
737
- left: 19px;
738
- width: 2px;
739
- background: #dbe5f1;
774
+ left: 50%;
775
+ height: calc(100% - 22px);
776
+ transform: translateX(-50%);
740
777
  }
741
778
 
742
779
  .appium-flow-start__node {
@@ -765,22 +802,18 @@ select {
765
802
  padding-bottom: 2px;
766
803
  }
767
804
 
768
- .appium-flow-start--overview::after {
805
+ .appium-flow-start--overview .appium-flow-start__line {
769
806
  bottom: -10px;
807
+ height: calc(100% - 20px);
770
808
  }
771
809
 
772
- .appium-flow-item:not(:last-child)::after {
773
- content: "";
810
+ .appium-flow-item__line {
774
811
  position: absolute;
775
- left: 19px;
812
+ left: var(--flow-axis);
776
813
  top: 40px;
777
814
  bottom: -8px;
778
- width: 2px;
779
- background: #dbe5f1;
780
- }
781
-
782
- .appium-flow-item--condition:not(:last-child)::after {
783
- display: none;
815
+ height: calc(100% - 32px);
816
+ transform: translateX(-50%);
784
817
  }
785
818
 
786
819
  .appium-flow-node {
@@ -816,10 +849,12 @@ select {
816
849
  cursor: pointer;
817
850
  }
818
851
 
819
- .appium-flow-item:not(.appium-flow-item--condition) > .appium-flow-node,
820
- .appium-flow-item:not(.appium-flow-item--condition) > .appium-flow-editor {
852
+ .appium-flow-item > .appium-flow-node,
853
+ .appium-flow-item > .appium-flow-editor {
821
854
  box-sizing: border-box;
822
855
  width: min(440px, 100%);
856
+ justify-self: center;
857
+ left: calc(var(--flow-axis) - 50%);
823
858
  }
824
859
 
825
860
  .appium-flow-node--condition {
@@ -871,6 +906,15 @@ select {
871
906
  overflow-wrap: anywhere;
872
907
  }
873
908
 
909
+ .appium-flow-node__note {
910
+ min-width: 0;
911
+ color: #303133;
912
+ font-size: 11px;
913
+ line-height: 1.4;
914
+ overflow-wrap: anywhere;
915
+ white-space: normal;
916
+ }
917
+
874
918
  .appium-flow-node__actions {
875
919
  display: inline-flex;
876
920
  gap: 2px;
@@ -888,12 +932,24 @@ select {
888
932
  z-index: 1;
889
933
  display: grid;
890
934
  grid-template-columns: repeat(2, minmax(300px, 1fr));
891
- gap: 56px;
892
- margin-left: 24px;
893
- margin-right: 24px;
935
+ gap: 0;
936
+ margin-left: 0;
937
+ margin-right: 0;
894
938
  padding-top: 30px;
895
939
  }
896
940
 
941
+ .appium-flow-item--condition > .appium-flow-editor {
942
+ order: 1;
943
+ box-sizing: border-box;
944
+ width: min(440px, 100%);
945
+ justify-self: center;
946
+ }
947
+
948
+ .appium-flow-item--condition > .appium-flow-branches {
949
+ order: 2;
950
+ justify-self: stretch;
951
+ }
952
+
897
953
  .appium-flow-branch-lines {
898
954
  position: absolute;
899
955
  top: -6px;
@@ -904,10 +960,11 @@ select {
904
960
  pointer-events: none;
905
961
  }
906
962
 
907
- .appium-flow-branch-lines path {
963
+ .appium-flow-branch-lines path,
964
+ .appium-flow-merge path {
908
965
  fill: none;
909
- stroke: #e6a23c;
910
- stroke-width: 2;
966
+ stroke: var(--appium-flow-line-color);
967
+ stroke-width: var(--appium-flow-line-width);
911
968
  stroke-linecap: round;
912
969
  stroke-linejoin: round;
913
970
  vector-effect: non-scaling-stroke;
@@ -917,23 +974,23 @@ select {
917
974
  position: relative;
918
975
  display: grid;
919
976
  gap: 10px;
977
+ align-self: start;
920
978
  align-content: start;
979
+ justify-self: center;
980
+ box-sizing: border-box;
981
+ width: calc(100% - 32px);
921
982
  min-width: 0;
922
983
  padding: 0;
923
984
  color: #64748b;
924
985
  font-size: 11px;
925
986
  }
926
987
 
927
- .appium-flow-branch::before {
928
- content: "";
929
- position: absolute;
930
- z-index: 0;
988
+ .appium-flow-branch__line {
931
989
  top: 18px;
932
990
  bottom: 12px;
933
991
  left: 50%;
934
- width: 2px;
992
+ height: calc(100% - 30px);
935
993
  transform: translateX(-50%);
936
- background: #d8e0ea;
937
994
  }
938
995
 
939
996
  .appium-flow-branch__label {
@@ -979,62 +1036,28 @@ select {
979
1036
  min-width: 0;
980
1037
  }
981
1038
 
1039
+ .appium-flow-branch-step-group {
1040
+ display: grid;
1041
+ gap: 6px;
1042
+ width: 100%;
1043
+ min-width: 0;
1044
+ }
1045
+
982
1046
  .appium-flow-branch-step {
983
1047
  position: relative;
984
1048
  z-index: 1;
985
1049
  display: grid;
986
- grid-template-columns: 20px minmax(0, 1fr) auto;
987
- gap: 5px;
1050
+ grid-template-columns: minmax(0, 1fr) auto;
1051
+ gap: 6px;
988
1052
  align-items: center;
1053
+ width: 100%;
989
1054
  min-width: 0;
990
- padding: 5px 6px;
1055
+ padding: 6px 8px;
991
1056
  border: 1px solid #d8e0ea;
992
1057
  border-radius: 8px;
993
1058
  background: #fff;
994
1059
  }
995
1060
 
996
- .appium-flow-branch-step__delete.el-button {
997
- width: 22px;
998
- height: 22px;
999
- margin: 0;
1000
- padding: 0;
1001
- }
1002
-
1003
- .appium-flow-branch-step__index {
1004
- display: grid;
1005
- place-items: center;
1006
- width: 19px;
1007
- height: 19px;
1008
- border-radius: 50%;
1009
- background: #eef2ff;
1010
- color: #475569;
1011
- font-size: 10px;
1012
- font-weight: 700;
1013
- }
1014
-
1015
- .appium-flow-branch-step__body {
1016
- display: grid;
1017
- gap: 1px;
1018
- min-width: 0;
1019
- }
1020
-
1021
- .appium-flow-branch-step__title {
1022
- min-width: 0;
1023
- color: #303133;
1024
- font-size: 11px;
1025
- font-weight: 700;
1026
- line-height: 1.35;
1027
- overflow-wrap: anywhere;
1028
- }
1029
-
1030
- .appium-flow-branch-step__meta {
1031
- min-width: 0;
1032
- color: #64748b;
1033
- font-size: 10px;
1034
- line-height: 1.3;
1035
- overflow-wrap: anywhere;
1036
- }
1037
-
1038
1061
  .appium-flow-branch__insert {
1039
1062
  position: relative;
1040
1063
  z-index: 1;
@@ -1046,10 +1069,20 @@ select {
1046
1069
  font-size: 12px;
1047
1070
  }
1048
1071
 
1049
- .appium-flow-branch > .el-dropdown {
1072
+ .appium-flow-branch__actions {
1050
1073
  position: relative;
1051
1074
  z-index: 1;
1075
+ display: flex;
1076
+ flex-wrap: wrap;
1077
+ gap: 6px;
1052
1078
  justify-self: center;
1079
+ justify-content: center;
1080
+ }
1081
+
1082
+ .appium-flow-branch__connect {
1083
+ height: 24px;
1084
+ padding: 0 8px;
1085
+ font-size: 12px;
1053
1086
  }
1054
1087
 
1055
1088
  .appium-flow-branch--yes .appium-flow-branch__label {
@@ -1068,12 +1101,43 @@ select {
1068
1101
  background: transparent;
1069
1102
  }
1070
1103
 
1071
- .appium-flow-branch--yes::before {
1072
- background: #b3e19d;
1104
+ .appium-flow-branch--connected .appium-flow-branch__line {
1105
+ bottom: -1px;
1106
+ height: calc(100% - 17px);
1073
1107
  }
1074
1108
 
1075
- .appium-flow-branch--no::before {
1076
- background: #fab6b6;
1109
+ .appium-flow-branch--connected {
1110
+ align-self: stretch;
1111
+ }
1112
+
1113
+ .appium-flow-merge {
1114
+ order: 3;
1115
+ position: relative;
1116
+ z-index: 0;
1117
+ justify-self: stretch;
1118
+ height: 36px;
1119
+ margin: -6px 0 0;
1120
+ pointer-events: none;
1121
+ }
1122
+
1123
+ .appium-flow-merge svg {
1124
+ position: absolute;
1125
+ inset: 0 0 -8px;
1126
+ width: 100%;
1127
+ height: calc(100% + 8px);
1128
+ overflow: visible;
1129
+ }
1130
+
1131
+ .appium-flow-merge path {
1132
+ stroke: var(--appium-flow-line-color);
1133
+ }
1134
+
1135
+ .appium-flow-merge__yes {
1136
+ stroke: var(--appium-flow-line-color);
1137
+ }
1138
+
1139
+ .appium-flow-merge__no {
1140
+ stroke: var(--appium-flow-line-color);
1077
1141
  }
1078
1142
 
1079
1143
  .appium-flow-branch--yes .appium-flow-branch-step {
@@ -1110,11 +1174,11 @@ select {
1110
1174
  .appium-flow-insert {
1111
1175
  position: relative;
1112
1176
  z-index: 1;
1113
- justify-self: start;
1177
+ justify-self: center;
1114
1178
  display: inline-flex;
1115
1179
  align-items: center;
1116
1180
  gap: 4px;
1117
- margin-left: 38px;
1181
+ margin-left: 0;
1118
1182
  padding: 3px 8px;
1119
1183
  border: 1px dashed #d6dde8;
1120
1184
  border-radius: 999px;
@@ -1139,6 +1203,15 @@ select {
1139
1203
  margin-left: 0;
1140
1204
  }
1141
1205
 
1206
+ .appium-flow-start > .el-dropdown,
1207
+ .appium-flow-item > .el-dropdown {
1208
+ position: relative;
1209
+ width: fit-content;
1210
+ justify-self: center;
1211
+ left: calc(var(--flow-axis, 50%) - 50%);
1212
+ transform: translateX(calc(50% + 8px));
1213
+ }
1214
+
1142
1215
  .appium-linked-script-select {
1143
1216
  width: 100%;
1144
1217
  }
package/src/types.ts CHANGED
@@ -11,6 +11,10 @@ export type GeneratorForm = {
11
11
  };
12
12
 
13
13
  export type ConfigForm = {
14
+ runtime: {
15
+ androidSdkPath: string;
16
+ reportOutputPath: string;
17
+ };
14
18
  midscene: {
15
19
  model: {
16
20
  provider: MidsceneModelProvider;