1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- from typing import TYPE_CHECKING , Any , Callable , Dict , List , Optional , Set , Tuple , Union
15+ from typing import TYPE_CHECKING , Any , Callable , Dict , List , Optional , Set , Tuple , Type , Union
1616
1717from selenium import webdriver
1818from selenium .common .exceptions import (
2121 UnknownMethodException ,
2222 WebDriverException ,
2323)
24- from selenium .webdriver .common .by import By
2524from selenium .webdriver .remote .command import Command as RemoteCommand
2625from selenium .webdriver .remote .remote_connection import RemoteConnection
2726from typing_extensions import Self
2827
2928from appium .common .logger import logger
3029from appium .options .common .base import AppiumOptions
31- from appium .webdriver .common .appiumby import AppiumBy
3230
3331from .appium_connection import AppiumConnection
3432from .client_config import AppiumClientConfig
@@ -241,7 +239,7 @@ class WebDriver(
241239 def __init__ (
242240 self ,
243241 command_executor : Union [str , AppiumConnection ] = 'http://127.0.0.1:4723' ,
244- extensions : Optional [List ['WebDriver' ]] = None ,
242+ extensions : Optional [List [Type [ 'ExtensionBase' ] ]] = None ,
245243 options : Union [AppiumOptions , List [AppiumOptions ], None ] = None ,
246244 client_config : Optional [AppiumClientConfig ] = None ,
247245 ):
@@ -266,15 +264,6 @@ def __init__(
266264 if client_config and client_config .direct_connection :
267265 self ._update_command_executor (keep_alive = client_config .keep_alive )
268266
269- # add new method to the `find_by_*` pantheon
270- By .IOS_PREDICATE = AppiumBy .IOS_PREDICATE
271- By .IOS_CLASS_CHAIN = AppiumBy .IOS_CLASS_CHAIN
272- By .ANDROID_UIAUTOMATOR = AppiumBy .ANDROID_UIAUTOMATOR
273- By .ANDROID_VIEWTAG = AppiumBy .ANDROID_VIEWTAG
274- By .ACCESSIBILITY_ID = AppiumBy .ACCESSIBILITY_ID
275- By .IMAGE = AppiumBy .IMAGE
276- By .CUSTOM = AppiumBy .CUSTOM
277-
278267 self ._absent_extensions : Set [str ] = set ()
279268
280269 self ._extensions = extensions or []
0 commit comments