diff --git a/appium/webdriver/common/appiumby.py b/appium/webdriver/common/appiumby.py index 146f27a9..14526899 100644 --- a/appium/webdriver/common/appiumby.py +++ b/appium/webdriver/common/appiumby.py @@ -35,18 +35,19 @@ class AppiumBy(By): FLUTTER_INTEGRATION_TEXT = '-flutter text' FLUTTER_INTEGRATION_TEXT_CONTAINING = '-flutter text containing' + ByType = Literal[ - "-ios predicate string", - "-ios class chain", - "-android uiautomator", - "-android viewtag", - "-android datamatcher", - "-android viewmatcher", - "accessibility id", - "-image", - "-custom", - "-flutter semantics label", - "-flutter type", - "-flutter key", - "-flutter text containing", + '-ios predicate string', + '-ios class chain', + '-android uiautomator', + '-android viewtag', + '-android datamatcher', + '-android viewmatcher', + 'accessibility id', + '-image', + '-custom', + '-flutter semantics label', + '-flutter type', + '-flutter key', + '-flutter text containing', ] diff --git a/appium/webdriver/extensions/flutter_integration/flutter_finder.py b/appium/webdriver/extensions/flutter_integration/flutter_finder.py index 473976ba..14e86c3c 100644 --- a/appium/webdriver/extensions/flutter_integration/flutter_finder.py +++ b/appium/webdriver/extensions/flutter_integration/flutter_finder.py @@ -17,11 +17,12 @@ from typing import Tuple -from appium.webdriver.common.appiumby import AppiumBy +from appium.webdriver.common.appiumby.AppiumBy import By as AppiumBy +from appium.webdriver.common.appiumby.AppiumBy import ByType class FlutterFinder: - def __init__(self, using: str, value: str) -> None: + def __init__(self, using: ByType, value: str) -> None: self.using = using self.value = value