mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-27 08:55:39 +00:00
e2e: updated SauceLabs capabilities
This commit is contained in:
parent
4bf8aaf2e0
commit
f94be17b11
@ -163,8 +163,8 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
|
||||
|
||||
def _device_1_creates_user():
|
||||
self.home_1.just_fyi("Device 1 creates a new user")
|
||||
self.profile_1.driver.reset()
|
||||
self.device_1.create_user(username=new_username_1)
|
||||
self.home_1.reopen_app(sign_in=False)
|
||||
self.device_1.create_user(username=new_username_1, first_user=False)
|
||||
|
||||
def _device_2_sign_in():
|
||||
self.home_2.just_fyi("Device 2 sign in, user name is " + self.username_2)
|
||||
|
@ -64,14 +64,14 @@ def get_capabilities_sauce_lab():
|
||||
caps = dict()
|
||||
caps['platformName'] = 'Android'
|
||||
caps['idleTimeout'] = 1000
|
||||
caps['appium:app'] = 'sauce-storage:' + test_suite_data.apk_name
|
||||
caps['appium:app'] = 'storage:filename=' + test_suite_data.apk_name
|
||||
caps['appium:deviceName'] = 'Android GoogleAPI Emulator'
|
||||
caps['appium:deviceOrientation'] = 'portrait'
|
||||
caps['appium:platformVersion'] = '14.0'
|
||||
caps['appium:automationName'] = 'UiAutomator2'
|
||||
caps['appium:newCommandTimeout'] = 600
|
||||
caps['appium:idleTimeout'] = 1000
|
||||
caps['appium:unicodeKeyboard'] = True
|
||||
caps['appium:hideKeyboard'] = True
|
||||
caps['appium:automationName'] = 'UiAutomator2'
|
||||
caps['appium:setWebContentDebuggingEnabled'] = True
|
||||
caps['appium:ignoreUnimportantViews'] = False
|
||||
@ -81,14 +81,14 @@ def get_capabilities_sauce_lab():
|
||||
caps['appium:enforceXPath1'] = True
|
||||
caps['enforceXPath1'] = True
|
||||
caps['sauce:options'] = dict()
|
||||
caps['sauce:options']['appiumVersion'] = '2.0.0'
|
||||
caps['sauce:options']['appiumVersion'] = '2.11.0'
|
||||
caps['sauce:options']['username'] = sauce_username
|
||||
caps['sauce:options']['accessKey'] = sauce_access_key
|
||||
caps['sauce:options']['build'] = run_name
|
||||
caps['sauce:options']['name'] = test_suite_data.current_test.name
|
||||
caps['sauce:options']['maxDuration'] = 3600
|
||||
caps['sauce:options']['idleTimeout'] = 1000
|
||||
caps['sauce:options']['android.gpu.mode'] = 'hardware'
|
||||
# caps['sauce:options']['android.gpu.mode'] = 'hardware'
|
||||
|
||||
options = AppiumOptions()
|
||||
options.load_capabilities(caps)
|
||||
|
@ -147,8 +147,8 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||
url_message = 'Test with link: https://status.im/ here should be nothing unusual.'
|
||||
self.chat_1.send_message(url_message)
|
||||
self.chat_2.chat_element_by_text(url_message).wait_for_element(20)
|
||||
self.chat_2.chat_element_by_text(url_message).long_press_element_by_coordinate(rel_x=0.8, rel_y=0.8)
|
||||
self.chat_2.reply_message_button.click()
|
||||
# self.chat_2.chat_element_by_text(url_message).long_press_element_by_coordinate(rel_x=0.8, rel_y=0.8)
|
||||
self.chat_2.quote_message(url_message)
|
||||
self.chat_2.send_message(reply)
|
||||
replied_message = self.chat_1.chat_element_by_text(reply)
|
||||
if replied_message.replied_message_text != url_message:
|
||||
@ -231,9 +231,10 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||
or self.chat_1.pinned_messages_list.message_element_by_text(self.message_4).is_element_displayed():
|
||||
self.errors.append("Can pin more than 3 messages in chat")
|
||||
else:
|
||||
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).long_press_element()
|
||||
self.home_1.just_fyi("Unpin one message so that another could be pinned")
|
||||
unpin_element = self.chat_1.element_by_translation_id('unpin-from-chat')
|
||||
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).long_press_element(
|
||||
element_to_release_on=unpin_element)
|
||||
self.home_1.just_fyi("Unpin one message so that another could be pinned")
|
||||
unpin_element.click_until_absense_of_element(desired_element=unpin_element)
|
||||
self.chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
|
||||
@ -253,7 +254,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||
pinned_message = self.chat_1.pinned_messages_list.message_element_by_text(self.message_4)
|
||||
|
||||
unpin_element = self.chat_1.element_by_translation_id("unpin-from-chat")
|
||||
pinned_message.long_press_until_element_is_shown(unpin_element)
|
||||
pinned_message.long_press_element(element_to_release_on=unpin_element)
|
||||
unpin_element.click_until_absense_of_element(unpin_element)
|
||||
# try:
|
||||
# self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
|
||||
@ -266,7 +267,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||
except Failed:
|
||||
self.errors.append(
|
||||
"Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
|
||||
chat_number + 1)
|
||||
chat_number + 1)
|
||||
)
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
@ -396,8 +396,9 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
|
||||
self.chats[0].send_message(self.message_4)
|
||||
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
|
||||
self.chats[0].view_pinned_messages_button.click_until_presence_of_element(self.chats[0].pinned_messages_list)
|
||||
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).long_press_element()
|
||||
unpin_element = self.chats[0].element_by_translation_id('unpin-from-chat')
|
||||
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).long_press_element(
|
||||
element_to_release_on=unpin_element)
|
||||
unpin_element.click_until_absense_of_element(desired_element=unpin_element)
|
||||
self.chats[0].chat_element_by_text(self.message_4).click()
|
||||
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
|
||||
|
@ -9,7 +9,7 @@ from selenium.common.exceptions import NoSuchElementException, TimeoutException,
|
||||
|
||||
from tests import marks, run_in_parallel, pytest_config_global, transl
|
||||
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
|
||||
from views.chat_view import CommunityView
|
||||
from views.chat_view import CommunityView, ChatView
|
||||
from views.dbs.waku_backup import user as waku_user
|
||||
from views.sign_in_view import SignInView
|
||||
|
||||
@ -71,6 +71,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.home.get_to_community_channel_from_home(self.community_name)
|
||||
message_to_delete = "message to delete and undo"
|
||||
self.channel.send_message(message_to_delete)
|
||||
self.channel.chat_element_by_text(message_to_delete).wait_for_sent_state()
|
||||
self.channel.delete_message_in_chat(message_to_delete)
|
||||
try:
|
||||
self.channel.element_by_text("Undo").click()
|
||||
@ -245,7 +246,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
@marks.testrail_id(703503)
|
||||
def test_community_discovery(self):
|
||||
try:
|
||||
# workaround for case if a user is logged out in the previous test
|
||||
# workaround for case if a user is logged out in the previous test
|
||||
self.sign_in.get_user_profile_by_index(index=1).click()
|
||||
self.sign_in.sign_in()
|
||||
except NoSuchElementException:
|
||||
@ -284,9 +285,11 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
# if community_name == 'Status':
|
||||
self.home.just_fyi("Check Status community screen")
|
||||
card.click()
|
||||
self.community_view.join_button.save_new_screenshot_of_element('status_community_join_button_aaa.png')
|
||||
if self.community_view.join_button.is_element_differs_from_template(
|
||||
'status_community_join_button.png'):
|
||||
self.errors.append("Status community Join button is different from expected template.")
|
||||
self.community_view.community_logo.save_new_screenshot_of_element('status_community_logo_aaa.png')
|
||||
if self.community_view.community_logo.is_element_differs_from_template('status_community_logo.png'):
|
||||
self.errors.append("Status community logo is different from expected template.")
|
||||
|
||||
@ -324,7 +327,8 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.home_1.get_chat(self.username_2).wait_for_visibility_of_element()
|
||||
self.chat_1 = self.home_1.get_chat(self.username_2).click()
|
||||
self.chat_1.send_message('hey')
|
||||
self.chat_2 = self.home_2.get_chat(self.username_1).click()
|
||||
self.chat_2 = self.home_2.get_chat(self.username_1).click_until_presence_of_element(
|
||||
ChatView(self.drivers[1]).chat_message_input)
|
||||
# self.chat_2.send_message(self.text_message)
|
||||
# [home.click_system_back_button_until_element_is_shown() for home in self.homes]
|
||||
self.home_1.navigate_back_to_home_view()
|
||||
@ -503,8 +507,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.channel_2.navigate_back_to_chat_view()
|
||||
|
||||
self.channel_2.just_fyi("Can reply to images")
|
||||
self.channel_2.chat_element_by_text(image_description).long_press_element_by_coordinate(rel_x=0.8, rel_y=0.8)
|
||||
self.channel_2.reply_message_button.click()
|
||||
# self.channel_2.chat_element_by_text(image_description).long_press_element_by_coordinate(rel_x=0.8, rel_y=0.8)
|
||||
# self.channel_2.reply_message_button.click()
|
||||
self.channel_2.quote_message(image_description)
|
||||
message_text = 'reply to image'
|
||||
self.channel_2.chat_message_input.send_keys(message_text)
|
||||
self.channel_2.send_message_button.click()
|
||||
@ -908,7 +913,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
|
||||
self.device_2.just_fyi("Sender edits the message with a mention")
|
||||
chat_element = self.channel_2.chat_element_by_text(self.username_1)
|
||||
chat_element.wait_for_sent_state()
|
||||
chat_element.long_press_element_by_coordinate()
|
||||
chat_element.long_press_element()
|
||||
edit_done = False
|
||||
expected_message = ""
|
||||
try:
|
||||
|
@ -8,8 +8,8 @@ import emoji
|
||||
import imagehash
|
||||
from PIL import Image, ImageChops, ImageStat
|
||||
from appium.webdriver.common.mobileby import MobileBy
|
||||
from appium.webdriver.common.touch_action import TouchAction
|
||||
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, TimeoutException
|
||||
from selenium.webdriver import ActionChains
|
||||
from selenium.webdriver.support import expected_conditions
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
|
||||
@ -317,18 +317,25 @@ class BaseElement(object):
|
||||
x, y = location['x'], location['y']
|
||||
self.driver.swipe(start_x=x, start_y=y, end_x=x, end_y=depth)
|
||||
|
||||
def long_press_element(self):
|
||||
def long_press_element(self, element_to_release_on=None):
|
||||
element = self.find_element()
|
||||
self.driver.info("Long press on `%s`" % self.name)
|
||||
action = TouchAction(self.driver)
|
||||
action.long_press(element).release().perform()
|
||||
action = ActionChains(self.driver)
|
||||
action.click_and_hold(element).perform()
|
||||
time.sleep(2)
|
||||
if element_to_release_on:
|
||||
action.release(element_to_release_on.find_element()).perform()
|
||||
else:
|
||||
action.release(element).perform()
|
||||
|
||||
def long_press_until_element_is_shown(self, expected_element):
|
||||
element = self.find_element()
|
||||
self.driver.info("Long press on `%s` until expected element is shown" % self.name)
|
||||
action = TouchAction(self.driver)
|
||||
action = ActionChains(self.driver)
|
||||
for _ in range(3):
|
||||
action.long_press(element).release().perform()
|
||||
action.click_and_hold(element).perform()
|
||||
time.sleep(2)
|
||||
action.release(element).perform()
|
||||
if expected_element.is_element_displayed():
|
||||
return
|
||||
|
||||
@ -338,8 +345,9 @@ class BaseElement(object):
|
||||
size = element.size
|
||||
x = int(location['x'] + size['width'] * rel_x)
|
||||
y = int(location['y'] + size['height'] * rel_y)
|
||||
action = TouchAction(self.driver)
|
||||
action.long_press(x=x, y=y).release().perform()
|
||||
action = ActionChains(self.driver)
|
||||
action.move_to_element_with_offset(to_element=element, xoffset=x, yoffset=y).click_and_hold().perform()
|
||||
action.release(element).perform()
|
||||
|
||||
def measure_time_before_element_appears(self, max_wait_time=30):
|
||||
def wrapper():
|
||||
@ -395,19 +403,24 @@ class EditBox(BaseElement):
|
||||
self.driver.info("Paste text from clipboard into `%s`" % self.name)
|
||||
self.long_press_element()
|
||||
time.sleep(2)
|
||||
action = TouchAction(self.driver)
|
||||
location = self.find_element().location
|
||||
action = ActionChains(self.driver)
|
||||
element = self.find_element()
|
||||
location = element.location
|
||||
x, y = location['x'], location['y']
|
||||
action.press(x=x + 25, y=y - 50).release().perform()
|
||||
action.move_by_offset(xoffset=x + 25, yoffset=y - 50).click().perform()
|
||||
action.release(element).perform()
|
||||
|
||||
def cut_text(self):
|
||||
self.driver.info("Cut text in `%s`" % self.name)
|
||||
location = self.find_element().location
|
||||
element = self.find_element()
|
||||
location = element.location
|
||||
x, y = location['x'], location['y']
|
||||
action = TouchAction(self.driver)
|
||||
action.long_press(x=x, y=y).release().perform()
|
||||
action = ActionChains(self.driver)
|
||||
action.move_by_offset(xoffset=x, yoffset=y).click_and_hold().perform()
|
||||
action.release(element).perform()
|
||||
time.sleep(2)
|
||||
action.press(x=x + 50, y=y - 50).release().perform()
|
||||
action.move_by_offset(xoffset=x + 50, yoffset=y - 50).click().perform()
|
||||
action.release(element).perform()
|
||||
|
||||
|
||||
class Text(BaseElement):
|
||||
|
@ -7,8 +7,8 @@ from datetime import datetime
|
||||
|
||||
from appium.webdriver import WebElement
|
||||
from appium.webdriver.applicationstate import ApplicationState
|
||||
from appium.webdriver.common.touch_action import TouchAction
|
||||
from selenium.common.exceptions import NoSuchElementException, TimeoutException
|
||||
from selenium.webdriver import ActionChains
|
||||
from selenium.webdriver.support import expected_conditions
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
|
||||
@ -221,7 +221,7 @@ class AirplaneModeButton(Button):
|
||||
super().__init__(driver, accessibility_id="Airplane mode")
|
||||
|
||||
def open_quick_action_menu(self):
|
||||
action = TouchAction(self.driver)
|
||||
action = ActionChains(self.driver)
|
||||
action.press(None, 200, 0).move_to(None, 200, 300).perform()
|
||||
|
||||
def click(self):
|
||||
@ -713,7 +713,7 @@ class BaseView(object):
|
||||
|
||||
def close_share_popup(self):
|
||||
self.driver.info("Closing share popup")
|
||||
TouchAction(self.driver).tap(None, 255, 104, 1).perform()
|
||||
ActionChains(self.driver).tap(None, 255, 104, 1).perform()
|
||||
time.sleep(3)
|
||||
|
||||
def tap_mutual_cr_switcher(self):
|
||||
@ -855,8 +855,7 @@ class BaseView(object):
|
||||
send_transaction.sign_transaction(keycard=keycard)
|
||||
|
||||
def tap_by_coordinates(self, x, y):
|
||||
action = TouchAction(self.driver)
|
||||
action.press(None, x, y).release().perform()
|
||||
self.driver.tap(positions=[(x, y)])
|
||||
|
||||
# Method-helper
|
||||
def write_page_source_to_file(self, full_path_to_file):
|
||||
|
@ -4,9 +4,9 @@ from datetime import datetime, timedelta
|
||||
from time import sleep
|
||||
|
||||
import dateutil.parser
|
||||
from appium.webdriver.common.touch_action import TouchAction
|
||||
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException, \
|
||||
InvalidElementStateException
|
||||
from selenium.webdriver import ActionChains
|
||||
|
||||
from tests import emojis, common_password
|
||||
from views.base_element import Button, EditBox, Text, BaseElement, SilentButton
|
||||
@ -711,17 +711,22 @@ class ChatMessageInput(EditBox):
|
||||
super().__init__(driver, accessibility_id="chat-message-input")
|
||||
|
||||
def paste_text_from_clipboard(self):
|
||||
action = TouchAction(self.driver)
|
||||
location = self.find_element().location
|
||||
action = ActionChains(self.driver)
|
||||
element = self.find_element()
|
||||
location = element.location
|
||||
x, y = location['x'], location['y']
|
||||
action.long_press(x=x + 250, y=y).release().perform() # long press
|
||||
action.tap(x=x + 50, y=y - 50).release().perform() # tap Paste
|
||||
action.move_by_offset(xoffset=x + 250, yoffset=y).click_and_hold().perform() # long press
|
||||
action.release(element).perform()
|
||||
action.move_by_offset(xoffset=x + 50, yoffset=y - 50).click().perform() # tap Paste
|
||||
action.release(element).perform()
|
||||
|
||||
def click_inside(self):
|
||||
action = TouchAction(self.driver)
|
||||
location = self.find_element().location
|
||||
x, y = location['x'], location['y']
|
||||
action.tap(x=x + 250, y=y).release().perform()
|
||||
action = ActionChains(self.driver)
|
||||
element = self.find_element()
|
||||
location = element.location
|
||||
x, y = location['x'] + 250, location['y']
|
||||
action.move_to_element_with_offset(to_element=element, xoffset=x, yoffset=y).click().perform()
|
||||
action.release(element).perform()
|
||||
|
||||
|
||||
class ChatView(BaseView):
|
||||
@ -1193,9 +1198,6 @@ class ChatView(BaseView):
|
||||
|
||||
def mention_user(self, user_name: str):
|
||||
self.driver.info("Mention user %s in the chat" % user_name)
|
||||
# gboard = self.driver.available_ime_engines[0]
|
||||
# self.driver.activate_ime_engine(gboard) # workaround to get mentions list expanded
|
||||
self.chat_message_input.click_inside()
|
||||
self.chat_message_input.send_keys("@")
|
||||
try:
|
||||
self.mentions_list.wait_for_element()
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 173 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@ -263,14 +263,20 @@ class SignInView(BaseView):
|
||||
# self.identifiers_button.wait_and_click(30)
|
||||
if enable_notifications:
|
||||
self.enable_notifications_button.wait_and_click()
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
for _ in range(3):
|
||||
self.allow_button.click_if_shown(sec=10)
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
self.enable_notifications_button.click_if_shown()
|
||||
if self.chats_tab.is_element_displayed():
|
||||
break
|
||||
else:
|
||||
self.maybe_later_button.wait_and_click()
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
for _ in range(3):
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
self.maybe_later_button.click_if_shown()
|
||||
if self.chats_tab.is_element_displayed():
|
||||
break
|
||||
self.chats_tab.wait_for_visibility_of_element(30)
|
||||
self.driver.info("## New multiaccount is created successfully!", device=False)
|
||||
return self.get_home_view()
|
||||
@ -292,14 +298,22 @@ class SignInView(BaseView):
|
||||
self.continue_button.click_until_presence_of_element(self.profile_title_input)
|
||||
self.set_profile(username, set_image)
|
||||
self.set_password(password)
|
||||
# if self.enable_biometric_maybe_later_button.is_element_displayed(10):
|
||||
# self.enable_biometric_maybe_later_button.click()
|
||||
# self.identifiers_button.wait_and_click(30)
|
||||
if enable_notifications:
|
||||
self.enable_notifications_button.click()
|
||||
self.enable_notifications_button.wait_and_click()
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
for _ in range(3):
|
||||
self.allow_button.click_if_shown(sec=10)
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
self.enable_notifications_button.click_if_shown()
|
||||
if self.chats_tab.is_element_displayed():
|
||||
break
|
||||
else:
|
||||
self.maybe_later_button.wait_and_click()
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
for _ in range(3):
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
self.maybe_later_button.click_if_shown()
|
||||
if self.chats_tab.is_element_displayed():
|
||||
break
|
||||
self.chats_tab.wait_for_visibility_of_element(30)
|
||||
self.driver.info("## Multiaccount is recovered successfully!", device=False)
|
||||
return self.get_home_view()
|
||||
|
Loading…
x
Reference in New Issue
Block a user