Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/driver-mobile-use/src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const DEFAULT_URL = 'wss://api.mobilenexthq.com/ws';

interface MobileUseElement {
type: string;
text?: string;
label?: string;
name?: string;
value?: string;
Expand Down Expand Up @@ -115,7 +116,7 @@ function elementToViewNode(el: MobileUseElement): ViewNode {
label: el.label || undefined,
identifier: el.identifier || el.name || undefined,
value: el.value || undefined,
text: el.label || undefined,
text: el.text || el.label || undefined,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we must return el.text as it is. if you are expecting a label, you should use .label. it's more deterministic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmegidish fixed

isVisible: typeof el.visible === 'boolean' ? el.visible : bounds.width > 0 && bounds.height > 0,
isEnabled: el.enabled ?? true,
bounds,
Expand Down
2 changes: 1 addition & 1 deletion packages/driver-mobilecli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@mobilewright/protocol": "^0.0.1",
"debug": "^4.4.3",
"fast-xml-parser": "^5.0.0",
"fast-xml-parser": "^5.7.0",
"mobilecli": "0.3.66",
"ws": "^8.18.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/driver-mobilecli/src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const DEFAULT_URL = 'ws://localhost:12000/ws';
/** Element shape returned by mobilecli's device.dump.ui JSON response */
interface MobilecliElement {
type: string;
text?: string;
label?: string;
name?: string;
value?: string;
Expand Down Expand Up @@ -111,7 +112,7 @@ function elementToViewNode(el: MobilecliElement): ViewNode {
label: el.label || undefined,
identifier: el.identifier || el.name || undefined,
value: el.value || undefined,
text: el.label || undefined,
text: el.text || el.label || undefined,
isVisible: typeof el.visible === 'boolean' ? el.visible : bounds.width > 0 && bounds.height > 0,
isEnabled: el.enabled ?? true,
bounds,
Expand Down