3 new e2e

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-05-08 15:36:05 +02:00
parent c8b5e39dc1
commit 607facab2a
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
9 changed files with 101 additions and 6 deletions

View File

@ -139,13 +139,21 @@ class TestWalletManagement(SingleDeviceTestCase):
profile.switch_network('Mainnet with upstream RPC')
wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
asset_name = 'CryptoKitties'
wallet.select_asset(asset_name)
assets = ['CryptoKitties', 'CryptoStrikers', 'EtheremonAsset']
for asset in assets:
wallet.select_asset(asset)
wallet.accounts_status_account.click()
wallet.collectibles_button.click()
for asset in assets:
if not wallet.element_by_text(asset).is_element_displayed():
self.errors.append('Assets are not shown in Collectibles after adding')
wallet.transaction_history_button.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.select_asset_button.click()
if send_transaction.asset_by_name(asset_name).is_element_displayed():
self.driver.fail('Collectibles can be sent from wallet')
for asset in assets:
if send_transaction.asset_by_name(asset).is_element_displayed():
self.errors.append('Collectibles can be sent from wallet')
self.errors.verify_no_errors()
@marks.testrail_id(5467)
@marks.medium

View File

@ -575,3 +575,51 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
self.errors.append("Reply is not present in message received in public chat")
self.errors.verify_no_errors()
@marks.testrail_id(6267)
@marks.medium
def test_open_user_profile_long_press_on_message(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
message_from_sender = "Message sender"
message_from_receiver = "Message receiver"
home_1, home_2 = device_1.create_user(), device_2.create_user()
device_1.just_fyi('Both devices join to 1-1 chat')
device_2_public_key = home_2.get_public_key_and_username()
device_1_profile = home_1.profile_button.click()
device_1_username = device_1_profile.default_username_text.text
home_1.home_button.click()
device_1.just_fyi("1-1 chat: sender adds receiver and send a message")
device_1_chat = home_1.add_contact(device_2_public_key)
device_1_chat.send_message(message_from_sender)
device_1_chat.chat_element_by_text(message_from_sender).long_press_element()
if device_1_chat.view_profile_button.is_element_displayed():
self.errors.append('1-1 chat: "view profile" is shown on long tap on sent message')
device_1_chat.get_back_to_home_view()
device_2.just_fyi("1-1 chat: receiver verifies that can open sender profile on long tap on message")
home_2.home_button.click()
device_2_chat_item = home_2.get_chat(device_1_username)
device_2_chat_item.wait_for_visibility_of_element(20)
device_2_chat = device_2_chat_item.click()
device_2_chat.view_profile_long_press(message_from_sender)
if not device_2_chat.profile_add_to_contacts.is_element_displayed():
self.errors.append('1-1 chat: another user profile is not opened on long tap on received message')
device_2_chat.get_back_to_home_view()
device_1.just_fyi('Public chat: send message and verify that user profile can be opened on long press on message')
chat_name = device_1.get_random_chat_name()
for home in home_1, home_2:
home.join_public_chat(chat_name)
chat_public_1, chat_public_2 = home_1.get_chat_view(), home_2.get_chat_view()
chat_public_2.send_message(message_from_receiver)
chat_public_2.chat_element_by_text(message_from_receiver).long_press_element()
if chat_public_2.view_profile_button.is_element_displayed():
self.errors.append('Public chat: "view profile" is shown on long tap on sent message')
chat_public_1.view_profile_long_press(message_from_receiver)
if not chat_public_1.remove_from_contacts.is_element_displayed():
self.errors.append('Public chat: another user profile is not opened on long tap on received message')
self.errors.verify_no_errors()

View File

@ -1,5 +1,5 @@
import pytest
from tests import marks, connection_not_secure_text, connection_is_secure_text
from tests import marks, connection_not_secure_text, connection_is_secure_text, test_dapp_url
from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView
from views.dapps_view import DappsView
@ -160,3 +160,27 @@ class TestBrowsing(SingleDeviceTestCase):
status_test_dapp.find_full_text('Sign message')
status_test_dapp.browser_refresh_page_button.click()
status_test_dapp.find_full_text('defaultAccount')
@marks.testrail_id(5456)
@marks.medium
def test_can_access_images_by_link(self):
urls = {
'https://cdn.dribbble.com/users/45534/screenshots/3142450/logo_dribbble.png':
'url_1.png',
'https://thebitcoinpub-91d3.kxcdn.com/uploads/default/original/2X/d/db97611b41a96cb7642b06636b82c0800678b140.jpg':
'url_2.png',
'https://steemitimages.com/DQmYEjeBuAKVRa3b3ZqwLicSHaPUm7WFtQqohGaZdA9ghjx/images%20(4).jpeg':
'url_3.png'
}
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.create_user()
dapp_view = home_view.dapp_tab_button.click()
for url in urls:
self.driver.set_clipboard_text(url)
dapp_view.enter_url_editbox.click()
dapp_view.paste_text()
dapp_view.confirm()
dapp_view.progress_bar.wait_for_invisibility_of_element(20)
if not dapp_view.web_page.is_element_image_equals_template(urls[url]):
self.driver.fail('Web page does not match expected template %s' % urls[url])
dapp_view.cross_icon.click()

View File

@ -55,8 +55,10 @@ class TestDeepLinks(SingleDeviceTestCase):
except NoSuchElementException:
self.driver.fail("DApp '%s' is not opened!" % dapp_name)
# TODO: skipped due to #10495
@marks.testrail_id(5780)
@marks.medium
@marks.skip
def test_open_own_user_profile_using_deep_link(self):
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(passphrase=basic_user['passphrase'])

View File

@ -659,6 +659,11 @@ class ChatView(BaseView):
self.chat_element_by_text(message).long_press_element()
self.reply_message_button.click()
def view_profile_long_press(self, message = str):
self.chat_element_by_text(message).long_press_element()
self.view_profile_button.click()
self.profile_block_contact.wait_for_visibility_of_element(5)
def move_to_messages_by_time_marker(self, marker='Today'):
self.driver.info("Moving to messages by time marker: '%s'" % marker)
HistoryTimeMarker(self.driver, marker).scroll_to_element(depth=50, direction='up')

View File

@ -1,4 +1,4 @@
from views.base_element import BaseButton, BaseEditBox
from views.base_element import BaseButton, BaseEditBox, BaseElement
from views.base_view import BaseView
from views.home_view import ChatElement
@ -82,6 +82,13 @@ class CrossCloseWeb3PermissionButton(BaseButton):
self.locator = self.Locator.xpath_selector(
'//*[contains(@text,"ÐApps can access")]/../android.view.ViewGroup[1]/android.view.ViewGroup')
class WebViewPageElement(BaseElement):
def __init__(self, driver):
super(WebViewPageElement, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//android.webkit.WebView)[1]')
class DappsView(BaseView):
def __init__(self, driver):
@ -89,6 +96,7 @@ class DappsView(BaseView):
self.enter_url_editbox = EnterUrlEditbox(self.driver)
self.discover_dapps_button = DiscoverDappsButton(self.driver)
self.web_page = WebViewPageElement(self.driver)
#ens dapp
self.ens_name = EnsName(self.driver)

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB