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

Fixes for screen where user locks network amounts to send #20519

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Jun 20, 2024

fixes #20497
fixes #20496
fixes #20498

Summary

  • long press no more active on disabled router paths
  • input field in drawer has initial value
  • error message shown when input field contains valuer bigger than input field on send page
Screen.Recording.2024-06-20.at.19.32.48.mov

Areas that maybe impacted

Functional
  • wallet / transactions

status: ready

@vkjr vkjr self-assigned this Jun 20, 2024
@vkjr vkjr requested a review from J-Son89 June 20, 2024 18:40
@status-github-bot status-github-bot bot added this to REVIEW in Pipeline for QA Jun 20, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Jun 20, 2024

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8d0a220 #1 2024-06-20 18:44:28 ~4 min tests 📄log
✔️ 8d0a220 #1 2024-06-20 18:46:31 ~6 min android-e2e 🤖apk 📲
✔️ 8d0a220 #1 2024-06-20 18:46:31 ~6 min android 🤖apk 📲
✔️ 8d0a220 #1 2024-06-20 18:57:16 ~16 min ios 📱ipa 📲
✔️ 1246e93 #2 2024-06-24 15:57:09 ~4 min tests 📄log
✔️ 1246e93 #2 2024-06-24 15:59:08 ~6 min android 🤖apk 📲
✔️ 1246e93 #2 2024-06-24 15:59:33 ~7 min android-e2e 🤖apk 📲
✔️ 1246e93 #2 2024-06-24 16:03:40 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4e15db0 #3 2024-06-25 14:15:19 ~6 min tests 📄log
✔️ 4e15db0 #3 2024-06-25 14:15:57 ~6 min android-e2e 🤖apk 📲
✔️ 4e15db0 #3 2024-06-25 14:16:37 ~7 min android 🤖apk 📲
✔️ 4e15db0 #3 2024-06-25 14:19:08 ~10 min ios 📱ipa 📲
✔️ fb39d6a #4 2024-06-28 19:48:54 ~4 min tests 📄log
✔️ fb39d6a #4 2024-06-28 19:50:52 ~6 min android 🤖apk 📲
✔️ fb39d6a #4 2024-06-28 19:51:44 ~7 min android-e2e 🤖apk 📲
✔️ fb39d6a #4 2024-06-28 19:54:21 ~9 min ios 📱ipa 📲

@@ -366,7 +366,7 @@
:on-token-press show-select-asset-sheet}]
[routes/view
{:token token-by-symbol
:input-value input-amount
:send-amount-in-crypto amount-in-crypto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

send-amount-in-crypto-bn (money/bignumber send-amount-in-crypto)
lock-higher-than-send-amount? (if (and (money/bignumber? amount-in-crypto-bn)
(money/bignumber?
send-amount-in-crypto-bn))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find -bn to be a bit more confusing. Can we name it something else? perhaps we can just pass it as that? 🤔

@@ -186,6 +198,12 @@
:show-keyboard? false
:value (controlled-input/input-value input-state)
:on-swap swap-between-fiat-and-crypto}]
(when lock-higher-than-send-amount?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is lock-higher than. should be like locked-greater-then-send-amount? ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

:disabled
:else type)]
[rn/view
{:key (str (if receiver? "to" "from") "-" chain-id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to and "from" should be i18n labels, no? perhaps they both should take this chain-id as a param too so they're translatable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is :key, so it is probably unimportant. Moreover, we aren't sure how react will work with translated keys)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I missed that

@@ -2709,5 +2709,6 @@
"not-enough-assets": "Not enough assets to pay gas fees",
"send-from-network" : "Send from {{network}}",
"define-amount-sent-from-network" : "Define amount sent from {{network}} network",
"dont-auto-recalculate-network": "Don't auto recalculate {{network}}"
"dont-auto-recalculate-network": "Don't auto recalculate {{network}}",
"value-higher-than-send-amount": "This value is higher than entered send amount"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this text looks a bit off, perhaps we revisit? 🤔
i.e "This value is higher than entered send amount"

should be like?

"This value is higher than entered amount to send" ??

@vkjr vkjr force-pushed the fixes-for-amount-locking branch from 8d0a220 to 1246e93 Compare June 24, 2024 15:51
@vkjr vkjr moved this from REVIEW to E2E Tests in Pipeline for QA Jun 24, 2024
Copy link
Contributor

@ulisesmac ulisesmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Comment on lines 140 to 147
locked-greater-then-send-amount? (let [amount (money/bignumber
amount-in-crypto)
send-amount (money/bignumber
send-amount-in-crypto)]
(if (and (money/bignumber? amount)
(money/bignumber? send-amount))
(money/greater-than amount send-amount)
false))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this if can be simplified to just use the and:

(and (money/bignumber? amount)
     (money/bignumber? send-amount)
     (money/greater-than amount send-amount))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, thanks!

Comment on lines 246 to 247
(map-indexed (fn [index {:keys [chain-id total-amount type]}]
[rn/view
{:key (str (if receiver? "to" "from") "-" chain-id)
:style {:margin-top (if (pos? index) 11 7.5)}}
[quo/network-bridge
{:amount (if (= type :not-available)
(i18n/label :t/not-available)
(str total-amount " " token-symbol))
:network (network-utils/id->network chain-id)
:status (cond (and (= type :not-available)
loading-routes?
token-not-supported-in-receiver-networks?)
:loading
(= type :not-available)
:disabled
:else type)
:on-press #(when (not loading-routes?)
(cond
(= type :edit)
(open-preferences)
on-press (on-press chain-id total-amount)))
:on-long-press #(when (not loading-routes?)
(cond
(= type :add)
(open-preferences)
on-long-press (on-long-press chain-id)))}]])
(let [status (cond (and (= type :not-available)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to destructure type using other name, I've seen many errors due to override clojure.core fns, such as name, key or type

@status-im-auto
Copy link
Member

80% of end-end tests have passed

Total executed tests: 51
Failed tests: 6
Expected to fail tests: 4
Passed tests: 41
IDs of failed tests: 727230,702958,702731,702957,727229,703503 
IDs of expected to fail tests: 702948,703629,727232,703495 

Failed tests (6)

Click to expand
  • Rerun failed tests

  • Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Device 1: Find `Button` by `xpath`: `//*[@content-desc='pins-count']//android.widget.TextView`
    Device 1: Find `Button` by `xpath`: `//*[@content-desc='pins-count']//android.widget.TextView`

    critical/chats/test_1_1_public_chats.py:198: in test_1_1_chat_pin_messages
        chat.pinned_messages_count.wait_for_element_text(text="2",
    ../views/base_element.py:190: in wait_for_element_text
        self.driver.fail(message if message else "`%s` is not equal to expected `%s` in %s sec" % (
    base_test_case.py:178: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Pinned messages count is not 2 as expected!
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 1: Find Button by accessibility id: top-bar
    Device 2: Find Button by accessibility id: top-bar

    critical/test_wallet.py:173: in test_wallet_send_asset_from_drawer
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.0007798925 but expected to be 0.0008166833
    E    Receiver balance is not updated on Etherscan, it is 0.0037 but expected to be 0.0036999999999999997
    



    2. test_wallet_send_eth, id: 727229

    Device 1: Find Button by accessibility id: top-bar
    Device 2: Find Button by accessibility id: top-bar

    critical/test_wallet.py:147: in test_wallet_send_eth
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.0009166833 but expected to be 0.0009581279999999999
    E    Can't find the last transaction for the receiver
    



    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Find Button by accessibility id: communities-home-discover-card
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:261: in test_community_discovery
        self.home.community_card_item.wait_for_elements(seconds=120)
    ../views/base_element.py:138: in wait_for_elements
        raise TimeoutException(
     Device 1:  BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_elements
    



    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    Test setup failed: activity_center/test_activity_center.py:414: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:425: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    2. test_activity_center_mentions, id: 702957

    Device 2: Find LogInButton by accessibility id: login-button
    Device 2: Tap on found: LogInButton

    Test setup failed: activity_center/test_activity_center.py:414: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:425: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Expected to fail tests (4)

    Click to expand

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'#cats')]
    Device 2: Looking for a message by text: it is just a message text

    critical/chats/test_public_chat_browsing.py:1124: in test_community_hashtag_links_to_community_channels
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message in community channel is not visible for user before join 
    

    [[Can't enter channel after community is fetched for the first time, https://github.com//issues/20395]]

    Device sessions

    2. test_community_join_when_node_owner_offline, id: 703629

    Device 2: Looking for community: 'open community'
    Device 2: Click until Text by accessibility id: community-description-text will be presented

    critical/chats/test_public_chat_browsing.py:1212: in test_community_join_when_node_owner_offline
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message in community channel is not visible for user before join, it was indicated as not sent for the sender before he went offline 
    

    [[Can't enter channel after community is fetched for the first time, https://github.com//issues/20395]]

    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Text is 0x8d2413447ff297d30bdc475f6d5cb00254685aae
    Device 1: Click system back button

    critical/test_wallet.py:256: in test_wallet_add_remove_watch_only_account
        self.home_view.driver.fail(
    base_test_case.py:178: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Incorrect address '0x8d2413447ff297d30bdc475f6d5cb00254685aae' is shown when swiping between accounts, expected one is '0x8d2413447ff297d30bdc475f6d5cb00254685aae' 
    

    [[Missing networks in account address, https://github.com//issues/20166]]

    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495

    # STEP: Change device time so chat will be unmuted by timer
    Device 2: Long press on ChatElement

    critical/chats/test_group_chat.py:497: in test_group_chat_mute_chat
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Chat is still muted after timeout 
    

    [[Chat is not unmuted after expected time: https://github.com//issues/19627]]

    Device sessions

    Passed tests (41)

    Click to expand

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    5. test_community_unread_messages_badge, id: 702841
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    9. test_community_one_image_send_reply, id: 702859
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_mentions_push_notification, id: 702786
    Device sessions

    3. test_community_markdown_support, id: 702809
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855
    Device sessions

    2. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    5. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    6. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    7. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    3. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    4. test_community_undo_delete_message, id: 702869
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    3. test_add_contact_field_validation, id: 702777
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    4. test_group_chat_pin_messages, id: 702732
    Device sessions

    5. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_deep_links, id: 702775
    Device sessions

    2. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    @vkjr vkjr force-pushed the fixes-for-amount-locking branch from 1246e93 to 4e15db0 Compare June 25, 2024 14:08
    @VolodLytvynenko VolodLytvynenko self-assigned this Jun 26, 2024
    @VolodLytvynenko VolodLytvynenko moved this from E2E Tests to IN TESTING in Pipeline for QA Jun 26, 2024
    @VolodLytvynenko
    Copy link
    Contributor

    @vkjr Thank you for PR. Just a few issues are found

    ISSUE 1: Checkbox not checked after value removal in assets customization drawer

    Steps:

    1. Go to the routes generation page
    2. Enter any value to build the routes
    3. Long tap the network
    4. Remove some last digits in the predefined value

    Actual result:

    The checkbox is still shown as unchecked

    checkbox.mp4

    Expected result:

    The checkbox should be checked after any updates are made in the drawer, including the removal of the value

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Jun 26, 2024

    PR_ISSUE 2: Predefined value not refreshed in drawer after asset change

    Steps:

    1. Build a route on the routes generation page.
    2. Long press the network and set up any value.
    3. Change the asset.
    4. Enter new value to build the routes
    5. Long press the network again.

    Actual result:

    The previous value is predefined

    change_asset.mp4

    Expected result:

    The previous value should be refreshed after the asset is changed.

    OS:

    IOS, Android

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    @VolodLytvynenko
    Copy link
    Contributor

    this issue is also present in develop. Could you fix this in the scope of the current PR? If not, I can create it separately

    ISSUE 3: Wrong UI of checkbox after unchecking

    Steps:

    Unfortunately, there are no exact steps to reproduce this issue, but it happens very often. Just try to check and uncheck the checkbox a few times to reproduce it successfully.

    Actual result:

    The UI of the checkbox is wrong after unchecking.

    checbox2.mp4

    Expected result:

    The UI of the checkbox should not be broken after unchecking.

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    @VolodLytvynenko VolodLytvynenko moved this from IN TESTING to CONTRIBUTOR in Pipeline for QA Jun 26, 2024
    @vkjr
    Copy link
    Contributor Author

    vkjr commented Jun 27, 2024

    @VolodLytvynenko, thanks for the findings!

    @vkjr vkjr force-pushed the fixes-for-amount-locking branch from 4e15db0 to fb39d6a Compare June 28, 2024 19:44
    @vkjr
    Copy link
    Contributor Author

    vkjr commented Jun 28, 2024

    @VolodLytvynenko, all issues should be resolved now)

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Pipeline for QA
      
    CONTRIBUTOR
    5 participants