chore(tests): consolidate E2E test suite into standardized primary scripts
- Combined 10+ one-off tests into 4 primary functional suites (Search, Auth, Lifecycle, Vision). - Archived original scripts to tests/archive/. - Updated README with the new standardized inventory. - Applied clean output formatting across the new suite.
This commit is contained in:
59
tests/archive/test_e2e_v3_event_session.py
Normal file
59
tests/archive/test_e2e_v3_event_session.py
Normal file
@@ -0,0 +1,59 @@
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
|
||||
# Configuration
|
||||
BASE_URL = "https://dev-api.oneskyit.com/v3/crud"
|
||||
# Using the API key found in the database
|
||||
API_KEY = "PHDXUJxx6IgmLNKxIBezTQ"
|
||||
# Event Session ID found in the database
|
||||
SESSION_ID = "F0PZd1bNcuD"
|
||||
|
||||
def get_headers():
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"X-Aether-API-Key": API_KEY,
|
||||
"X-No-Account-ID": "bypass"
|
||||
}
|
||||
return headers
|
||||
|
||||
def test_get_event_session():
|
||||
print(f"--- Testing: Get Event Session by ID ({SESSION_ID}) ---")
|
||||
url = f"{BASE_URL}/event_session/{SESSION_ID}"
|
||||
|
||||
headers = get_headers()
|
||||
|
||||
try:
|
||||
response = requests.get(url, headers=headers)
|
||||
|
||||
print(f"URL: {response.url}")
|
||||
print(f"Status Code: {response.status_code}")
|
||||
|
||||
if response.status_code == 200:
|
||||
data = response.json().get('data', {})
|
||||
print("✅ SUCCESS: Found Event Session.")
|
||||
|
||||
# Verify Vision ID pattern (Strings only for ID fields)
|
||||
vision_fields = ["id", "event_session_id", "event_id", "event_location_id", "event_track_id", "poc_event_person_id", "poc_person_id"]
|
||||
for field in vision_fields:
|
||||
val = data.get(field)
|
||||
print(f" Field '{field}': {val} (type: {type(val).__name__})")
|
||||
if val is not None:
|
||||
assert isinstance(val, str), f"Error: Field '{field}' should be a string, but got {type(val).__name__}"
|
||||
|
||||
# Check for any unexpected integer IDs
|
||||
for key, val in data.items():
|
||||
if key.endswith("_id") and not key.endswith("external_id"):
|
||||
if isinstance(val, int):
|
||||
print(f" ❌ FAILURE: Integer leakage detected in field '{key}': {val}")
|
||||
else:
|
||||
print(f"❌ FAILURE: {response.text}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error during test: {e}")
|
||||
print("-" * 40 + "\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Starting Aether V3 Event Session E2E Tests against {BASE_URL}\n")
|
||||
test_get_event_session()
|
||||
print("Tests Complete.")
|
||||
Reference in New Issue
Block a user