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

Swaps: Asset to Pay / Asset to Receive #21140

Merged
merged 10 commits into from
Sep 27, 2024
Merged

Swaps: Asset to Pay / Asset to Receive #21140

merged 10 commits into from
Sep 27, 2024

Conversation

alwx
Copy link
Contributor

@alwx alwx commented Aug 28, 2024

fixes #20332
fixes #20333

Summary

Adds sheets for both "Asset to pay" and "Asset to receive"

Platforms

  • Android
  • iOS

status: ready

@alwx alwx self-assigned this Aug 28, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Aug 28, 2024

Jenkins Builds

Click to see older builds (114)
Commit #️⃣ Finished (UTC) Duration Platform Result
2ea82bd #1 2024-08-28 14:31:48 ~6 min tests 📄log
✔️ 2ea82bd #1 2024-08-28 14:35:17 ~9 min android-e2e 🤖apk 📲
✔️ 2ea82bd #1 2024-08-28 14:36:46 ~10 min android 🤖apk 📲
✔️ 2ea82bd #1 2024-08-28 15:08:57 ~43 min ios 📱ipa 📲
966bc97 #2 2024-08-29 13:23:21 ~2 min tests 📄log
✔️ 966bc97 #2 2024-08-29 13:27:07 ~6 min android-e2e 🤖apk 📲
✔️ 966bc97 #2 2024-08-29 13:27:30 ~6 min android 🤖apk 📲
966bc97 #2 2024-08-29 13:30:33 ~9 min ios 📄log
29ecd46 #3 2024-08-29 13:40:23 ~8 min tests 📄log
✔️ 29ecd46 #3 2024-08-29 13:41:35 ~9 min ios 📱ipa 📲
✔️ 29ecd46 #3 2024-08-29 13:44:26 ~12 min android-e2e 🤖apk 📲
✔️ 29ecd46 #3 2024-08-29 13:46:30 ~14 min android 🤖apk 📲
63c18d4 #4 2024-08-30 15:11:01 ~3 min tests 📄log
✔️ 63c18d4 #4 2024-08-30 15:15:16 ~7 min android-e2e 🤖apk 📲
✔️ 63c18d4 #4 2024-08-30 15:15:57 ~8 min android 🤖apk 📲
✔️ 63c18d4 #4 2024-08-30 15:16:55 ~9 min ios 📱ipa 📲
306115a #5 2024-09-04 13:08:37 ~2 min tests 📄log
✔️ 306115a #5 2024-09-04 13:13:13 ~7 min android-e2e 🤖apk 📲
✔️ 306115a #5 2024-09-04 13:13:33 ~7 min android 🤖apk 📲
✔️ 306115a #5 2024-09-04 13:16:56 ~11 min ios 📱ipa 📲
de3d5b4 #8 2024-09-06 13:27:09 ~2 min tests 📄log
✔️ de3d5b4 #8 2024-09-06 13:30:57 ~6 min android-e2e 🤖apk 📲
✔️ de3d5b4 #8 2024-09-06 13:31:27 ~6 min android 🤖apk 📲
✔️ de3d5b4 #8 2024-09-06 13:35:08 ~10 min ios 📱ipa 📲
ccc04e4 #9 2024-09-06 18:49:18 ~2 min tests 📄log
✔️ ccc04e4 #9 2024-09-06 18:54:19 ~7 min android-e2e 🤖apk 📲
✔️ ccc04e4 #9 2024-09-06 18:54:32 ~7 min android 🤖apk 📲
✔️ ccc04e4 #9 2024-09-06 18:59:28 ~12 min ios 📱ipa 📲
6c706ab #10 2024-09-06 19:05:13 ~2 min tests 📄log
✔️ 6c706ab #10 2024-09-06 19:09:12 ~6 min android 🤖apk 📲
✔️ 6c706ab #10 2024-09-06 19:09:50 ~7 min android-e2e 🤖apk 📲
✔️ 6c706ab #10 2024-09-06 19:15:46 ~13 min ios 📱ipa 📲
f1a2576 #11 2024-09-08 13:04:35 ~3 min tests 📄log
✔️ f1a2576 #11 2024-09-08 13:08:24 ~6 min android-e2e 🤖apk 📲
✔️ f1a2576 #11 2024-09-08 13:09:20 ~7 min android 🤖apk 📲
e9f6227 #12 2024-09-08 13:13:38 ~2 min tests 📄log
✔️ e9f6227 #12 2024-09-08 13:18:06 ~7 min android-e2e 🤖apk 📲
✔️ e9f6227 #12 2024-09-08 13:18:14 ~7 min android 🤖apk 📲
✔️ e9f6227 #12 2024-09-08 13:21:02 ~10 min ios 📱ipa 📲
7ea1adc #13 2024-09-09 08:19:41 ~2 min tests 📄log
✔️ 7ea1adc #13 2024-09-09 08:24:18 ~7 min android-e2e 🤖apk 📲
✔️ 7ea1adc #13 2024-09-09 08:24:43 ~7 min android 🤖apk 📲
✔️ 7ea1adc #13 2024-09-09 08:26:43 ~9 min ios 📱ipa 📲
bcdc558 #14 2024-09-09 09:44:53 ~2 min tests 📄log
✔️ bcdc558 #14 2024-09-09 09:49:24 ~7 min android-e2e 🤖apk 📲
✔️ bcdc558 #14 2024-09-09 09:49:50 ~7 min android 🤖apk 📲
✔️ bcdc558 #14 2024-09-09 09:51:43 ~9 min ios 📱ipa 📲
9a210d4 #15 2024-09-12 09:27:30 ~2 min tests 📄log
✔️ 9a210d4 #15 2024-09-12 09:32:26 ~7 min android-e2e 🤖apk 📲
✔️ 9a210d4 #15 2024-09-12 09:33:54 ~9 min android 🤖apk 📲
✔️ 9a210d4 #15 2024-09-12 09:38:25 ~13 min ios 📱ipa 📲
dbe880a #16 2024-09-13 08:28:48 ~2 min tests 📄log
✔️ dbe880a #16 2024-09-13 08:33:22 ~7 min android-e2e 🤖apk 📲
✔️ dbe880a #16 2024-09-13 08:33:46 ~7 min android 🤖apk 📲
✔️ dbe880a #16 2024-09-13 08:36:45 ~10 min ios 📱ipa 📲
4534d55 #17 2024-09-13 16:31:57 ~2 min tests 📄log
✔️ 4534d55 #17 2024-09-13 16:36:33 ~7 min android-e2e 🤖apk 📲
✔️ 4534d55 #17 2024-09-13 16:36:55 ~7 min android 🤖apk 📲
✔️ 4534d55 #17 2024-09-13 16:39:46 ~10 min ios 📱ipa 📲
c4a84bb #18 2024-09-16 07:19:56 ~2 min tests 📄log
✔️ c4a84bb #18 2024-09-16 07:24:25 ~7 min android 🤖apk 📲
✔️ c4a84bb #18 2024-09-16 07:24:27 ~7 min android-e2e 🤖apk 📲
✔️ c4a84bb #18 2024-09-16 07:30:39 ~13 min ios 📱ipa 📲
1866a48 #20 2024-09-16 14:44:00 ~2 min tests 📄log
✔️ 1866a48 #20 2024-09-16 14:47:36 ~6 min android 🤖apk 📲
✔️ 1866a48 #20 2024-09-16 14:47:52 ~6 min android-e2e 🤖apk 📲
606fbf2 #21 2024-09-16 14:55:13 ~2 min tests 📄log
✔️ 606fbf2 #21 2024-09-16 14:59:18 ~6 min android-e2e 🤖apk 📲
✔️ 606fbf2 #21 2024-09-16 15:01:36 ~9 min android 🤖apk 📲
✔️ 606fbf2 #21 2024-09-16 15:05:18 ~12 min ios 📱ipa 📲
e897598 #23 2024-09-19 12:02:31 ~2 min tests 📄log
fe3aa38 #24 2024-09-19 12:08:24 ~2 min tests 📄log
✔️ fe3aa38 #24 2024-09-19 12:13:15 ~7 min android-e2e 🤖apk 📲
✔️ fe3aa38 #24 2024-09-19 12:14:42 ~8 min android 🤖apk 📲
052e412 #25 2024-09-19 12:24:21 ~3 min tests 📄log
✔️ 052e412 #25 2024-09-19 12:29:04 ~7 min android-e2e 🤖apk 📲
✔️ 052e412 #25 2024-09-19 12:30:33 ~9 min android 🤖apk 📲
✔️ 052e412 #25 2024-09-19 12:31:12 ~10 min ios 📱ipa 📲
cd210ee #26 2024-09-20 15:06:23 ~2 min tests 📄log
✔️ cd210ee #26 2024-09-20 15:10:10 ~6 min android-e2e 🤖apk 📲
✔️ cd210ee #26 2024-09-20 15:10:36 ~7 min android 🤖apk 📲
✔️ cd210ee #26 2024-09-20 15:22:05 ~18 min ios 📱ipa 📲
82fa774 #27 2024-09-25 06:32:48 ~2 min tests 📄log
✔️ 82fa774 #27 2024-09-25 06:37:33 ~7 min android-e2e 🤖apk 📲
✔️ 82fa774 #27 2024-09-25 06:38:02 ~7 min android 🤖apk 📲
✔️ 82fa774 #27 2024-09-25 06:42:29 ~12 min ios 📱ipa 📲
97a8640 #28 2024-09-25 08:26:38 ~2 min tests 📄log
✔️ 97a8640 #28 2024-09-25 08:29:56 ~6 min android-e2e 🤖apk 📲
✔️ 97a8640 #28 2024-09-25 08:31:41 ~7 min android 🤖apk 📲
✔️ 97a8640 #28 2024-09-25 08:35:50 ~12 min ios 📱ipa 📲
dd2fcae #29 2024-09-25 08:41:08 ~2 min tests 📄log
✔️ dd2fcae #29 2024-09-25 08:45:10 ~6 min android-e2e 🤖apk 📲
✔️ dd2fcae #29 2024-09-25 08:46:16 ~8 min android 🤖apk 📲
✔️ dd2fcae #29 2024-09-25 08:51:03 ~12 min ios 📱ipa 📲
3d440d6 #30 2024-09-25 13:06:05 ~2 min tests 📄log
✔️ 3d440d6 #30 2024-09-25 13:10:36 ~7 min android-e2e 🤖apk 📲
✔️ 3d440d6 #30 2024-09-25 13:11:02 ~7 min android 🤖apk 📲
✔️ 3d440d6 #30 2024-09-25 13:17:01 ~13 min ios 📱ipa 📲
97cb567 #32 2024-09-25 15:03:12 ~2 min tests 📄log
✔️ 97cb567 #32 2024-09-25 15:07:36 ~7 min android-e2e 🤖apk 📲
✔️ 97cb567 #32 2024-09-25 15:07:51 ~7 min android 🤖apk 📲
✔️ 97cb567 #32 2024-09-25 15:12:47 ~12 min ios 📱ipa 📲
e8f1fd3 #34 2024-09-26 12:37:04 ~2 min tests 📄log
✔️ e8f1fd3 #34 2024-09-26 12:40:50 ~6 min android 🤖apk 📲
✔️ e8f1fd3 #34 2024-09-26 12:41:42 ~7 min android-e2e 🤖apk 📲
✔️ e8f1fd3 #34 2024-09-26 12:47:33 ~13 min ios 📱ipa 📲
6c7666d #35 2024-09-26 18:25:10 ~2 min tests 📄log
✔️ 6c7666d #35 2024-09-26 18:28:28 ~6 min android-e2e 🤖apk 📲
✔️ 6c7666d #35 2024-09-26 18:29:46 ~7 min android 🤖apk 📲
✔️ 6c7666d #35 2024-09-26 18:34:21 ~12 min ios 📱ipa 📲
f6b3a92 #36 2024-09-26 18:47:08 ~2 min tests 📄log
✔️ f6b3a92 #36 2024-09-26 18:50:36 ~6 min android-e2e 🤖apk 📲
✔️ f6b3a92 #36 2024-09-26 18:51:59 ~7 min android 🤖apk 📲
✔️ f6b3a92 #36 2024-09-26 18:56:12 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
231cc5b #37 2024-09-27 07:12:38 ~2 min tests 📄log
✔️ 231cc5b #37 2024-09-27 07:17:10 ~7 min android-e2e 🤖apk 📲
✔️ 231cc5b #37 2024-09-27 07:17:42 ~7 min android 🤖apk 📲
✔️ 231cc5b #37 2024-09-27 07:21:44 ~11 min ios 📱ipa 📲
✔️ d333e18 #39 2024-09-27 10:17:44 ~4 min tests 📄log
✔️ d333e18 #39 2024-09-27 10:21:44 ~8 min android-e2e 🤖apk 📲
✔️ d333e18 #39 2024-09-27 10:22:12 ~9 min android 🤖apk 📲
✔️ d333e18 #39 2024-09-27 10:25:21 ~12 min ios 📱ipa 📲

@alwx alwx requested review from ilmotta, ulisesmac, smohamedjavid and briansztamfater and removed request for ilmotta September 6, 2024 13:23
@alwx alwx changed the title WIP: Asset to Pay / Asset to Receive Asset to Pay / Asset to Receive Sep 6, 2024
@alwx alwx changed the title Asset to Pay / Asset to Receive Swaps: Asset to Pay / Asset to Receive Sep 6, 2024
@alwx alwx marked this pull request as ready for review September 6, 2024 13:23
@status-im-auto
Copy link
Member

✔️ status-mobile/prs/android-e2e/PR-21140#8 🔹 ~6 min 25 sec 🔹 de3d5b4 🔹 📦 android-e2e package

@alwx alwx force-pushed the feature/20332-20333 branch 3 times, most recently from f1a2576 to e9f6227 Compare September 8, 2024 13:10
@vkjr vkjr self-requested a review September 9, 2024 12:44
@ulisesmac
Copy link
Contributor

Hi @alwx

It'd be great if you add a section with the steps to test and also some demo screenshots or video of it working to the description. It'll also help QA to test this PR

There has been a lot of files changed, so any additional note on the code will also help. 👍

Thank you!

@briansztamfater
Copy link
Member

If it depends on #21139 maybe would be better to use #21139 branch (feature/20380) as the base branch so we can review the relevant changes in this PR

@briansztamfater
Copy link
Member

Does this PR includes integration within the swap flow or just the screens?
In case is just the screens, maybe add a way to open them so QA can test them in isolation, and add intruction in the PR description.

@alwx
Copy link
Contributor Author

alwx commented Sep 16, 2024

@briansztamfater @status-im/mobile-qa the integration is done as well. This is how it works:

Screen.Recording.2024-09-16.at.09.31.26.mov

@alwx
Copy link
Contributor Author

alwx commented Sep 26, 2024

@VolodLytvynenko ready now. Please, check issue 8, 10 and 1 — all of them should be fixed now.

@VolodLytvynenko
Copy link
Contributor

hi @alwx
issue 8 still happens occasionally, especially on iOS. The recalculation isn't smooth (the wrong recalculated value is blinked), and sometimes it blinks with the "something went wrong" validation

  • Pixel 7a, Android 13
android_recalculation.mp4
  • iPhone 11 Pro max, IOS 17
ios.mp4

Logs:

Android logs
logs.zip

IOS logs
logs.zip

@status-im-auto
Copy link
Member

86% of end-end tests have passed

Total executed tests: 7
Failed tests: 1
Expected to fail tests: 0
Passed tests: 6
IDs of failed tests: 727229 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]`
    Device 2: `Text` is `0.07139 ETH`

    critical/test_wallet.py:159: in test_wallet_send_eth
        self.errors.verify_no_errors()
    base_test_case.py:192: 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.4114 but expected to be 0.4115
    



    Passed tests (6)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 26, 2024

    @VolodLytvynenko From what it seems issue 10 is reproducable because of the feature flag. You restore the user so the feature flag is not yet set.

    @alwx Perhaps I didn't understand you here. Issue 10 is still reproducible for both recovered and new users after swap feature flag is enabled, and popular assets section is not shown until the user logs out and logs back in

    new_user.mp4

    logs:

    logs (2).zip

    @VolodLytvynenko
    Copy link
    Contributor

    issue 1 is fixed

    @alwx
    Copy link
    Contributor Author

    alwx commented Sep 26, 2024

    @VolodLytvynenko issue 10 is fixed (I don't think it's an issue though because the loading happens on initialization — which is exactly what we needed because there won't be any feature flag in the future)

    issue 8 should also be fixed — I tried different approach to loading now but i'm not sure it will work in 100% of cases because there are too many things that could go wrong on that particular screen

    @status-im-auto
    Copy link
    Member

    86% of end-end tests have passed

    Total executed tests: 7
    Failed tests: 1
    Expected to fail tests: 0
    Passed tests: 6
    
    IDs of failed tests: 703133 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    Device 1: Find `Button` by `accessibility id`: `show-profiles`
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:244: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.errors.verify_no_errors()
    base_test_case.py:192: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     zQ3...dWXh5 was not restored as a contact from waku backup!
    E    zQ3...Vacac was not restored as a contact from waku backup!
    E    admin_open was not restored from waku-backup!!
    E    member_open was not restored from waku-backup!!
    E    admin_closed was not restored from waku-backup!!
    E    member_closed was not restored from waku-backup!!
    



    Device sessions

    Passed tests (6)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 27, 2024

    @VolodLytvynenko issue 10 is fixed (I don't think it's an issue though because the loading happens on initialization — which is exactly what we needed because there won't be any feature flag in the future)

    Hi @alwx, thanks for the fixes! Take a look please one additional issue, now the Optimism popular assets section is limited to only 4 tokens, and I haven’t been able to see more than that, even after some relogins

    ISSUE 11: Optimism Assets Not Fully Fetched in "Popular Assets" Section

    Steps to Reproduce:

    1. Go to the swap page and select the Optimism network.
    2. Check the "Popular Assets" section in the "Asset to Pay" or "Asset to Receive" sheets.

    Actual Result:

    Only 4 tokens are shown in the "Popular Assets" section for Optimism.

    4tokens.mp4

    Expected Result:

    More popular tokens should be displayed in the "Popular Assets" section for the Optimism network, as on Desktop

    swap.mp4

    Devices:

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

    Logs:

    logs.zip

    @VolodLytvynenko
    Copy link
    Contributor

    @VolodLytvynenko issue 10 is fixed (I don't think it's an issue though because the loading happens on initialization — which is exactly what we needed because there won't be any feature flag in the future)

    Hi @alwx, thanks for the fixes! Take a look please one additional issue, now the Optimism popular assets section is limited to only 4 tokens, and I haven’t been able to see more than that, even after some relogins

    Steps to Reproduce:

    1. Go to the swap page and select the Optimism network.
    2. Check the "Popular Assets" section in the "Asset to Pay" or "Asset to Receive" sheets.

    Actual Result:

    Only 4 tokens are shown in the "Popular Assets" section for Optimism.

    4tokens.mp4

    Expected Result:

    More popular tokens should be displayed in the "Popular Assets" section for the Optimism network, as on Desktop

    swap.mp4

    Devices:

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

    Logs:

    logs.zip

    @alwx Better to fix is in a follow up. WDYT?

    @alwx
    Copy link
    Contributor Author

    alwx commented Sep 27, 2024

    @VolodLytvynenko agree. That would make the whole process of fixing easier since it's a big PR.

    Regarding 4 tokens for Optimism: I've just checked and that's actually what server (status-go side) returns us.

    @VolodLytvynenko
    Copy link
    Contributor

    @alwx, thanks for fixing all the issues. This was a challenging feature, but I think our swap now looks even better than in some popular dapps! However, issue 8 still happens occasionally, though rarely. The important remaining issue is issue 11, which needs to be addressed in 2.31. If you think it's better to fix it in this PR, let me know, and I'll recheck it; otherwise, the PR can be merged.

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 27, 2024

    Regarding 4 tokens for Optimism: I've just checked and that's actually what server (status-go side) returns us.

    @alwx got it. Thank you for clarification

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