diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index b8f8ce5..f365278 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -6,8 +6,9 @@ jobs: test: runs-on: ubuntu-latest strategy: + max-parallel: 1 matrix: - python: ["3.10", "3.11", "3.12"] + python: ["3.10"] steps: - uses: actions/checkout@v3 diff --git a/tests/test_e2e.py b/tests/test_e2e.py index a010960..6028c6e 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -70,28 +70,25 @@ def test_wallet_import(wallet_data): @pytest.mark.e2e def test_wallet_transfer(imported_wallet): """Test wallet transfer.""" - try: - imported_wallet.faucet().wait() - except FaucetLimitReachedError: - print("Faucet limit reached, continuing...") - destination_wallet = Wallet.create() - initial_source_balance = Decimal(str(imported_wallet.balances().get("eth", 0))) - initial_dest_balance = Decimal(str(destination_wallet.balances().get("eth", 0))) + initial_source_balance = imported_wallet.balance("eth") + initial_dest_balance = destination_wallet.balance("eth") + + if initial_source_balance < 0.000000001: + try: + imported_wallet.faucet().wait() + except FaucetLimitReachedError: + print("Faucet limit reached, continuing...") transfer = imported_wallet.transfer( amount=Decimal("0.000000001"), asset_id="eth", destination=destination_wallet - ) - - transfer.wait() - time.sleep(2) + ).wait() - assert transfer is not None assert transfer.status.value == "complete" - final_source_balance = Decimal(str(imported_wallet.balances().get("eth", 0))) - final_dest_balance = Decimal(str(destination_wallet.balances().get("eth", 0))) + final_source_balance = imported_wallet.balance("eth") + final_dest_balance = destination_wallet.balance("eth") assert final_source_balance < initial_source_balance assert final_dest_balance > initial_dest_balance @@ -100,15 +97,17 @@ def test_wallet_transfer(imported_wallet): @pytest.mark.e2e def test_transaction_history(imported_wallet): """Test transaction history retrieval.""" - try: - imported_wallet.faucet().wait() - except FaucetLimitReachedError: - print("Faucet limit reached, continuing...") - destination_wallet = Wallet.create() + initial_source_balance = imported_wallet.balance("eth") + if initial_source_balance < 0.000000001: + try: + imported_wallet.faucet().wait() + except FaucetLimitReachedError: + print("Faucet limit reached, continuing...") + transfer = imported_wallet.transfer( - amount=Decimal("0.0001"), asset_id="eth", destination=destination_wallet + amount=Decimal("0.000000001"), asset_id="eth", destination=destination_wallet ).wait() time.sleep(10)