Skip to content

Commit 208f7ab

Browse files
committed
fixed formatting
1 parent 5ac70b4 commit 208f7ab

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

src/commands/element.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ export async function findElOrEls(
3030
let parsedSelector;
3131
if (['-flutter descendant', '-flutter ancestor'].includes(strategy)) {
3232
// Handle descendant/ancestor special case
33-
parsedSelector = _.isString(selector) ? JSON.parse(selector) : selector;
34-
33+
parsedSelector = _.isString(selector)
34+
? JSON.parse(selector)
35+
: selector;
36+
3537
// For Mac2Driver and XCUITestDriver, format selector differently
36-
if (proxyDriver instanceof XCUITestDriver || proxyDriver instanceof Mac2Driver) {
37-
return {
38+
if (
39+
proxyDriver instanceof XCUITestDriver ||
40+
proxyDriver instanceof Mac2Driver
41+
) {
42+
return {
3843
using: strategy,
3944
value: JSON.stringify(parsedSelector),
40-
context
45+
context,
4146
};
4247
}
4348
} else {
@@ -76,10 +81,10 @@ export async function findElOrEls(
7681

7782
export async function click(this: AppiumFlutterDriver, element: string) {
7883
const driver = ELEMENT_CACHE.get(element);
79-
84+
8085
if (this.proxydriver instanceof Mac2Driver) {
8186
this.log.debug('Mac2Driver detected, using non-blocking click');
82-
87+
8388
try {
8489
// Working around Mac2Driver issues which is blocking click request when clicking on Flutter elements opens native dialog
8590
// For Flutter elements, we just verify the element is in our cache
@@ -88,13 +93,17 @@ export async function click(this: AppiumFlutterDriver, element: string) {
8893
}
8994

9095
// Element exists, send click command
91-
driver.command(`/element/${element}/click`, 'POST', {
92-
element,
93-
}).catch((err: Error) => {
94-
// Log error but don't block
95-
this.log.debug(`Click command sent (non-blocking). Any error: ${err.message}`);
96-
});
97-
96+
driver
97+
.command(`/element/${element}/click`, 'POST', {
98+
element,
99+
})
100+
.catch((err: Error) => {
101+
// Log error but don't block
102+
this.log.debug(
103+
`Click command sent (non-blocking). Any error: ${err.message}`,
104+
);
105+
});
106+
98107
// Return success since element check passed
99108
return true;
100109
} catch (err) {

0 commit comments

Comments
 (0)