e2e: fixes and collectibles

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-10-15 12:26:36 +02:00
parent e2767ffce5
commit b9d5220da6
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
12 changed files with 126 additions and 62 deletions

View File

@ -90,27 +90,43 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(5346)
@marks.high
@marks.skip
#TODO: skipped due to bug on status-go, should be enabled after 12615 merge
def test_collectible_from_wallet(self):
passphrase = wallet_users['F']['passphrase']
home = SignInView(self.driver).recover_access(passphrase=passphrase)
profile = home.profile_button.click()
profile.switch_network()
wallet = profile.wallet_button.click()
home.just_fyi('Check that collectibles are not shown on Ropsten')
wallet = home.wallet_button.click()
wallet.scan_tokens()
wallet.accounts_status_account.click()
wallet.collectibles_button.click()
wallet.element_by_translation_id("display-collectibles").scroll_and_click()
if not wallet.element_by_translation_id("no-collectibles").is_element_displayed():
self.errors.append("Collectibles are shown on Ropsten network!")
wallet.just_fyi('Check collectibles amount in wallet')
wallet.element_by_translation_id("enable").scroll_and_click()
wallet.cryptokitties_in_collectibles_number.wait_for_visibility_of_element(30)
if wallet.cryptokitties_in_collectibles_number.text != '1':
profile = home.profile_button.click()
profile.switch_network()
profile.wallet_button.click()
wallet.accounts_status_account.click()
wallet.collectibles_button.click()
wallet.get_collectibles_amount().wait_for_visibility_of_element(30)
if wallet.get_collectibles_amount().text != '1':
self.errors.append(
'Wrong number is shown on CK assets: %s' % wallet.cryptokitties_in_collectibles_number.text)
# TODO: should be added check for that NFT image is shown after adding accessibility
'Wrong number is shown on CK assets: %s' % wallet.get_collectibles_amount().text)
wallet.get_collectibles_amount().click()
if not wallet.nft_asset_button.is_element_displayed():
self.driver.fail("Kitty is not shown after opening it from collectibles!")
wallet.nft_asset_button.click()
wallet.set_collectible_as_profile_photo_button.scroll_and_click()
web_view = wallet.get_base_web_view()
wallet.view_collectible_on_opensea_button.click_until_presence_of_element(web_view.browser_previous_page_button)
web_view.wait_for_d_aap_to_load()
if not web_view.element_by_text('Princess Gunklater').is_element_displayed(30):
self.errors.append("Collectible can't be opened when tapping 'View on OpenSea' via NFT page")
wallet.wallet_button.double_click()
wallet.just_fyi('Check that collectibles are not shown when sending assets from wallet')
wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.select_asset_button.click()
if send_transaction.asset_by_name("CryptoKitties").is_element_displayed():
@ -118,11 +134,15 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.close_send_transaction_view_button.double_click()
wallet.just_fyi('Check "Open in OpenSea" (that user is signed in)')
wallet.element_by_translation_id("check-on-opensea").click()
web_view = wallet.get_webview_view()
wallet.element_by_translation_id("check-on-opensea").click_until_presence_of_element((web_view.browser_previous_page_button))
web_view.wait_for_d_aap_to_load(10)
#wallet.swipe_by_custom_coordinates(0.5,0.8,0.5,0.7)
wallet.element_by_text('e2ecryptokitty').wait_for_element(60)
wallet.just_fyi("Check that custom image from collectible is set as profile photo")
wallet.profile_button.double_click()
if not profile.profile_picture.is_element_image_similar_to_template('collectible_pic.png'):
self.errors.append("Collectible image is not set as profile image")
self.errors.verify_no_errors()
@marks.testrail_id(5341)
@ -173,10 +193,9 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(5381)
@marks.high
@marks.skip
# TODO: enabling after adding NFT support on Rinkeby
def test_user_can_see_all_own_assets_after_account_recovering(self):
home = SignInView(self.driver).recover_access(wallet_users['E']['passphrase'])
def test_user_can_see_collectibles_on_rinkeby_after_account_recovering(self):
user = wallet_users['E']
home = SignInView(self.driver).recover_access(user['passphrase'])
profile = home.profile_button.click()
profile.switch_network('Rinkeby with upstream RPC')
profile = home.profile_button.click()
@ -184,10 +203,11 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.scan_tokens()
wallet.accounts_status_account.click()
wallet.collectibles_button.click()
if not wallet.element_by_text('KDO').is_element_displayed():
self.driver.fail('User collectibles token name in not shown')
if not wallet.element_by_text('1').is_element_displayed():
self.driver.fail('User collectibles amount does not match')
wallet.element_by_translation_id("display-collectibles").scroll_and_click()
for asset in user['collectibles']:
wallet.get_collectibles_amount(asset).scroll_to_element()
if wallet.get_collectibles_amount(asset).text != user['collectibles'][asset]:
self.errors.append('%s %s is not shown in Collectibles for Rinkeby!' % (user['collectibles'][asset], asset))
@marks.testrail_id(6224)
@marks.critical

View File

@ -76,8 +76,6 @@ class TestCommunitiesMultipleDevices(MultipleDeviceTestCase):
@marks.testrail_id(695845)
@marks.medium
@marks.skip
# TODO: blocked due to 12649
def test_notification_in_activity_center_for_mention_in_community_and_group_chat(self):
self.create_drivers(2)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
@ -104,7 +102,7 @@ class TestCommunitiesMultipleDevices(MultipleDeviceTestCase):
community_link_text = community_1.copy_community_link()
pub_1 = home_1.create_group_chat(user_names_to_add=[username_2], group_chat_name=pub_chat_name)
pub_2 = home_2.get_chat_from_home_view(pub_chat_name).click()
pub_2 = home_2.get_chat(pub_chat_name).click()
pub_2.join_chat_button.click()
pub_1.chat_message_input.paste_text_from_clipboard()
pub_1.send_message_button.click()
@ -131,14 +129,14 @@ class TestCommunitiesMultipleDevices(MultipleDeviceTestCase):
channel_2 = community_2.get_chat(channel_name).click()
channel_2.select_mention_from_suggestion_list(username_1, username_1[:2])
channel_2.send_as_keyevent("community")
channel_mesage = "@" + username_1 + " community"
channel_mesage = username_1 + " community"
channel_2.send_message_button.click()
community_1.home_button.double_click()
channel_2.home_button.click()
home_2.get_chat_from_home_view(pub_chat_name).click()
pub_2.select_mention_from_suggestion_list(username_1, username_1[:2])
pub_2.send_as_keyevent("group")
group_chat_message = "@" + username_1 + " group"
group_chat_message = username_1 + " group"
pub_2.send_message_button.click()
if not home_1.notifications_unread_badge.is_element_displayed():

View File

@ -16,6 +16,10 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
key_1, username_1 = device_1.get_public_key_and_username(True)
device_1.home_button.click()
chat_name = home_1.get_random_chat_name()
home_2.just_fyi('Add admin to contacts to see PN about group chat invite')
home_2.home_button.double_click()
home_2.add_contact(key_1)
home_1.plus_button.click()
home_1.just_fyi('Check default placeholder when trying to create group chat without contacts')
@ -29,8 +33,21 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2.home_button.click()
home_1.add_contact(key_2)
home_1.get_back_to_home_view()
home_2.put_app_to_background()
chat_1 = home_1.create_group_chat([username_2], chat_name)
home_2.just_fyi('check that PN invite to group chat is received and after tap you are redirected to group chat')
home_2.open_notification_bar()
pns = [chat_1.pn_invited_to_group_chat(username_1, chat_name), chat_1.pn_wants_you_to_join_to_group_chat(username_1, chat_name)]
for pn in pns:
if not home_2.element_by_text(pn).is_element_displayed(30):
self.errors.append('%s is not shown after invite to group chat' % pn)
if not home_2.pn_group_chat_invite_icon(pns[1]).is_element_displayed(30):
self.drivers[0].fail('No icon is shown for PN')
home_2.pn_group_chat_invite_icon(pns[1]).click()
home_2.element_by_text(chat_1.pn_invited_to_group_chat(username_1, chat_name))
create_system_message = chat_1.create_system_message(username_1, chat_name)
invite_system_message = chat_1.invite_system_message(username_1, username_2)
join_system_message = chat_1.join_system_message(username_2)

View File

@ -581,10 +581,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat_1.home_button.double_click()
chat_2.element_starts_with_text(url_message, 'button').click()
web_view = chat_2.open_in_status_button.click()
try:
web_view.element_by_text('Private, Secure Communication').find_element()
except TimeoutException:
self.errors.append('Device 2: URL was not opened from 1-1 chat')
if not web_view.element_by_text('Private, Secure Communication').is_element_displayed(60):
self.errors.append('URL was not opened from 1-1 chat')
home_2.dapp_tab_button.double_click()
chat_2.home_button.click()
@ -595,10 +593,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat_2.send_message(url_message)
chat_1.element_starts_with_text(url_message, 'button').click()
web_view = chat_1.open_in_status_button.click()
try:
web_view.element_by_text('Private, Secure Communication').find_element()
except TimeoutException:
self.errors.append('Device 1: URL was not opened from 1-1 chat')
if not web_view.element_by_text('Private, Secure Communication').is_element_displayed(60):
self.errors.append('URL was not opened from 1-1 chat')
home_1.home_button.click(desired_view='chat')
preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-react/pull/11707',
@ -607,7 +603,12 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
'yotube': {
'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
'txt': 'Status & Keycard Hardware-Enforced Security',
'subtitle': 'YouTube'}}
'subtitle': 'YouTube'},
'twitter':{
'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',
'txt': "We've rethought how we translate content, allowing us to translate",
'subtitle': 'Twitter'
}}
home_1.just_fyi("Check enabling and sending first gif")
giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
@ -623,7 +624,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
data = preview_urls[key]
chat_2.send_message(data['url'])
message = chat_1.get_preview_message_by_text(data['url'])
if message.preview_title.text != data['txt']:
if data['txt'] not in message.preview_title.text:
self.errors.append("Title '%s' does not match expected" % message.preview_title.text)
if message.preview_subtitle.text != data['subtitle']:
self.errors.append("Subtitle '%s' does not match expected" % message.preview_subtitle.text)

View File

@ -91,10 +91,10 @@ class TestUpgradeApplication(SingleDeviceTestCase):
public_chat = home.get_chat(markdown_name).click()
messages = pub_chat_data['markdown_text_messages']
public_chat.element_starts_with_text(messages[0]).scroll_to_element(10, 'up')
public_chat.element_starts_with_text('quoted').scroll_to_element()
for i in range(len(messages)):
if not public_chat.chat_element_by_text(messages[i]).is_element_displayed():
self.errors.append("Markdown message '%s' does not match expected" % messages[i])
public_chat.element_starts_with_text('quoted').scroll_to_element()
self.errors.append("Markdown message '%s' does not match expected in %s" % (messages[i], markdown_name))
public_chat.home_button.click()
home.just_fyi("Checking reactions, sticker, tag messages")
@ -112,13 +112,15 @@ class TestUpgradeApplication(SingleDeviceTestCase):
home.just_fyi("Checking reply to long messages and mentions")
mention = '#before-upgrade-2'
public_chat = home.get_chat(mention).click()
public_chat.scroll_to_start_of_history()
pub_chat_data = chats[mention]
public_replied_message = public_chat.chat_element_by_text(pub_chat_data['reply'])
public_replied_message.scroll_to_element()
if pub_chat_data['long'] not in public_replied_message.replied_message_text:
self.errors.append("Reply is not present in message received in public chat after upgrade")
self.errors.append("Reply is not present in message received in public chat %s after upgrade" % mention)
public_chat.element_starts_with_text(pub_chat_data['mention']).scroll_to_element()
if not public_chat.chat_element_by_text(pub_chat_data['mention']).is_element_displayed():
self.errors.append("Mention is not present in public chat after upgrade")
self.errors.append("Mention is not present in %s after upgrade" % mention)
home.home_button.click()
home.just_fyi("Checking collapsable messages")
@ -126,7 +128,7 @@ class TestUpgradeApplication(SingleDeviceTestCase):
public_chat = home.get_chat(long_name).click()
pub_chat_data = chats[long_name]
if not public_chat.chat_element_by_text(pub_chat_data['long']).uncollapse:
self.errors.append("No uncollapse icon on long message is shown!")
self.errors.append("No uncollapse icon on long message is shown in %s!" % long_name)
self.errors.verify_no_errors()
@ -416,10 +418,10 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
self.errors.append("Reply is not present in message received in group chat after upgrade")
if not chat_2.chat_element_by_text(messages['invite']).uncollapse:
self.errors.append("No uncollapse icon on long message is shown!")
resolved_ens = '@%s' % admin['ens']
resolved_ens = '@%s' % admin['ens_upgrade']
chat_2.chat_element_by_text(messages['text']).username.scroll_to_element(direction='up')
if chat_2.chat_element_by_text(messages['text']).username.text != resolved_ens:
self.errors.append("ENS is not resolved in group chat")
self.errors.append("ENS '%s' is not resolved in group chat '%s'" % (resolved_ens, chat_name))
[chat.home_button.click() for chat in [chat_1, chat_2]]
home_1.just_fyi("Check that can join group chat after upgrade")
@ -427,11 +429,11 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
invite_message = chat_1.invite_system_message(resolved_ens, member['username'])
[chat_1, chat_2] = [home.get_chat(chat_name).click() for home in (home_1, home_2)]
if not chat_2.chat_element_by_text(invite_message).is_element_displayed():
self.errors.append("System message is not shown after upgrade")
self.errors.append("'%s' is not shown after upgrade in '%s'" % (invite_message, chat_name))
chat_2.join_chat_button.click()
joined_system_message = chat_1.join_system_message(member['username'])
if not chat_1.chat_element_by_text(joined_system_message).is_element_displayed(30):
self.errors.append("System message is not shown after user was joined")
self.errors.append("'%s' is not shown after user was joined in '%s'" % (joined_system_message, chat_name))
[chat.home_button.double_click() for chat in [chat_1, chat_2]]
home_2.just_fyi("Check that removed member can't send messages")

View File

@ -12,6 +12,7 @@ ens_user['username'] = "Legal Vibrant Indianabat"
ens_user['public_key'] = "0x04359bb3e73cba0b815d71e562670ad00bb5d2db0d16cd1c4c92c668b61fde2274d6e487fcdffe66f913b3fea2a" \
"3058f53ce7946c2b501aa61a9ca8a883df72dc9"
ens_user['ens'] = 'statuse2e.eth'
ens_user['ens_upgrade'] = 'statuse2e'
ens_user['ens_another'] = 'status-another-ens-e2e.eth'
ens_user['address'] = '0x1eE3058Bd300246B4B20E687Efc9Eba81FF7814b'
@ -83,7 +84,12 @@ wallet_users['E']['username'] = "Wry Shiny Damselfly"
wallet_users['E']['address'] = "0x3e2e4077753d3c229a9ae332b9ca46958945e2f6"
wallet_users['E']['public_key'] = "0x044cf0620ec3ea0aba9fb0e19cb42a6fbd6b4e74f234f0da82580564817b238cc6434745d31" \
"fa1649927ba48adfa7c95991fd51940bc00a71e80b095db5b107f1b"
wallet_users['E']['collectibles'] = {
'Coins & Steel Exclusive Item Skin V2' : '1',
'Coins & Steel Founder Aura' : '2',
'CryptoKittiesRinkeby' : '2',
'KudosToken V7' : '1',
}
wallet_users['F'] = dict()
wallet_users['F']['passphrase'] = "jazz human replace save wreck merry evolve oval black expose clutch sword"
wallet_users['F']['username'] = "Dual Sour Galapagostortoise"

View File

@ -738,18 +738,18 @@ class ChatView(BaseView):
self.add_button.click()
def get_user_options(self, username: str):
self.driver.info("**Get user options for %s**" % username)
self.driver.info("**Get user options for** %s" % username)
self.chat_options.click()
group_info_view = self.group_info.click()
group_info_view.get_username_options(username).click()
return self
def chat_element_by_text(self, text):
self.driver.info("**Looking for a message by text: %s**" % text)
self.driver.info("**Looking for a message by text:** %s" % text)
return ChatElementByText(self.driver, text)
def verify_message_is_under_today_text(self, text, errors):
self.driver.info("**Veryfying that '%s' is under today**" % text)
self.driver.info("**Verifying that '%s' is under today**" % text)
message_element = self.chat_element_by_text(text)
message_element.wait_for_visibility_of_element()
message_location = message_element.find_element().location['y']
@ -969,4 +969,13 @@ class ChatView(BaseView):
@staticmethod
def changed_group_name_system_message(admin, chat_name):
return "%s changed the group's name to %s" % (admin, chat_name)
return "%s changed the group's name to %s" % (admin, chat_name)
### Push notifications
@staticmethod
def pn_invited_to_group_chat(admin, chat_name):
return '%s invited you to %s' % (admin, chat_name)
@staticmethod
def pn_wants_you_to_join_to_group_chat(admin, chat_name):
return '%s wants you to join group %s' % (admin, chat_name)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -186,7 +186,7 @@ class HomeView(BaseView):
break
def get_chat(self, username, community=False):
self.driver.info("**Looking for chat '%s'**" % username)
self.driver.info("**Looking for chat:** '%s'" % username)
chat_element = ChatElement(self.driver, username[:25], community=community)
if not chat_element.is_element_displayed():
self.notifications_unread_badge.wait_and_click(30)
@ -197,12 +197,12 @@ class HomeView(BaseView):
return chat_element
def get_chat_from_home_view(self, username):
self.driver.info("**Looking for chat '%s'**" % username)
self.driver.info("**Looking for chat:** '%s'" % username)
chat_element = ChatElement(self.driver, username[:25])
return chat_element
def get_chat_from_activity_center_view(self, chat_name):
self.driver.info("**Looking for chat '%s'**" % chat_name)
self.driver.info("**Looking for chat:** '%s'" % chat_name)
chat_element = ActivityCenterChatElement(self.driver, chat_name[:25])
return chat_element
@ -305,4 +305,8 @@ class HomeView(BaseView):
self.get_chat(username).long_press_element()
self.clear_history_button.click()
from views.chat_view import ChatView
ChatView(self.driver).clear_button.click()
ChatView(self.driver).clear_button.click()
def pn_group_chat_invite_icon(self, pn_text):
self.driver.info("**Getting PN icon for group chat invite: %s**" % pn_text)
return SilentButton(self.driver, xpath="//*[@text='%s']/../../../*[@resource-id='android:id/right_icon_container']" % pn_text)

View File

@ -176,8 +176,8 @@ class SignInView(BaseView):
if not second_user:
self.accept_tos_checkbox.click()
self.get_started_button.click()
self.generate_key_button.click_until_presence_of_element(self.next_button)
if self.generate_key_button.is_element_displayed():
self.generate_key_button.click()
if not self.next_button.is_element_displayed():
[button.click() for button in [self.accept_tos_checkbox, self.get_started_button,self.generate_key_button]]
self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
if keycard:
@ -232,7 +232,7 @@ class SignInView(BaseView):
return self.get_home_view()
def sign_in(self, password=common_password, keycard=False, position=1):
self.driver.info("**Sign in (password:%s, keycard:%s)**" % (password, str(keycard)))
self.driver.info("**Sign in** (password:%s, keycard:%s)" % (password, str(keycard)))
if self.multi_account_on_login_button.is_element_displayed(30):
self.get_multiaccount_by_position(position).click()

View File

@ -108,8 +108,6 @@ class WalletView(BaseView):
# elements for multiaccount
self.multiaccount_more_options = Button(self.driver, accessibility_id="accounts-more-options")
self.accounts_status_account = AccountElementButton(self.driver, account_name=self.status_account_name)
self.collectibles_button = Button(self.driver, translation_id="wallet-collectibles")
self.cryptokitties_in_collectibles_number = Text(self.driver, xpath="//*[@text='CryptoKitties']//following-sibling::android.widget.TextView")
self.set_currency_button = Button(self.driver, translation_id="set-currency")
self.add_account_button = Button(self.driver, accessibility_id="add-new-account")
self.generate_an_account_button = Button(self.driver, accessibility_id="add-account-sheet-generate")
@ -129,6 +127,12 @@ class WalletView(BaseView):
self.close_send_transaction_view_button = Button(self.driver, xpath="//androidx.appcompat.widget.LinearLayoutCompat")
self.hide_account_button = Button(self.driver, accessibility_id="hide-account-button")
#collectibles
self.collectibles_button = Button(self.driver, translation_id="wallet-collectibles")
self.nft_asset_button = Button(self.driver, accessibility_id="nft-asset")
self.set_collectible_as_profile_photo_button = Button(self.driver, accessibility_id="set-nft-as-pfp")
self.view_collectible_on_opensea_button = Button(self.driver, translation_id="view-on-opensea")
# individual account settings
self.account_settings_button = Button(self.driver, translation_id="account-settings")
self.apply_settings_button = Button(self.driver, translation_id="apply")
@ -321,11 +325,11 @@ class WalletView(BaseView):
desired_currency.click()
def get_account_by_name(self, account_name: str):
self.driver.info("**Getting account '%s'**" % account_name)
self.driver.info("**Getting account:** %s'" % account_name)
return AccountElementButton(self.driver, account_name)
def add_account(self, account_name: str, password: str = common_password, keycard=False):
self.driver.info("**Adding account '%s'**" % account_name)
self.driver.info("**Adding account:** '%s'" % account_name)
self.add_account_button.click()
self.generate_an_account_button.click()
self.account_name_input.send_keys(account_name)
@ -337,3 +341,6 @@ class WalletView(BaseView):
else:
self.enter_your_password_input.send_keys(password)
self.add_account_generate_account_button.click()
def get_collectibles_amount(self, collectibles='CryptoKitties'):
return Text(self.driver,xpath="//*[@text='%s']//following-sibling::android.widget.TextView" % collectibles)

View File

@ -10,7 +10,7 @@ class BaseWebView(BaseView):
self.progress_bar_icon = Button(self.driver, xpath="//android.widget.ProgressBar")
self.url_edit_box_lock_icon = Button(self.driver, xpath="'(//android.view.ViewGroup[@content-desc='icon'])[2]")
self.policy_summary = Button(self.driver, xpath="//*[@content-desc='Status Privacy Policy'] | //*[@text='Status Privacy Policyy']")
self.policy_summary = Button(self.driver, xpath="//*[@content-desc='Status Privacy Policy'] | //*[@text='Status Privacy Policy']")
self.terms_of_use_summary = Button(self.driver, xpath="//*[@content-desc='Status App Terms of Use']")
self.browser_previous_page_button = Button(self.driver, accessibility_id="previous-page-button")