Skip to content

Latest commit

 

History

History
301 lines (263 loc) · 13.9 KB

QA_PUSH_NOTIFICATION.md

File metadata and controls

301 lines (263 loc) · 13.9 KB

Push Notification

Custom tokens

Test Token Test (TTT)

It's a regular custom token to test.

[TonyTestToken:TTT:003537ec76f01108262864aaa417f521f26031d172f5bc54f5e3af4d9df7bc73:8b690d38]

Test NFT (TN1)

It's a custom NFT token to test.

[TestNft:TN1:0025dadebe337a79006f181c05e4799ce98639aedfbd26335806790bdea4b1d4:c59a30f8]

Test NFT Test (TNT)

It's a second custom NFT token to test.

[TestNftTest:TNT:00bf95e4edcebb2e9308e5e177d3562b9595844d5b2d42e0a389eb4eb2300644:ad8b0686]

Suggested test sequence

  1. Preparation

    1. Clear the application storage
    2. Make sure the deviceId is not registered in the unleash push-notification.rollout feature toggle
    3. If testing the fullnode wallet, make sure the unleash wallet-service feature toggle is disabled
  2. Initialize a new wallet

    1. You should not see a modal to opt-in the push notification yet
    2. Go to the Settings page
      1. You should not see the Push Notification item yet
  3. Turn on the push-notification feature toggle

    1. Go to the settings page
    2. Get the deviceId and add it in the UserIDs for the stage and platform mobile in the unleash push-notification.rollout feature toggle.
    3. Close the app and open again.
    4. The Push Notification item now shows up in the Settings page
  4. Turn off the push-notification feature toggle

    1. Go to the Settings page
    2. Remove your deviceId from the unleash push-notification.rollout feature toggle
    3. Wait until the Push Notification item disappears from the Settings page
  5. Test push notification settings on/off

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification
    4. Turn on the Show amounts on notification
    5. Turn off the Enable Push Notification
    6. Try to turn on the Show amounts on notification
      1. it should not be possible
    7. Turn on the Enable Push Notification
      1. Show amounts on notification should be on
    8. Turn off the Show amounts on notification
    9. Turn off the Enable Push Notification
  6. Try to send a notification with push-notification feature toggle turned off

    1. Go to the Settings page
    2. Turn off the push-notification feature toggle
    3. Send HTR to this wallet
      1. Wait some minutes to guarantee you won't receive any notifications for this tx
  7. Try to send a notification with push-notification feature toggle turned on

    1. Go to the Settings page
    2. Turn on the push-notification feature toggle
    3. Send HTR to this wallet
      1. Wait some minutes to guarantee you won't receive any notifications for this tx (because the settings Enable Push Notification is disabled)
  8. Send a token after turn on Enable Push Notification option

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Send HTR to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction without show amounts

        There is a new transaction in your wallet.

    5. Dismiss the notification
  9. Send a token after turn on Show amounts on notification option

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Turn on the Show amounts on notification option
    5. Send HTR to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing amounts in the message

        You have received 0.04 HTR on a new transaction.

    6. Dismiss the notification
  10. View the details of the transaction (foreground)

    1. Send a token after turn on Enable Push Notification option
    2. Keep the application open
    3. Click on the notification
    4. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
    5. Click on the HTR - HATHOR item
      1. The Balance page should open
  11. View the details of the transaction (quit)

    [!NOTE] Notifee v5.7.0 with Android API 32 has a known issue regarding onBackgroundEvent.

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Close the application
    5. Send HTR to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction without show amounts

        There is a new transaction in your wallet.

    6. Click on the notification, open the app with your PIN
    7. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
    8. Click on the HTR - HATHOR item
      1. The Balance page should open
  12. View the details of the transaction while in foreground starting from lock screen

    1. Send a token after turn on Enable Push Notification option
    2. Keep the application open
    3. Go to the Settings screen.
    4. Go to Security
    5. Click on Lock Wallet.
    6. Click on the notification
    7. Unlock the screen
    8. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
    9. Click on the HTR - HATHOR item
      1. The Balance page should open
  13. Reset wallet and send a token

    1. Reset the wallet
    2. Send HTR to this wallet
      1. Wait until the notification arrives
      2. You should not receive a notification
    3. Import the wallet
    4. Send HTR to this wallet
      1. Wait until the notification arrives
      2. You should not receive a notification
    5. Send a token after turn on Enable Push Notification option
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction without show amounts

        There is a new transaction in your wallet.

    6. Dismiss the notification
  14. Send 2 tokens after turn on Show amounts on notification option

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Turn on the Show amounts on notification option
    5. Send HTR and TTT to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing 2 amounts in the message

        You have received 0.09 HTR and 0.01 TTT on a new transaction.

    6. Click on the notification
    7. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
      2. The TTT - Test Token Test name should be in gray
    8. Click on the TTT - Test Token Test item
      1. Nothing should happen
    9. Click on the HTR - HATHOR item
      1. The Balance page should open
  15. Send 3 tokens after turn on Show amounts on notification option

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Turn on the Show amounts on notification option
    5. Send HTR, TTT and TN1 to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing 2 amounts in the message

        You have received 0.05 TN1, 0.03 TTT and 1 other token on a new transaction.

    6. Click on the notification
    7. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
      2. The TTT - Test Token Test name should be in gray
      3. The TN1 - Test Nft name should be in gray
    8. Click on the TTT - Test Token Test item
      1. Nothing should happen
    9. Click on the TN1 - Test Nft item
      1. Nothing should happen
    10. Click on the HTR - HATHOR item
      1. The Balance page should open
  16. Send 4 tokens after turn on Show amounts on notification option

    1. Turn on the push-notification feature toggle
    2. Go to the Push Notification page
    3. Turn on the Enable Push Notification option
    4. Turn on the Show amounts on notification option
    5. Send HTR, TTT, TN1 and TNT to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing 2 amounts in the message

        You have received 0.08 TNT, 0.05 TN1 and 2 other tokens on a new transaction.

    6. Click on the notification
    7. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
      2. The TTT - Test Token Test name should be in gray
      3. The TN1 - Test Nft name should be in gray
      4. The TNT - Test Nft Test name should be in gray
    8. Click on the TTT - Test Token Test item
      1. Nothing should happen
    9. Click on the TN1 - Test Nft item
      1. Nothing should happen
    10. Click on the TNT - Test Nft Test item
      1. Nothing should happen
    11. Click on the HTR - HATHOR item
      1. The Balance page should open
  17. Register TTT token and send 2 tokens after turn on Show amounts on notification option

    [!WARNING] Not possible using wallet-service in testnet due to a validation that consults the fullnode. Jump to Test open the wallet 2 weeks later

    1. Register TTT token in the wallet
    2. Turn on the push-notification feature toggle
    3. Go to the Push Notification page
    4. Turn on the Enable Push Notification option
    5. Turn on the Show amounts on notification option
    6. Send HTR and TTT to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing 2 amounts in the message

        You have received 0.02 TTT and 0.01 HTR on a new transaction.

    7. Click on the notification
    8. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
      2. The TTT - Test Token Test name should be in the primary color (purple)
    9. Click on the TTT - Test Token Test item
      1. The Balance page for TTT token should open
  18. Register TN1 token and send 2 tokens after turn on Show amounts on notification option

    1. Register TTT token in the wallet
    2. Turn on the push-notification feature toggle
    3. Go to the Push Notification page
    4. Turn on the Enable Push Notification option
    5. Turn on the Show amounts on notification option
    6. Send HTR and TN1 to this wallet
      1. Wait until the notification arrives
      2. You should receive a notification of new transaction showing 2 amounts in the message

        You have received 0.03 TN1 and 0.02 HTR on a new transaction.

    7. Click on the notification
    8. Wait until the modal with tx details open
      1. The HTR - HATHOR name should be in the primary color (purple)
      2. The TN1 - Test Nft name should be in the primary color (purple)
      3. The TN1 - Test Nft amount should be integer
    9. Click on the TN1 - Test Nft item
      1. The Balance page for TN1 token should open
  19. Send token to self

    1. Wait some minutes to guarantee you won't receive any notifications for this tx
  20. Test open the wallet 2 weeks later

    [!WARNING] Skip if running the wallet from store.

    1. Open the file src/sagas/pushNotification.js and search for the following assignment:
      const timeSinceLastRegistration = moment().diff(enabledAt, 'weeks');
    2. Assign the value 2 to timeSinceLastRegistration and save
      const timeSinceLastRegistration = 2;
    3. Reload the wallet
      1. You should see a modal asking for a registration refresh

      This modal only shows up when the user is using the fullnode wallet.

    4. Click on Refresh
    5. Enter your pin
    6. Done! You will continue to receive the push notification.
    7. Reassign timeSinceLastRegistration with its previous expression:
      const timeSinceLastRegistration = moment().diff(enabledAt, 'weeks');
  21. Close test

    1. Register TNT token
    2. Send back all the tokens to the source wallet
    3. Disable push notification settings
    4. Turn off push notification feature toggle
    5. Unregister the tokens
    6. Reset the wallet
    7. Close the app
    8. Clear the application storage

Turn on the wallet-service feature toggle

  1. Get the deviceId and add it in the UserIDs strategy in the unleash wallet-service-mobile-android-testnet.rollout feature toggle
  2. Turn the feature toggle on

Run all the tests above with the wallet-service turned on. But as a quick test you can run the following test:

  1. Send token after turn on the wallet-service feature toggle
    1. Turn on the push-notification feature toggle
    2. Turn on the wallet-service feature toggle
    3. View the details of the transaction (foreground)
    4. View the details of the transaction (quit)