Files
aitbc/tests/testing/test_transactions_display.py
aitbc1 bfe6f94b75
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (push) Has been cancelled
AITBC CI/CD Pipeline / test-cli (push) Has been cancelled
AITBC CI/CD Pipeline / test-services (push) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (push) Has been cancelled
AITBC CI/CD Pipeline / security-scan (push) Has been cancelled
AITBC CI/CD Pipeline / build (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (push) Has been cancelled
AITBC CI/CD Pipeline / performance-test (push) Has been cancelled
AITBC CI/CD Pipeline / docs (push) Has been cancelled
AITBC CI/CD Pipeline / release (push) Has been cancelled
AITBC CI/CD Pipeline / notify (push) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (push) Has been cancelled
Security Scanning / Dependency Security Scan (push) Has been cancelled
Security Scanning / Container Security Scan (push) Has been cancelled
Security Scanning / OSSF Scorecard (push) Has been cancelled
Security Scanning / Security Summary Report (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (push) Has been cancelled
chore: remove outdated documentation and reference files
- Remove debugging service documentation (DEBUgging_SERVICES.md)
- Remove development logs policy and quick reference guides
- Remove E2E test creation summary
- Remove gift certificate example file
- Remove GitHub pull summary documentation
2026-03-25 12:56:07 +01:00

78 lines
2.8 KiB
Python
Executable File

#!/usr/bin/env python3
"""
Test if transactions are displaying on the explorer
"""
import requests
from bs4 import BeautifulSoup
def main():
print("🔍 Testing Transaction Display on Explorer")
print("=" * 60)
# Check API has transactions
print("\n1. Checking API for transactions...")
try:
response = requests.get("https://aitbc.bubuit.net/api/explorer/transactions")
if response.status_code == 200:
data = response.json()
print(f"✅ API has {len(data['items'])} transactions")
if data['items']:
first_tx = data['items'][0]
print(f"\n First transaction:")
print(f" Hash: {first_tx['hash']}")
print(f" From: {first_tx['from']}")
print(f" To: {first_tx.get('to', 'null')}")
print(f" Value: {first_tx['value']}")
print(f" Status: {first_tx['status']}")
else:
print(f"❌ API failed: {response.status_code}")
return
except Exception as e:
print(f"❌ Error: {e}")
return
# Check explorer page
print("\n2. Checking explorer page...")
try:
response = requests.get("https://aitbc.bubuit.net/explorer/#/transactions")
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
# Check if it says "mock data"
if "mock data" in soup.text.lower():
print("❌ Page still shows 'mock data' message")
else:
print("✅ No 'mock data' message found")
# Check for transactions table
table = soup.find('tbody', {'id': 'transactions-table-body'})
if table:
rows = table.find_all('tr')
if len(rows) > 0:
if 'Loading' in rows[0].text:
print("⏳ Still loading transactions...")
elif 'No transactions' in rows[0].text:
print("❌ No transactions displayed")
else:
print(f"✅ Found {len(rows)} transaction rows")
else:
print("❌ No transaction rows found")
else:
print("❌ Transactions table not found")
else:
print(f"❌ Failed to load page: {response.status_code}")
except Exception as e:
print(f"❌ Error: {e}")
print("\n" + "=" * 60)
print("\n💡 If transactions aren't showing, it might be because:")
print(" 1. JavaScript is still loading")
print(" 2. The API call is failing")
print(" 3. The transactions have empty values")
print("\n Try refreshing the page or check browser console for errors")
if __name__ == "__main__":
main()