Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: cleanup func tests for ios more #1036

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ jobs:
fail-fast: false
matrix:
test_targets:
- target: test/functional/ios/search_context/find_by_*.py test/functional/ios/remote_fs_tests.py test/functional/ios/safari_tests.py test/functional/ios/execute_driver_tests.py
- target: test/functional/ios/safari_tests.py
name: func_test_ios1
- target: test/functional/ios/screen_record_tests.py test/functional/ios/webdriver_tests.py
name: func_test_ios2

runs-on: macos-14

Expand Down
43 changes: 0 additions & 43 deletions test/functional/ios/execute_driver_tests.py

This file was deleted.

1 change: 0 additions & 1 deletion test/functional/ios/file/test_file.txt

This file was deleted.

Binary file removed test/functional/ios/file/test_image.jpg
Binary file not shown.
26 changes: 0 additions & 26 deletions test/functional/ios/remote_fs_tests.py

This file was deleted.

25 changes: 0 additions & 25 deletions test/functional/ios/screen_record_tests.py

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

50 changes: 0 additions & 50 deletions test/functional/ios/search_context/find_by_ios_predicate_tests.py

This file was deleted.

76 changes: 0 additions & 76 deletions test/functional/ios/webdriver_tests.py

This file was deleted.

9 changes: 9 additions & 0 deletions test/unit/webdriver/device/keyboard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,12 @@ def test_is_keyboard_shown(self):
httpretty.register_uri(httpretty.POST, appium_command('/session/1234567890/execute/sync'))
driver.is_keyboard_shown(), WebDriver
assert {'script': 'mobile: isKeyboardShown', 'args': []} == get_httpretty_request_body(httpretty.last_request())

@httpretty.activate
def test_press_button(self):
driver = ios_w3c_driver()
httpretty.register_uri(httpretty.POST, appium_command('/session/1234567890/execute/sync'))
driver.press_button('Home')
assert {'script': 'mobile: pressButton', 'args': [{'name': 'Home'}]} == get_httpretty_request_body(
httpretty.last_request()
)
35 changes: 33 additions & 2 deletions test/unit/webdriver/screen_record_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import httpretty

from test.unit.helper.test_helper import android_w3c_driver, appium_command, get_httpretty_request_body
from test.unit.helper.test_helper import android_w3c_driver, appium_command, get_httpretty_request_body, ios_w3c_driver


class TestWebDriverScreenRecord(object):
class TestWebDriverScreenRecordAndroid(object):
@httpretty.activate
def test_start_recording_screen(self):
driver = android_w3c_driver()
Expand Down Expand Up @@ -41,3 +41,34 @@ def test_stop_recording_screen(self):
assert d['options']['user'] == 'userA'
assert d['options']['pass'] == '12345'
assert 'password' not in d['options'].keys()


class TestWebDriverScreenRecordIOS(object):
@httpretty.activate
def test_start_recording_screen(self):
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/start_recording_screen'),
)
assert driver.start_recording_screen(user='userA', password='12345') is None

d = get_httpretty_request_body(httpretty.last_request())
assert d['options']['user'] == 'userA'
assert d['options']['pass'] == '12345'
assert 'password' not in d['options'].keys()

@httpretty.activate
def test_stop_recording_screen(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/stop_recording_screen'),
body='{"value": "b64_video_data"}',
)
assert driver.stop_recording_screen(user='userA', password='12345') == 'b64_video_data'

d = get_httpretty_request_body(httpretty.last_request())
assert d['options']['user'] == 'userA'
assert d['options']['pass'] == '12345'
assert 'password' not in d['options'].keys()
Loading
Loading