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

Create E2E tests for verified/unverified tokens #3472

Merged
merged 37 commits into from
Aug 16, 2023
Merged

Commits on Jun 13, 2023

  1. Create E2E tests for verified/unverified tokens

    This commit introduces E2E test that checks the functiolality of
    verified/unverified tokens. Following general steps are executed:
    1. Import account
    2. Enable `Show unverified assets`
    3. Hide asset
    4. Trust asset
    5. Hide trusted asset
    A number of checks is performed during each step.
    
    The commit also introduces helper functions and adds `data-testid` attribute to
    a couple of DOM elements.
    
    As some of the code is similar or identical as in the
    #3418 PR which is yet not merged to
    `main`, some conflicts may arise and will need to be resolved before this change
    lands on `main`.
    
    Also some changes will need to be made once
    #3195 gets merged to `main`, as this
    PR solves a bug causing failures in the tests (the failing part of the test was
    temporarily commented out).
    michalinacienciala committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    fdf09c6 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. Configuration menu
    Copy the full SHA
    19cebd0 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2023

  1. Uncomment temporarily turned off test steps

    The steps were temporarily commented out because there was a bug that caused the
    step to fail. Now that the bug got fixed, we can uncomment.
    michalinacienciala committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    2ce0f5c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    db5302a View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2023

  1. Switch test to use account that we control

    We want to have a control over the account we use in test, as change in the
    state of the assets may break the tests. We'll use the account with the address
    0x6f1b1f1feb01235e15a7962f16c389c7f8218ed6` (`e2e.testertesting.eth`).
    
    We also fix some flakiness and improve the locators used in tests.
    michalinacienciala committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    1b6d888 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Configuration menu
    Copy the full SHA
    bdf5b87 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. Adjust the code after the merge

    We're removing some code that became unnecessary after the merge from `main`.
    We're also switching from onboarding using seed phrase to onboarding using JSON
    file with encrypted private key.
    michalinacienciala committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    1debde9 View commit details
    Browse the repository at this point in the history
  2. Improve comments

    michalinacienciala committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    b1d8382 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. Refactor code asserting asset's balance

    Previous implementation wasn't properly handling cases when the assertion was
    not met. In such cases it was silently ending the tests, without reporting any
    failures (the failure was visible only in the Playwright report, which wasn't
    opened by default).
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    c0f9193 View commit details
    Browse the repository at this point in the history
  2. Uncomment temporarily disabled assertions

    We had a bug in the code that was resulting in price of some assets not being
    displayed. We've temporarily commented out the assertions that verify this. Now
    that the bug is fixed, we can uncomment.
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    3f0a378 View commit details
    Browse the repository at this point in the history
  3. Merge assertAssetDetailsPage() with verifyAssetActivityScreen()

    The `assertAssetDetailsPage` function was a more robust version of the
    `verifyAssetActivityScreen` function. When `verifyAssetActivityScreen` was
    created we didn't yet have the `AssetsHelper` so we kept the function checking
    the activity detais in the `TransactionsHelper`. Now that we have a specific
    helper for assets, we can merge both functions into one.
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    bf682cc View commit details
    Browse the repository at this point in the history
  4. Remove obsolete comment

    Comment suggested that we could move some of the functions from `AssetsHelper`
    to `TransactionsHelper`. After thinking it through, I think it makes sense to
    leave the functions where they are, especially that they're used not only during
    filling of the Transaction form but also during filling of the Swap form.
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    1a75c5d View commit details
    Browse the repository at this point in the history
  5. Improve comments

    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    06208b6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7511aa4 View commit details
    Browse the repository at this point in the history
  7. Wait 1s before switching to Polygon network

    We're adding a timeout, as switching to the Polygon network too fast after
    importing wallet was causing some of the price info missing for the ERC-20
    assets. It's quite unlikely for the real users to switch the network this fast
    anyway, so the timeout does not contradict the real user behaviour.
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    f37e61b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a07be0a View commit details
    Browse the repository at this point in the history
  9. Give dev fork builds the -fork suffix

    We changed this for production fork builds to differentiate from the release
    builds, and we updated e2e tests to look for the suffix, but on non release
    branches the fork builds were not getting the suffix, leading to test failures.
    michalinacienciala committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    22a9b91 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Increase waiting time before switching network

    The previously used 1s wait sometimes wasn't sufficient.
    michalinacienciala committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    4ef9622 View commit details
    Browse the repository at this point in the history
  2. Uncomment previously failing code

    The checks are no longer failing. What fixed them is not known, but maybe it has
    something to do with the wait period added before switching to Polygon.
    michalinacienciala committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    5debafc View commit details
    Browse the repository at this point in the history
  3. Remove empty line

    michalinacienciala committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    cbd2990 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. Configuration menu
    Copy the full SHA
    b16c9a0 View commit details
    Browse the repository at this point in the history
  2. Rename verify... functions to assert...

    As we have functionality of verifying assets in the wallet, we recently started
    to use `assert` nomenclature in the names of the new functions and methods
    checking certain areas of the wallet. This was done to avoid confusion in the
    naming. Now we update the older function using the `verify...` prefix, to make
    the naming consistent across all our test-related files.
    michalinacienciala committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    5ad6ca6 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. Configuration menu
    Copy the full SHA
    833cbf4 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. Configuration menu
    Copy the full SHA
    0fa759f View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Configuration menu
    Copy the full SHA
    95db29f View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2023

  1. Configuration menu
    Copy the full SHA
    b4a61d2 View commit details
    Browse the repository at this point in the history
  2. Remove obsolete steps in addAddressToAccount()

    The steps were added temporarily for debugging purposes, but accidentally got
    commited.
    michalinacienciala committed Aug 6, 2023
    Configuration menu
    Copy the full SHA
    4e740df View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e9d7951 View commit details
    Browse the repository at this point in the history
  4. Improve comments

    michalinacienciala committed Aug 6, 2023
    Configuration menu
    Copy the full SHA
    89019b4 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2023

  1. Refactor function closing Accounts slide up

    As after opening the Accounts list, there were multiple `slide_up_menu`
    elements in the wallet's DOM, and only one was not of a `closed` class, we were
    using the `ElementHandle` syntax to find the one which is not closed (the one
    we wanted to click). This then influenced the way how we can locate the `Close
    menu` button, making the code quite complicated.
    In this PR we are simplifying the code, by filtering the slide up menus by the
    `Accounts` text. Then we are able to point to the right `Close menu` element by
    using `.first()` locator.
    michalinacienciala committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    c562952 View commit details
    Browse the repository at this point in the history
  2. Move the closeAccountsSlideUp() steps under addAddressToAccount()

    Both functions are currently not used by the e2e tests, but we want to keep
    them in case they're needed in the future. We're moving the steps closing the
    Accounts slide up to the `addAddressToAccount()` functions for now. They may be
    separated on the future, if there will be a need for this.
    michalinacienciala committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    1cf604e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c21299e View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. Support assets with the same name in assertVerifiedAssetOnWalletPage

    There may be a situation where we have a spam asset named the same as the
    asset we verified and are checking in the `assertVerifiedAssetOnWalletPage`
    function. The previous implementation of the function wasn't supporting such
    case. Now the function should handle it.
    michalinacienciala committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    1265763 View commit details
    Browse the repository at this point in the history
  2. Refactor onboarding with JSON

    We've pulled some of the code relating to JSON onboarding reused in several
    tests to a `WalletPageHelper`'s `onboardWithJSON` method. Now the onboarding
    with JSON in e2e tests requires just one command:
    `await walletPageHelper.onboardWithJSON(<account>)`,
    where `account` can be either `account1`, `account2`, or `custom`.
    The `account1`'s and `account2`'s JSON data (body & password) is accessed via
    the `onboarding.ts` file. The `custom` option allows for onboarding wit a custom
    account and requires providing the `customJsonBody` and `customFilePassword`
    parameters.
    michalinacienciala committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    5f45f7f View commit details
    Browse the repository at this point in the history
  3. Access account-specific data in e2e tests using interface

    So far we've been storing each piece of the account-specific data in a separate
    variable. We are now reorganizing the data into objects adhering to a common
    interface structure.
    michalinacienciala committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    bd19521 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6bfbd18 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2023

  1. Configuration menu
    Copy the full SHA
    0013d2a View commit details
    Browse the repository at this point in the history