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

QAWTO-214: update appium python client dependency #404

Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ v3.2.1
- Add `TITLE` replacement, to apply Python's title() function. Example: [TITLE:the title]
- Add `ROUND` replacement, float number to a string with the indicated number of decimals. Example: [ROUND:3.3333::2]
- Remove accents from generated file names to avoid errors in some filesystems
- Update Appium-Python-Client requirement to enable 3 and 4 versions
- Deprecate set_text method in InputText class to make it compatible with Appium-Python-Client 3 and 4

v3.2.0
------
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ The main dependencies are:
in Android or iOS devices/emulators.
- `requests <http://docs.python-requests.org>`_: to test APIs

You might need to adjust the Selenium and Appium-Python-Client versions in your project.
rgonalo marked this conversation as resolved.
Show resolved Hide resolved
In that case follow the `compatibility matrix <https://github.com/appium/python-client?tab=readme-ov-file#compatibility-matrix>`_

**Using toolium-template**

The easiest way of getting started is to clone `toolium-template <https://github.com/Telefonica/toolium-template>`_
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requests~=2.27 # api tests
selenium~=4.0 # web tests
Appium-Python-Client~=2.3 # mobile tests
Pillow~=10.1 # visual testing
requests~=2.27 # api tests
selenium~=4.0 # web tests
Appium-Python-Client>=2.3,<5.0 # mobile tests
Pillow~=10.1 # visual testing
screeninfo~=0.8
lxml~=5.1
Faker~=25.9
Expand Down
12 changes: 4 additions & 8 deletions toolium/pageelements/input_text_page_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ def text(self):

:returns: element text value
"""
if self.driver_wrapper.is_web_test() or self.webview:
return self.web_element.get_attribute("value")
elif self.driver_wrapper.is_ios_test():
return self.web_element.get_attribute("label")
hesteban-tuenti marked this conversation as resolved.
Show resolved Hide resolved
elif self.driver_wrapper.is_android_test():
if self.driver_wrapper.is_android_test() and not self.webview:
return self.web_element.get_attribute("text")
else:
return self.web_element.get_attribute("value")

@text.setter
def text(self, value):
"""Set value on the element

:param value: value to be set
"""
if self.driver_wrapper.is_ios_test() and not self.driver_wrapper.is_web_test():
self.web_element.set_value(value)
elif self.shadowroot:
if self.shadowroot:
value = value.replace("\"", "\\\"")
self.driver.execute_script('return document.querySelector("%s")'
'.shadowRoot.querySelector("%s")'
Expand Down
2 changes: 2 additions & 0 deletions toolium/test/pageelements/test_derived_page_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ def test_get_text(driver_wrapper):

def test_get_input_text(driver_wrapper):
driver_wrapper.driver.find_element.return_value = mock_element
driver_wrapper.is_android_test = mock.MagicMock(return_value=False)

username_value = LoginPageObject().username.text

mock_element.get_attribute.assert_called_once_with('value')
assert username_value == 'input text value'


Expand Down
Loading