@appium/universal-xml-plugin 1.0.15 → 1.0.17
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/README.md +39 -13
- package/build/lib/attr-map.d.ts +18 -18
- package/build/lib/node-map.d.ts +63 -63
- package/build/lib/source.d.ts +2 -2
- package/build/lib/source.d.ts.map +1 -1
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -1,27 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @appium/universal-xml-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Appium plugin for transforming platform-specific XML into a universal syntax
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://npmjs.org/package/@appium/universal-xml-plugin)
|
|
6
|
+
[](https://npmjs.org/package/@appium/universal-xml-plugin)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
This plugin takes the XML page source retrieved using an iOS or Android driver, and changes various
|
|
9
|
+
node and attribute names to use common terminology that can apply to both platforms. This is
|
|
10
|
+
achieved by altering the behavior of the `getPageSource` and `findElement` methods.
|
|
8
11
|
|
|
9
|
-
##
|
|
12
|
+
## Motivation
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Having compatibility between iOS and Android XML sources can simplify creation of cross-platform tests.
|
|
12
15
|
|
|
13
|
-
## Installation
|
|
16
|
+
## Installation
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
```
|
|
19
|
+
appium plugin install universal-xml
|
|
20
|
+
```
|
|
18
21
|
|
|
19
|
-
The plugin
|
|
22
|
+
The plugin must be explicitly activated when launching the Appium server:
|
|
20
23
|
|
|
21
24
|
```
|
|
22
25
|
appium --use-plugins=universal-xml
|
|
23
26
|
```
|
|
24
27
|
|
|
25
|
-
##
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Node names
|
|
31
|
+
|iOS|Android|Transformed|
|
|
32
|
+
|-|-|-|
|
|
33
|
+
|`XCUIElementTypeButton`|`android.widget.Button`|`Button`|
|
|
34
|
+
|`XCUIElementTypeAlert`|`android.widget.Toast`|`Alert`|
|
|
35
|
+
|`XCUIElementTypeSwitch`|`android.widget.Switch`|`SwitchInput`|
|
|
36
|
+
|
|
37
|
+
See [the mapping file](./lib/node-map.js) for a full list of node name translations. Any names not
|
|
38
|
+
specified are left as-is.
|
|
39
|
+
|
|
40
|
+
### Attribute names
|
|
41
|
+
|iOS|Android|Transformed|
|
|
42
|
+
|-|-|-|
|
|
43
|
+
|`name`|`content-desc`|`axId`|
|
|
44
|
+
|`label`|`text`|`text`|
|
|
45
|
+
|`visible`|`displayed`|`visible`|
|
|
46
|
+
|
|
47
|
+
Note that this plugin also removes a few attributes from the transformed XML. See
|
|
48
|
+
[the mapping file](./lib/attr-map.js) for a full list of attribute name translations and removed
|
|
49
|
+
attributes. Any names not specified are left as-is.
|
|
50
|
+
|
|
51
|
+
## License
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
Apache-2.0
|
package/build/lib/attr-map.d.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
export namespace ATTR_MAP {
|
|
2
2
|
namespace x {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
let ios: string;
|
|
4
|
+
let android: string;
|
|
5
5
|
}
|
|
6
6
|
namespace y {
|
|
7
|
-
|
|
7
|
+
let ios_1: string;
|
|
8
8
|
export { ios_1 as ios };
|
|
9
|
-
|
|
9
|
+
let android_1: string;
|
|
10
10
|
export { android_1 as android };
|
|
11
11
|
}
|
|
12
12
|
namespace width {
|
|
13
|
-
|
|
13
|
+
let ios_2: string;
|
|
14
14
|
export { ios_2 as ios };
|
|
15
|
-
|
|
15
|
+
let android_2: string;
|
|
16
16
|
export { android_2 as android };
|
|
17
17
|
}
|
|
18
18
|
namespace height {
|
|
19
|
-
|
|
19
|
+
let ios_3: string;
|
|
20
20
|
export { ios_3 as ios };
|
|
21
|
-
|
|
21
|
+
let android_3: string;
|
|
22
22
|
export { android_3 as android };
|
|
23
23
|
}
|
|
24
24
|
namespace enabled {
|
|
25
|
-
|
|
25
|
+
let ios_4: string;
|
|
26
26
|
export { ios_4 as ios };
|
|
27
|
-
|
|
27
|
+
let android_4: string;
|
|
28
28
|
export { android_4 as android };
|
|
29
29
|
}
|
|
30
30
|
namespace axId {
|
|
31
|
-
|
|
31
|
+
let ios_5: string;
|
|
32
32
|
export { ios_5 as ios };
|
|
33
|
-
|
|
33
|
+
let android_5: string;
|
|
34
34
|
export { android_5 as android };
|
|
35
35
|
}
|
|
36
36
|
namespace id {
|
|
37
|
-
|
|
37
|
+
let android_6: string;
|
|
38
38
|
export { android_6 as android };
|
|
39
39
|
}
|
|
40
40
|
namespace text {
|
|
41
|
-
|
|
41
|
+
let ios_6: string;
|
|
42
42
|
export { ios_6 as ios };
|
|
43
|
-
|
|
43
|
+
let android_7: string;
|
|
44
44
|
export { android_7 as android };
|
|
45
45
|
}
|
|
46
46
|
namespace visible {
|
|
47
|
-
|
|
47
|
+
let ios_7: string;
|
|
48
48
|
export { ios_7 as ios };
|
|
49
|
-
|
|
49
|
+
let android_8: string;
|
|
50
50
|
export { android_8 as android };
|
|
51
51
|
}
|
|
52
52
|
namespace value {
|
|
53
|
-
|
|
53
|
+
let ios_8: string;
|
|
54
54
|
export { ios_8 as ios };
|
|
55
55
|
}
|
|
56
56
|
}
|
package/build/lib/node-map.d.ts
CHANGED
|
@@ -1,198 +1,198 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
2
|
namespace Alert {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
let ios: string;
|
|
4
|
+
let android: string;
|
|
5
5
|
}
|
|
6
6
|
namespace App {
|
|
7
|
-
|
|
7
|
+
let ios_1: string;
|
|
8
8
|
export { ios_1 as ios };
|
|
9
9
|
}
|
|
10
10
|
namespace Button {
|
|
11
|
-
|
|
11
|
+
let ios_2: string[];
|
|
12
12
|
export { ios_2 as ios };
|
|
13
|
-
|
|
13
|
+
let android_1: string[];
|
|
14
14
|
export { android_1 as android };
|
|
15
15
|
}
|
|
16
16
|
namespace Cell {
|
|
17
|
-
|
|
17
|
+
let ios_3: string;
|
|
18
18
|
export { ios_3 as ios };
|
|
19
19
|
}
|
|
20
20
|
namespace CheckBox {
|
|
21
|
-
|
|
21
|
+
let ios_4: string;
|
|
22
22
|
export { ios_4 as ios };
|
|
23
|
-
|
|
23
|
+
let android_2: string;
|
|
24
24
|
export { android_2 as android };
|
|
25
25
|
}
|
|
26
26
|
namespace Column {
|
|
27
|
-
|
|
27
|
+
let ios_5: string;
|
|
28
28
|
export { ios_5 as ios };
|
|
29
29
|
}
|
|
30
30
|
namespace DateInput {
|
|
31
|
-
|
|
31
|
+
let ios_6: string;
|
|
32
32
|
export { ios_6 as ios };
|
|
33
|
-
|
|
33
|
+
let android_3: string;
|
|
34
34
|
export { android_3 as android };
|
|
35
35
|
}
|
|
36
36
|
namespace Element {
|
|
37
|
-
|
|
37
|
+
let ios_7: string[];
|
|
38
38
|
export { ios_7 as ios };
|
|
39
|
-
|
|
39
|
+
let android_4: string[];
|
|
40
40
|
export { android_4 as android };
|
|
41
41
|
}
|
|
42
42
|
namespace Grid {
|
|
43
|
-
|
|
43
|
+
let ios_8: string;
|
|
44
44
|
export { ios_8 as ios };
|
|
45
|
-
|
|
45
|
+
let android_5: string[];
|
|
46
46
|
export { android_5 as android };
|
|
47
47
|
}
|
|
48
48
|
namespace Icon {
|
|
49
|
-
|
|
49
|
+
let ios_9: string[];
|
|
50
50
|
export { ios_9 as ios };
|
|
51
51
|
}
|
|
52
52
|
namespace Image {
|
|
53
|
-
|
|
53
|
+
let ios_10: string;
|
|
54
54
|
export { ios_10 as ios };
|
|
55
|
-
|
|
55
|
+
let android_6: string;
|
|
56
56
|
export { android_6 as android };
|
|
57
57
|
}
|
|
58
58
|
namespace Indicator {
|
|
59
|
-
|
|
59
|
+
let ios_11: string[];
|
|
60
60
|
export { ios_11 as ios };
|
|
61
|
-
|
|
61
|
+
let android_7: string[];
|
|
62
62
|
export { android_7 as android };
|
|
63
63
|
}
|
|
64
64
|
namespace Input {
|
|
65
|
-
|
|
65
|
+
let ios_12: string[];
|
|
66
66
|
export { ios_12 as ios };
|
|
67
|
-
|
|
67
|
+
let android_8: never[];
|
|
68
68
|
export { android_8 as android };
|
|
69
69
|
}
|
|
70
70
|
namespace List {
|
|
71
|
-
|
|
71
|
+
let android_9: string[];
|
|
72
72
|
export { android_9 as android };
|
|
73
|
-
|
|
73
|
+
let ios_13: string[];
|
|
74
74
|
export { ios_13 as ios };
|
|
75
75
|
}
|
|
76
76
|
namespace Map {
|
|
77
|
-
|
|
77
|
+
let ios_14: string;
|
|
78
78
|
export { ios_14 as ios };
|
|
79
79
|
}
|
|
80
80
|
namespace Menu {
|
|
81
|
-
|
|
81
|
+
let ios_15: string[];
|
|
82
82
|
export { ios_15 as ios };
|
|
83
|
-
|
|
83
|
+
let android_10: string[];
|
|
84
84
|
export { android_10 as android };
|
|
85
85
|
}
|
|
86
86
|
namespace Modal {
|
|
87
|
-
|
|
87
|
+
let android_11: string[];
|
|
88
88
|
export { android_11 as android };
|
|
89
|
-
|
|
89
|
+
let ios_16: string[];
|
|
90
90
|
export { ios_16 as ios };
|
|
91
91
|
}
|
|
92
92
|
namespace Nav {
|
|
93
|
-
|
|
93
|
+
let ios_17: string;
|
|
94
94
|
export { ios_17 as ios };
|
|
95
95
|
}
|
|
96
96
|
namespace PickerInput {
|
|
97
|
-
|
|
97
|
+
let ios_18: string;
|
|
98
98
|
export { ios_18 as ios };
|
|
99
|
-
|
|
99
|
+
let android_12: string[];
|
|
100
100
|
export { android_12 as android };
|
|
101
101
|
}
|
|
102
102
|
namespace RadioInput {
|
|
103
|
-
|
|
103
|
+
let ios_19: string;
|
|
104
104
|
export { ios_19 as ios };
|
|
105
|
-
|
|
105
|
+
let android_13: string;
|
|
106
106
|
export { android_13 as android };
|
|
107
107
|
}
|
|
108
108
|
namespace Row {
|
|
109
|
-
|
|
109
|
+
let ios_20: string[];
|
|
110
110
|
export { ios_20 as ios };
|
|
111
|
-
|
|
111
|
+
let android_14: string;
|
|
112
112
|
export { android_14 as android };
|
|
113
113
|
}
|
|
114
114
|
namespace Scrollable {
|
|
115
|
-
|
|
115
|
+
let ios_21: string;
|
|
116
116
|
export { ios_21 as ios };
|
|
117
|
-
|
|
117
|
+
let android_15: string[];
|
|
118
118
|
export { android_15 as android };
|
|
119
119
|
}
|
|
120
120
|
namespace SearchInput {
|
|
121
|
-
|
|
121
|
+
let android_16: string;
|
|
122
122
|
export { android_16 as android };
|
|
123
|
-
|
|
123
|
+
let ios_22: string;
|
|
124
124
|
export { ios_22 as ios };
|
|
125
125
|
}
|
|
126
126
|
namespace SliderInput {
|
|
127
|
-
|
|
127
|
+
let android_17: string;
|
|
128
128
|
export { android_17 as android };
|
|
129
|
-
|
|
129
|
+
let ios_23: string[];
|
|
130
130
|
export { ios_23 as ios };
|
|
131
131
|
}
|
|
132
132
|
namespace Spinner {
|
|
133
|
-
|
|
133
|
+
let ios_24: string;
|
|
134
134
|
export { ios_24 as ios };
|
|
135
|
-
|
|
135
|
+
let android_18: string;
|
|
136
136
|
export { android_18 as android };
|
|
137
137
|
}
|
|
138
138
|
namespace SwitchInput {
|
|
139
|
-
|
|
139
|
+
let ios_25: string;
|
|
140
140
|
export { ios_25 as ios };
|
|
141
|
-
|
|
141
|
+
let android_19: string;
|
|
142
142
|
export { android_19 as android };
|
|
143
143
|
}
|
|
144
144
|
namespace Table {
|
|
145
|
-
|
|
145
|
+
let ios_26: string;
|
|
146
146
|
export { ios_26 as ios };
|
|
147
|
-
|
|
147
|
+
let android_20: string;
|
|
148
148
|
export { android_20 as android };
|
|
149
149
|
}
|
|
150
150
|
namespace Text {
|
|
151
|
-
|
|
151
|
+
let ios_27: string[];
|
|
152
152
|
export { ios_27 as ios };
|
|
153
|
-
|
|
153
|
+
let android_21: string[];
|
|
154
154
|
export { android_21 as android };
|
|
155
155
|
}
|
|
156
156
|
namespace TextInput {
|
|
157
|
-
|
|
157
|
+
let ios_28: string[];
|
|
158
158
|
export { ios_28 as ios };
|
|
159
|
-
|
|
159
|
+
let android_22: string[];
|
|
160
160
|
export { android_22 as android };
|
|
161
161
|
}
|
|
162
162
|
namespace ToggleInput {
|
|
163
|
-
|
|
163
|
+
let ios_29: string;
|
|
164
164
|
export { ios_29 as ios };
|
|
165
|
-
|
|
165
|
+
let android_23: string[];
|
|
166
166
|
export { android_23 as android };
|
|
167
167
|
}
|
|
168
168
|
namespace Toolbar {
|
|
169
|
-
|
|
169
|
+
let ios_30: string;
|
|
170
170
|
export { ios_30 as ios };
|
|
171
|
-
|
|
171
|
+
let android_24: string;
|
|
172
172
|
export { android_24 as android };
|
|
173
173
|
}
|
|
174
174
|
namespace UI {
|
|
175
|
-
|
|
175
|
+
let ios_31: string;
|
|
176
176
|
export { ios_31 as ios };
|
|
177
|
-
|
|
177
|
+
let android_25: string;
|
|
178
178
|
export { android_25 as android };
|
|
179
179
|
}
|
|
180
180
|
namespace Video {
|
|
181
|
-
|
|
181
|
+
let android_26: string;
|
|
182
182
|
export { android_26 as android };
|
|
183
183
|
}
|
|
184
184
|
namespace View {
|
|
185
|
-
|
|
185
|
+
let android_27: string[];
|
|
186
186
|
export { android_27 as android };
|
|
187
|
-
|
|
187
|
+
let ios_32: string[];
|
|
188
188
|
export { ios_32 as ios };
|
|
189
189
|
}
|
|
190
190
|
namespace WebView {
|
|
191
|
-
|
|
191
|
+
let ios_33: string;
|
|
192
192
|
export { ios_33 as ios };
|
|
193
193
|
}
|
|
194
194
|
namespace Window {
|
|
195
|
-
|
|
195
|
+
let ios_34: string;
|
|
196
196
|
export { ios_34 as ios };
|
|
197
197
|
}
|
|
198
198
|
}
|
package/build/lib/source.d.ts
CHANGED
|
@@ -60,8 +60,8 @@ export function transformChildNodes(nodeObj: any, childNodeNames: string[], plat
|
|
|
60
60
|
*/
|
|
61
61
|
export function transformAttrs(nodeObj: any, attrs: string[], platform: string): string[];
|
|
62
62
|
export const ATTR_PREFIX: "@_";
|
|
63
|
-
export const IDX_PATH_PREFIX:
|
|
64
|
-
export const IDX_PREFIX:
|
|
63
|
+
export const IDX_PATH_PREFIX: "@_indexPath";
|
|
64
|
+
export const IDX_PREFIX: "@_index";
|
|
65
65
|
export type NodesAndAttributes = {
|
|
66
66
|
nodes: string[];
|
|
67
67
|
attrs: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../lib/source.js"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,2CALW,MAAM,YACN,MAAM,+BACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAC;SACnC,MAAM;cAAY,kBAAkB;EAetD;AAsBD;;;;;GAKG;AACH,+CAJW,GAAG,YACH,MAAM,GACJ,MAAM,QAIlB;AAED;;;;;GAKG;AACH,+CAJW,MAAM,YACN,MAAM,GACJ,MAAM,QAIlB;AAED;;;;;;GAMG;AACH,uCALW,GAAG,YACH,MAAM,0CACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,GAC9D,kBAAkB,CA4C9B;AAED;;;;;;;GAOG;AACH,6CANW,GAAG,kBACH,MAAM,EAAE,YACR,MAAM,0CACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,GAC9D,kBAAkB,CAyC9B;AAED;;;;;;GAMG;AACH,wCALW,GAAG,SACH,MAAM,EAAE,YACR,MAAM,GACJ,MAAM,EAAE,CAsBpB;AAnND,+BAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../lib/source.js"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,2CALW,MAAM,YACN,MAAM,+BACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAC;SACnC,MAAM;cAAY,kBAAkB;EAetD;AAsBD;;;;;GAKG;AACH,+CAJW,GAAG,YACH,MAAM,GACJ,MAAM,QAIlB;AAED;;;;;GAKG;AACH,+CAJW,MAAM,YACN,MAAM,GACJ,MAAM,QAIlB;AAED;;;;;;GAMG;AACH,uCALW,GAAG,YACH,MAAM,0CACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,GAC9D,kBAAkB,CA4C9B;AAED;;;;;;;GAOG;AACH,6CANW,GAAG,kBACH,MAAM,EAAE,YACR,MAAM,0CACN;IAAC,QAAQ,CAAC,MAAS;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,GAC9D,kBAAkB,CAyC9B;AAED;;;;;;GAMG;AACH,wCALW,GAAG,SACH,MAAM,EAAE,YACR,MAAM,GACJ,MAAM,EAAE,CAsBpB;AAnND,+BAAgC;AAChC,4CAAyD;AACzD,mCAAgD;iCAoNnC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/universal-xml-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Appium plugin for making XML source and XPath queries the same across iOS and Android",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@types/xmldom": "0.1.34",
|
|
40
40
|
"@xmldom/xmldom": "0.8.10",
|
|
41
|
-
"fast-xml-parser": "4.3.
|
|
41
|
+
"fast-xml-parser": "4.3.4",
|
|
42
42
|
"lodash": "4.17.21",
|
|
43
43
|
"source-map-support": "0.5.21",
|
|
44
|
-
"xpath": "0.0.
|
|
44
|
+
"xpath": "0.0.34"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"appium": "^2.0.0-beta.35"
|
|
@@ -57,8 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
-
"typedoc": {
|
|
62
|
-
"entryPoint": "./lib/index.js"
|
|
63
|
-
}
|
|
60
|
+
"gitHead": "9cc598a92c2f0d2dfbf40d54698f0ee39b50e4dc"
|
|
64
61
|
}
|