Skip to content

Commit

Permalink
feat: Added typing for AppiumBy (#1071)
Browse files Browse the repository at this point in the history
* feat: Added typing for AppiumBy types

* fix: using single quotes

* fix: adding selenium typing

* fix: pipeline
  • Loading branch information
Brijeshkrishna authored Nov 29, 2024
1 parent ea61c2e commit 00e9a6e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
19 changes: 19 additions & 0 deletions appium/webdriver/common/appiumby.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Literal

from selenium.webdriver.common.by import By


Expand All @@ -32,3 +34,20 @@ class AppiumBy(By):
FLUTTER_INTEGRATION_KEY = '-flutter key'
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',
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
# specific language governing permissions and limitations
# under the License.

from typing import Tuple
from typing import Tuple, Union

from selenium.webdriver.common.by import ByType as SeleniumByType

from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.common.appiumby import ByType as AppiumByType


class FlutterFinder:
def __init__(self, using: str, value: str) -> None:
def __init__(self, using: Union[SeleniumByType, AppiumByType], value: str) -> None:
self.using = using
self.value = value

Expand Down

0 comments on commit 00e9a6e

Please sign in to comment.