Skip to content

Commit 73c83c0

Browse files
authored
chore: add deprecated marks in lib/method-map.js (#2554)
* chore: mark deprecated * modify docs * update * update commands.md side * update * tweak
1 parent db2e62d commit 73c83c0

File tree

2 files changed

+126
-30
lines changed

2 files changed

+126
-30
lines changed

docs/reference/commands.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Please note that most of the driver-specific functionality is available using
1616

1717
### `getClipboard`
1818

19+
!!! warning "Deprecated"
20+
21+
This method is deprecated. Please use the [`mobile: getClipboard`](./execute-methods.md#mobile-getclipboard) extension instead
22+
1923
`POST` **`/session/:sessionId/appium/device/get_clipboard`**
2024

2125
Gets the content of the primary clipboard on the device under test.
@@ -36,6 +40,10 @@ clipboard contains no data.
3640

3741
### `setClipboard`
3842

43+
!!! warning "Deprecated"
44+
45+
This method is deprecated. Please use the [`mobile: setClipboard`](./execute-methods.md#mobile-setclipboard) extension instead
46+
3947
`POST` **`/session/:sessionId/appium/device/set_clipboard`**
4048

4149
Sets the primary clipboard's content on the device under test.
@@ -157,6 +165,10 @@ or an empty string.
157165

158166
### `getSize`
159167

168+
!!! warning "Deprecated"
169+
170+
This method is deprecated. Please refer to the [Get Element Rect][https://www.w3.org/TR/webdriver1/#dfn-get-element-rect] instead
171+
160172
`GET` **`/session/:sessionId/element/:elementId/size`**
161173

162174
Get the size of an element
@@ -169,6 +181,10 @@ The positions of the element
169181

170182
### `submit`
171183

184+
!!! warning "Deprecated"
185+
186+
This method is deprecated. Please click the submit button instead
187+
172188
`POST` **`/session/:sessionId/element/:elementId/submit`**
173189

174190
Submit the form an element is in
@@ -179,9 +195,9 @@ Submit the form an element is in
179195

180196
### `background`
181197

182-
!!! note
198+
!!! warning "Deprecated"
183199

184-
We recommend using the [`mobile: backgroundApp`](./execute-methods.md#mobile-backgroundapp) extension instead
200+
This method is deprecated. Please use the [`mobile: backgroundApp`](./execute-methods.md#mobile-backgroundapp) extension instead
185201

186202
`POST` **`/session/:sessionId/appium/app/background`**
187203

@@ -200,9 +216,9 @@ the app after the timeout or keep it minimized based on the parameter value.
200216

201217
### `queryAppState`
202218

203-
!!! note
219+
!!! warning "Deprecated"
204220

205-
We recommend using the [`mobile: queryAppState`](./execute-methods.md#mobile-queryappstate) extension instead
221+
This method is deprecated. Please use the [`mobile: queryAppState`](./execute-methods.md#mobile-queryappstate) extension instead
206222

207223
`POST` **`/session/:sessionId/appium/device/app_state`**
208224

@@ -218,9 +234,9 @@ running in the foreground
218234

219235
### `isLocked`
220236

221-
!!! note
237+
!!! warning "Deprecated"
222238

223-
We recommend using the [`mobile: isLocked`](./execute-methods.md#mobile-islocked) extension instead
239+
This method is deprecated. Please use the [`mobile: isLocked`](./execute-methods.md#mobile-islocked) extension instead
224240

225241
`POST` **`/session/:sessionId/appium/device/is_locked`**
226242

@@ -234,9 +250,9 @@ Determine whether the device is locked
234250

235251
### `lock`
236252

237-
!!! note
253+
!!! warning "Deprecated"
238254

239-
We recommend using the [`mobile: lock`](./execute-methods.md#mobile-lock) extension instead
255+
This method is deprecated. Please use the [`mobile: lock`](./execute-methods.md#mobile-lock) extension instead
240256

241257
`POST` **`/session/:sessionId/appium/device/lock`**
242258

@@ -258,9 +274,9 @@ Lock the device (and optionally unlock the device after a certain amount of time
258274

259275
### `unlock`
260276

261-
!!! note
277+
!!! warning "Deprecated"
262278

263-
We recommend using the [`mobile: unlock`](./execute-methods.md#mobile-unlock) extension instead
279+
This method is deprecated. Please use the [`mobile: unlock`](./execute-methods.md#mobile-unlock) extension instead
264280

265281
`POST` **`/session/:sessionId/appium/device/unlock`**
266282

@@ -274,9 +290,9 @@ Unlock the device
274290

275291
### `mobileShake`
276292

277-
!!! note
293+
!!! warning "Deprecated"
278294

279-
We recommend using the [`mobile: shake`](./execute-methods.md#mobile-shake) extension instead
295+
This method is deprecated. Please use the [`mobile: shake`](./execute-methods.md#mobile-shake) extension instead
280296

281297
`POST` **`/session/:sessionId/appium/device/shake`**
282298

@@ -288,9 +304,9 @@ Shake the device
288304

289305
### `getStrings`
290306

291-
!!! note
307+
!!! warning "Deprecated"
292308

293-
We recommend using the [`mobile: getAppStrings`](./execute-methods.md#mobile-getappstrings) extension instead
309+
This method is deprecated. Please use the [`mobile: getAppStrings`](./execute-methods.md#mobile-getappstrings) extension instead
294310

295311
`POST` **`/session/:sessionId/appium/app/strings`**
296312

@@ -351,7 +367,7 @@ Send keys to the app
351367

352368
!!! warning "Deprecated"
353369

354-
This method is deprecated
370+
This method is deprecated. Please use the [Execute Async Script](https://www.w3.org/TR/webdriver1/#dfn-execute-async-script) instead
355371

356372
`POST` **`/session/:sessionId/appium/receive_async_response`**
357373

lib/method-map.js

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,78 @@ export const newMethodMap = /** @type {const} */ ({
33
POST: {
44
command: 'asyncScriptTimeout',
55
payloadParams: {required: ['ms']},
6+
deprecated: true,
67
},
78
},
89
'/session/:sessionId/timeouts/implicit_wait': {
9-
POST: {command: 'implicitWait', payloadParams: {required: ['ms']}},
10+
POST: {
11+
command: 'implicitWait',
12+
payloadParams: {required: ['ms']},
13+
deprecated: true
14+
},
15+
},
16+
'/session/:sessionId/window/:windowhandle/size': {
17+
GET: {
18+
command: 'getWindowSize',
19+
deprecated: true
20+
}
21+
},
22+
'/session/:sessionId/element/:elementId/submit': {
23+
POST: {
24+
command: 'submit',
25+
deprecated: true
26+
}
1027
},
11-
'/session/:sessionId/window/:windowhandle/size': {GET: {command: 'getWindowSize'}},
12-
'/session/:sessionId/element/:elementId/submit': {POST: {command: 'submit'}},
1328
'/session/:sessionId/keys': {
14-
POST: {command: 'keys', payloadParams: {required: ['value']}},
29+
POST: {
30+
command: 'keys',
31+
payloadParams: {required: ['value']},
32+
deprecated: true
33+
},
34+
},
35+
'/session/:sessionId/element/:elementId/location': {
36+
GET: {
37+
command: 'getLocation',
38+
deprecated: true
39+
}
40+
},
41+
'/session/:sessionId/element/:elementId/location_in_view': {
42+
GET: {
43+
command: 'getLocationInView',
44+
deprecated: true
45+
}
46+
},
47+
'/session/:sessionId/element/:elementId/size': {
48+
GET: {
49+
command: 'getSize',
50+
deprecated: true
51+
}
52+
},
53+
'/session/:sessionId/appium/device/shake': {
54+
POST: {
55+
command: 'mobileShake',
56+
deprecated: true
57+
}
1558
},
16-
'/session/:sessionId/element/:elementId/location': {GET: {command: 'getLocation'}},
17-
'/session/:sessionId/element/:elementId/location_in_view': {GET: {command: 'getLocationInView'}},
18-
'/session/:sessionId/element/:elementId/size': {GET: {command: 'getSize'}},
19-
'/session/:sessionId/appium/device/shake': {POST: {command: 'mobileShake'}},
2059
'/session/:sessionId/appium/device/lock': {
21-
POST: {command: 'lock', payloadParams: {optional: ['seconds']}},
60+
POST: {
61+
command: 'lock',
62+
payloadParams: {optional: ['seconds']},
63+
deprecated: true
64+
},
65+
},
66+
'/session/:sessionId/appium/device/unlock': {
67+
POST: {
68+
command: 'unlock',
69+
deprecated: true
70+
}
71+
},
72+
'/session/:sessionId/appium/device/is_locked': {
73+
POST: {
74+
command: 'isLocked',
75+
deprecated: true
76+
}
2277
},
23-
'/session/:sessionId/appium/device/unlock': {POST: {command: 'unlock'}},
24-
'/session/:sessionId/appium/device/is_locked': {POST: {command: 'isLocked'}},
2578
'/session/:sessionId/appium/start_recording_screen': {
2679
POST: {
2780
command: 'startRecordingScreen',
@@ -38,48 +91,74 @@ export const newMethodMap = /** @type {const} */ ({
3891
POST: {
3992
command: 'queryAppState',
4093
payloadParams: {required: [['appId'], ['bundleId']]},
94+
deprecated: true
4195
},
4296
},
4397
'/session/:sessionId/appium/simulator/touch_id': {
44-
POST: {command: 'touchId', payloadParams: {required: ['match']}},
98+
POST: {
99+
command: 'touchId',
100+
payloadParams: {required: ['match']},
101+
deprecated: true
102+
},
45103
},
46104
'/session/:sessionId/appium/simulator/toggle_touch_id_enrollment': {
47105
POST: {
48106
command: 'toggleEnrollTouchId',
49107
payloadParams: {optional: ['enabled']},
108+
deprecated: true
50109
},
51110
},
52-
'/session/:sessionId/appium/app/launch': {POST: {command: 'launchApp'}},
53-
'/session/:sessionId/appium/app/close': {POST: {command: 'closeApp'}},
54-
'/session/:sessionId/appium/app/reset': {POST: {command: 'reset'}},
111+
'/session/:sessionId/appium/app/launch': {
112+
POST: {
113+
command: 'launchApp',
114+
deprecated: true
115+
}
116+
},
117+
'/session/:sessionId/appium/app/close': {
118+
POST: {
119+
command: 'closeApp',
120+
deprecated: true
121+
}
122+
},
123+
'/session/:sessionId/appium/app/reset': {
124+
POST: {
125+
command: 'reset',
126+
deprecated: true
127+
}
128+
},
55129
'/session/:sessionId/appium/app/background': {
56130
POST: {
57131
command: 'background',
58132
payloadParams: {required: ['seconds']},
133+
deprecated: true
59134
},
60135
},
61136
'/session/:sessionId/appium/app/strings': {
62137
POST: {
63138
command: 'getStrings',
64139
payloadParams: {optional: ['language', 'stringFile']},
140+
deprecated: true
65141
},
66142
},
67143
'/session/:sessionId/appium/element/:elementId/value': {
68144
POST: {
69145
command: 'setValueImmediate',
70146
payloadParams: {required: ['text']},
147+
deprecated: true
71148
},
72149
},
73150
'/session/:sessionId/appium/receive_async_response': {
74151
POST: {
75152
command: 'receiveAsyncResponse',
76153
payloadParams: {required: ['response']},
154+
deprecated: true
77155
},
78156
},
79157
'/session/:sessionId/appium/device/get_clipboard': {
80158
POST: {
81159
command: 'getClipboard',
82160
payloadParams: {optional: ['contentType']},
161+
deprecated: true
83162
},
84163
},
85164
'/session/:sessionId/appium/device/set_clipboard': {
@@ -89,6 +168,7 @@ export const newMethodMap = /** @type {const} */ ({
89168
required: ['content'],
90169
optional: ['contentType', 'label'],
91170
},
171+
deprecated: true
92172
},
93173
},
94174
});

0 commit comments

Comments
 (0)