Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci-jobs/functional_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
vmImage: 'macOS-10.15'
pytestOpt: '--doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html'
androidSdkVer: 27
xcodeForIOS: 11.6
xcodeForIOS: 12.3
CI: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion test/functional/ios/helper/desired_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_desired_capabilities(app: Optional[str] = None) -> Dict[str, Any]:
desired_caps: Dict[str, Any] = {
'deviceName': iphone_device_name(),
'platformName': 'iOS',
'platformVersion': '13.6',
'platformVersion': '14.3',
'automationName': 'XCUITest',
'allowTouchIdEnroll': True,
'wdaLocalPort': wda_port(),
Expand Down
30 changes: 19 additions & 11 deletions test/functional/ios/keyboard_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@
# limitations under the License.

from time import sleep
from typing import TYPE_CHECKING

import pytest
from selenium.common.exceptions import NoSuchElementException

from test.functional.ios.helper.test_helper import BaseTestCase

if TYPE_CHECKING:
from appium.webdriver.webelement import WebElement


class TestKeyboard(BaseTestCase):
def test_hide_keyboard(self) -> None:
Expand All @@ -25,12 +32,12 @@ def test_hide_keyboard(self) -> None:
el.click()
el.set_value('Testing')

el = self.driver.find_element_by_class_name('UIAKeyboard')
assert el.is_displayed()
assert self._get_keyboard_el().is_displayed()

self.driver.hide_keyboard(key_name='Done')

assert not el.is_displayed()
with pytest.raises(NoSuchElementException):
self._get_keyboard_el()

def test_hide_keyboard_presskey_strategy(self) -> None:
self._move_to_textbox()
Expand All @@ -39,12 +46,12 @@ def test_hide_keyboard_presskey_strategy(self) -> None:
el.click()
el.set_value('Testing')

el = self.driver.find_element_by_class_name('UIAKeyboard')
assert el.is_displayed()
assert self._get_keyboard_el().is_displayed()

self.driver.hide_keyboard(strategy='pressKey', key='Done')

assert not el.is_displayed()
with pytest.raises(NoSuchElementException):
self._get_keyboard_el()

def test_hide_keyboard_no_key_name(self) -> None:
self._move_to_textbox()
Expand All @@ -53,14 +60,12 @@ def test_hide_keyboard_no_key_name(self) -> None:
el.click()
el.set_value('Testing')

el = self.driver.find_element_by_class_name('UIAKeyboard')
assert el.is_displayed()
assert self._get_keyboard_el().is_displayed()

self.driver.hide_keyboard()
sleep(10)

# currently fails.
assert not el.is_displayed()
with pytest.raises(NoSuchElementException):
self._get_keyboard_el()

def test_is_keyboard_shown(self) -> None:
self._move_to_textbox()
Expand All @@ -70,6 +75,9 @@ def test_is_keyboard_shown(self) -> None:
el.set_value('Testing')
assert self.driver.is_keyboard_shown()

def _get_keyboard_el(self) -> 'WebElement':
return self.driver.find_element_by_class_name('UIAKeyboard')

def _move_to_textbox(self) -> None:
el1 = self.driver.find_element_by_accessibility_id('Sliders')
el2 = self.driver.find_element_by_accessibility_id('Buttons')
Expand Down