@testid/antd-testid-runtime 1.0.9 → 1.0.11
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/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +22 -9
- package/dist/index.mjs +22 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -327,8 +327,9 @@ declare class TestIdObserver {
|
|
|
327
327
|
* 决策优先级:
|
|
328
328
|
* 0. 已有 data-testid → 跳过
|
|
329
329
|
* 1. 带 data-test-base-key → 公共组件实例 (锚点定位)
|
|
330
|
-
* 2.
|
|
331
|
-
*
|
|
330
|
+
* 2. 浮层内部子节点 → 先查祖先,再查自身是否 root
|
|
331
|
+
* (避免嵌套浮层如 el-cascader-panel ∈ el-cascader__suggestion-panel 被误判为独立 root)
|
|
332
|
+
* 3. body 直系浮层根节点 → 匹配浮层类型 → 独立前缀
|
|
332
333
|
* 4. #app 内普通节点 → dynamic
|
|
333
334
|
*/
|
|
334
335
|
private processSingleNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -327,8 +327,9 @@ declare class TestIdObserver {
|
|
|
327
327
|
* 决策优先级:
|
|
328
328
|
* 0. 已有 data-testid → 跳过
|
|
329
329
|
* 1. 带 data-test-base-key → 公共组件实例 (锚点定位)
|
|
330
|
-
* 2.
|
|
331
|
-
*
|
|
330
|
+
* 2. 浮层内部子节点 → 先查祖先,再查自身是否 root
|
|
331
|
+
* (避免嵌套浮层如 el-cascader-panel ∈ el-cascader__suggestion-panel 被误判为独立 root)
|
|
332
|
+
* 3. body 直系浮层根节点 → 匹配浮层类型 → 独立前缀
|
|
332
333
|
* 4. #app 内普通节点 → dynamic
|
|
333
334
|
*/
|
|
334
335
|
private processSingleNode;
|
package/dist/index.js
CHANGED
|
@@ -144,7 +144,14 @@ function getConfig() {
|
|
|
144
144
|
var popupClassSuffixMap2 = {
|
|
145
145
|
modal: [["-dialog"]],
|
|
146
146
|
drawer: [["-drawer"]],
|
|
147
|
-
select: [
|
|
147
|
+
select: [
|
|
148
|
+
["-select-dropdown"],
|
|
149
|
+
// ElSelect 下拉面板
|
|
150
|
+
["-cascader__suggestion-panel"],
|
|
151
|
+
// ElCascader 浮层 (suggestion 模式)
|
|
152
|
+
["-cascader-panel"]
|
|
153
|
+
// ElCascader 浮层 (panel 模式 / 低版本)
|
|
154
|
+
],
|
|
148
155
|
datePicker: [
|
|
149
156
|
["-picker-panel"],
|
|
150
157
|
// 日期/时间选择器面板
|
|
@@ -158,7 +165,12 @@ var popupClassSuffixMap2 = {
|
|
|
158
165
|
// Element Popconfirm
|
|
159
166
|
],
|
|
160
167
|
dropdown: [["-dropdown-menu"]],
|
|
161
|
-
tooltip: [
|
|
168
|
+
tooltip: [
|
|
169
|
+
["-tooltip__popper"],
|
|
170
|
+
// Element Tooltip 浮层
|
|
171
|
+
["-popover"]
|
|
172
|
+
// Element Popover 浮层 (语义上接近 tooltip)
|
|
173
|
+
],
|
|
162
174
|
message: [["-message"]]
|
|
163
175
|
};
|
|
164
176
|
var elementAdapter = {
|
|
@@ -400,8 +412,9 @@ var TestIdObserver = class {
|
|
|
400
412
|
* 决策优先级:
|
|
401
413
|
* 0. 已有 data-testid → 跳过
|
|
402
414
|
* 1. 带 data-test-base-key → 公共组件实例 (锚点定位)
|
|
403
|
-
* 2.
|
|
404
|
-
*
|
|
415
|
+
* 2. 浮层内部子节点 → 先查祖先,再查自身是否 root
|
|
416
|
+
* (避免嵌套浮层如 el-cascader-panel ∈ el-cascader__suggestion-panel 被误判为独立 root)
|
|
417
|
+
* 3. body 直系浮层根节点 → 匹配浮层类型 → 独立前缀
|
|
405
418
|
* 4. #app 内普通节点 → dynamic
|
|
406
419
|
*/
|
|
407
420
|
processSingleNode(node) {
|
|
@@ -413,16 +426,16 @@ var TestIdObserver = class {
|
|
|
413
426
|
this.handleBaseKeyNode(node, baseKey, config);
|
|
414
427
|
return;
|
|
415
428
|
}
|
|
416
|
-
const popupType = this.detectPopupType(node);
|
|
417
|
-
if (popupType) {
|
|
418
|
-
this.handlePopupNode(node, popupType);
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
429
|
const popupAncestor = this.detectPopupAncestor(node);
|
|
422
430
|
if (popupAncestor) {
|
|
423
431
|
this.handlePopupChildNode(node, popupAncestor.type, popupAncestor.element, config);
|
|
424
432
|
return;
|
|
425
433
|
}
|
|
434
|
+
const popupType = this.detectPopupType(node);
|
|
435
|
+
if (popupType) {
|
|
436
|
+
this.handlePopupNode(node, popupType);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
426
439
|
if (this.isInsideApp(node)) {
|
|
427
440
|
this.handleDynamicNode(node, config);
|
|
428
441
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -101,7 +101,14 @@ function getConfig() {
|
|
|
101
101
|
var popupClassSuffixMap2 = {
|
|
102
102
|
modal: [["-dialog"]],
|
|
103
103
|
drawer: [["-drawer"]],
|
|
104
|
-
select: [
|
|
104
|
+
select: [
|
|
105
|
+
["-select-dropdown"],
|
|
106
|
+
// ElSelect 下拉面板
|
|
107
|
+
["-cascader__suggestion-panel"],
|
|
108
|
+
// ElCascader 浮层 (suggestion 模式)
|
|
109
|
+
["-cascader-panel"]
|
|
110
|
+
// ElCascader 浮层 (panel 模式 / 低版本)
|
|
111
|
+
],
|
|
105
112
|
datePicker: [
|
|
106
113
|
["-picker-panel"],
|
|
107
114
|
// 日期/时间选择器面板
|
|
@@ -115,7 +122,12 @@ var popupClassSuffixMap2 = {
|
|
|
115
122
|
// Element Popconfirm
|
|
116
123
|
],
|
|
117
124
|
dropdown: [["-dropdown-menu"]],
|
|
118
|
-
tooltip: [
|
|
125
|
+
tooltip: [
|
|
126
|
+
["-tooltip__popper"],
|
|
127
|
+
// Element Tooltip 浮层
|
|
128
|
+
["-popover"]
|
|
129
|
+
// Element Popover 浮层 (语义上接近 tooltip)
|
|
130
|
+
],
|
|
119
131
|
message: [["-message"]]
|
|
120
132
|
};
|
|
121
133
|
var elementAdapter = {
|
|
@@ -357,8 +369,9 @@ var TestIdObserver = class {
|
|
|
357
369
|
* 决策优先级:
|
|
358
370
|
* 0. 已有 data-testid → 跳过
|
|
359
371
|
* 1. 带 data-test-base-key → 公共组件实例 (锚点定位)
|
|
360
|
-
* 2.
|
|
361
|
-
*
|
|
372
|
+
* 2. 浮层内部子节点 → 先查祖先,再查自身是否 root
|
|
373
|
+
* (避免嵌套浮层如 el-cascader-panel ∈ el-cascader__suggestion-panel 被误判为独立 root)
|
|
374
|
+
* 3. body 直系浮层根节点 → 匹配浮层类型 → 独立前缀
|
|
362
375
|
* 4. #app 内普通节点 → dynamic
|
|
363
376
|
*/
|
|
364
377
|
processSingleNode(node) {
|
|
@@ -370,16 +383,16 @@ var TestIdObserver = class {
|
|
|
370
383
|
this.handleBaseKeyNode(node, baseKey, config);
|
|
371
384
|
return;
|
|
372
385
|
}
|
|
373
|
-
const popupType = this.detectPopupType(node);
|
|
374
|
-
if (popupType) {
|
|
375
|
-
this.handlePopupNode(node, popupType);
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
386
|
const popupAncestor = this.detectPopupAncestor(node);
|
|
379
387
|
if (popupAncestor) {
|
|
380
388
|
this.handlePopupChildNode(node, popupAncestor.type, popupAncestor.element, config);
|
|
381
389
|
return;
|
|
382
390
|
}
|
|
391
|
+
const popupType = this.detectPopupType(node);
|
|
392
|
+
if (popupType) {
|
|
393
|
+
this.handlePopupNode(node, popupType);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
383
396
|
if (this.isInsideApp(node)) {
|
|
384
397
|
this.handleDynamicNode(node, config);
|
|
385
398
|
}
|