Skip to content
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
open -Fn "$(xcode-select --print-path)/Applications/Simulator.app"
- name: Prepare iOS simulator
uses: futureware-tech/simulator-action@v5
uses: futureware-tech/simulator-action@v4
with:
model: ${{ env.IPHONE_MODEL }}
os_version: ${{ env.IOS_VERSION }}
Expand Down Expand Up @@ -245,8 +245,8 @@ jobs:
XCODE_VERSION: 16.4
IOS_VERSION: 18.5
IPHONE_MODEL: iPhone 16
FLUTTER_ANDROID_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/app-debug.apk"
FLUTTER_IOS_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/ios.zip"
FLUTTER_ANDROID_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/0.0.33/app-debug.apk"
FLUTTER_IOS_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/0.0.33/ios.zip"
PREBUILT_WDA_PATH: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app

steps:
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
open -Fn "$(xcode-select --print-path)/Applications/Simulator.app"

- uses: futureware-tech/simulator-action@v5
- uses: futureware-tech/simulator-action@v4
if: matrix.e2e-tests == 'flutter-ios'
with:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
Expand Down
29 changes: 4 additions & 25 deletions appium/webdriver/extensions/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
import base64
from typing import Optional

from selenium.common.exceptions import UnknownMethodException
from typing_extensions import Self

from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands
from appium.protocols.webdriver.can_execute_scripts import CanExecuteScripts
from appium.protocols.webdriver.can_remember_extension_presence import CanRememberExtensionPresence
from appium.webdriver.clipboard_content_type import ClipboardContentType

from ..mobilecommand import MobileCommand as Command


class Clipboard(CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence):
class Clipboard(CanExecuteCommands, CanExecuteScripts):
def set_clipboard(
self, content: bytes, content_type: str = ClipboardContentType.PLAINTEXT, label: Optional[str] = None
) -> Self:
Expand All @@ -48,11 +44,7 @@ def set_clipboard(
}
if label:
options['label'] = label
try:
self.assert_extension_exists(ext_name).execute_script(ext_name, options)
except UnknownMethodException:
# TODO: Remove the fallback
self.mark_extension_absence(ext_name).execute(Command.SET_CLIPBOARD, options)
self.execute_script(ext_name, options)
return self

def set_clipboard_text(self, text: str, label: Optional[str] = None) -> Self:
Expand All @@ -79,11 +71,7 @@ def get_clipboard(self, content_type: str = ClipboardContentType.PLAINTEXT) -> b
"""
ext_name = 'mobile: getClipboard'
options = {'contentType': content_type}
try:
base64_str = self.assert_extension_exists(ext_name).execute_script(ext_name, options)
except UnknownMethodException:
# TODO: Remove the fallback
base64_str = self.mark_extension_absence(ext_name).execute(Command.GET_CLIPBOARD, options)['value']
base64_str = self.execute_script(ext_name, options)
return base64.b64decode(base64_str)

def get_clipboard_text(self) -> str:
Expand All @@ -95,13 +83,4 @@ def get_clipboard_text(self) -> str:
return self.get_clipboard(ClipboardContentType.PLAINTEXT).decode('UTF-8')

def _add_commands(self) -> None:
self.command_executor.add_command(
Command.SET_CLIPBOARD,
'POST',
'/session/$sessionId/appium/device/set_clipboard',
)
self.command_executor.add_command(
Command.GET_CLIPBOARD,
'POST',
'/session/$sessionId/appium/device/get_clipboard',
)
pass
2 changes: 0 additions & 2 deletions appium/webdriver/mobilecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class MobileCommand:
PUSH_FILE = 'pushFile'
PULL_FILE = 'pullFile'
PULL_FOLDER = 'pullFolder'
GET_CLIPBOARD = 'getClipboard'
SET_CLIPBOARD = 'setClipboard'
FINGER_PRINT = 'fingerPrint'
GET_SETTINGS = 'getSettings'
UPDATE_SETTINGS = 'updateSettings'
Expand Down
1 change: 1 addition & 0 deletions test/functional/android/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def make_options(app: Optional[str] = None) -> UiAutomator2Options:
options.automation_name = 'UIAutomator2'
options.new_command_timeout = 240
options.uiautomator2_server_install_timeout = 120000
options.uiautomator2_server_launch_timeout = 120000
options.adb_exec_timeout = 120000

if app is not None:
Expand Down
6 changes: 0 additions & 6 deletions test/unit/webdriver/device/clipboard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class TestWebDriverClipboard:
@httpretty.activate
def test_set_clipboard_with_url(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST, appium_command('/session/1234567890/appium/device/set_clipboard'), body='{"value": ""}'
)
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/execute/sync'),
Expand All @@ -40,9 +37,6 @@ def test_set_clipboard_with_url(self):
@httpretty.activate
def test_set_clipboard_text(self):
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.POST, appium_command('/session/1234567890/appium/device/set_clipboard'), body='{"value": ""}'
)
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/execute/sync'),
Expand Down
Loading