File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525import {
2626 attachAppLaunchArguments ,
2727 fetchFlutterServerPort ,
28+ FLUTTER_LOCATORS ,
2829 getFreePort ,
2930 isFlutterDriverCommand ,
3031 waitForFlutterServerToBeActive ,
@@ -56,16 +57,14 @@ export class AppiumFlutterDriver extends BaseDriver<FlutterDriverConstraints> {
5657 'xpath' ,
5758 'css selector' ,
5859 'id' ,
60+ 'name' ,
61+ 'class name' ,
5962 '-android uiautomator' ,
6063 'accessibility id' ,
6164 '-ios predicate string' ,
6265 '-ios class chain' ,
63- 'name' ,
64- 'key' ,
65- 'class name' ,
66- 'semantics label' ,
67- 'text' ,
68- 'type' ,
66+ ...FLUTTER_LOCATORS , //to support backward compatibility
67+ ...FLUTTER_LOCATORS . map ( ( locator ) => `-flutter ${ locator } ` ) ,
6968 ] ;
7069 }
7170
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { findAPortNotInUse } from 'portscanner';
33import { waitForCondition } from 'asyncbox' ;
44import { JWProxy } from 'appium/driver' ;
55import type { PortForwardCallback , PortReleaseCallback } from './types' ;
6- import type { AppiumFlutterDriver } from './driver' ;
6+ import { type AppiumFlutterDriver } from './driver' ;
77import _ from 'lodash' ;
88import type { StringRecord } from '@appium/types' ;
99import { node } from 'appium/support' ;
@@ -17,12 +17,18 @@ const {
1717 appium : { flutterServerVersion : FLUTTER_SERVER_VERSION_REQ } ,
1818 version : PACKAGE_VERSION ,
1919} = readManifest ( ) ;
20-
20+ export const FLUTTER_LOCATORS = [
21+ 'key' ,
22+ 'semantics label' ,
23+ 'text' ,
24+ 'type' ,
25+ 'text containing' ,
26+ ] ;
2127export async function getProxyDriver (
2228 this : AppiumFlutterDriver ,
2329 strategy : string ,
2430) : Promise < JWProxy | undefined > {
25- if ( [ 'key' , 'semantics label' , 'text' , 'type' ] . includes ( strategy ) ) {
31+ if ( strategy . startsWith ( '-flutter' ) || FLUTTER_LOCATORS . includes ( strategy ) ) {
2632 return this . proxy ;
2733 } else if ( this . proxydriver instanceof AndroidUiautomator2Driver ) {
2834 // @ts -ignore Proxy instance is OK
You can’t perform that action at this time.
0 commit comments