205 lines
12 KiB
HTML
205 lines
12 KiB
HTML
{# app/templates/admin/testing-hub.html #}
|
|
{% extends "admin/base.html" %}
|
|
|
|
{% block title %}Testing Hub{% endblock %}
|
|
|
|
{# ✅ CRITICAL: Link to Alpine.js component #}
|
|
{% block alpine_data %}adminTestingHub(){% endblock %}
|
|
|
|
{% block content %}
|
|
<!-- Page Header -->
|
|
<div class="flex items-center justify-between my-6">
|
|
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
|
Testing Hub
|
|
</h2>
|
|
</div>
|
|
|
|
<!-- Introduction Card -->
|
|
<div class="bg-gradient-to-r from-purple-600 to-indigo-600 rounded-lg shadow-lg p-6 mb-8">
|
|
<div class="flex items-start">
|
|
<div class="flex-shrink-0 text-white">
|
|
<span x-html="$icon('beaker', 'w-12 h-12')"></span>
|
|
</div>
|
|
<div class="ml-4">
|
|
<h3 class="text-xl font-bold mb-2 text-white">Testing & QA Tools</h3>
|
|
<p class="text-white opacity-90">
|
|
Comprehensive testing tools for manual QA, feature verification, and bug reproduction.
|
|
These pages help you test specific flows without writing code.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Stats -->
|
|
<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
|
|
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
|
<div class="p-3 mr-4 text-blue-500 bg-blue-100 rounded-full dark:text-blue-100 dark:bg-blue-500">
|
|
<span x-html="$icon('clipboard-list', 'w-5 h-5')"></span>
|
|
</div>
|
|
<div>
|
|
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Suites</p>
|
|
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalSuites"></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
|
<div class="p-3 mr-4 text-green-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-green-500">
|
|
<span x-html="$icon('check-circle', 'w-5 h-5')"></span>
|
|
</div>
|
|
<div>
|
|
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Cases</p>
|
|
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalTests + '+'"></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
|
<div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
|
|
<span x-html="$icon('lightning-bolt', 'w-5 h-5')"></span>
|
|
</div>
|
|
<div>
|
|
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Features Covered</p>
|
|
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.coverage"></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
|
<div class="p-3 mr-4 text-purple-500 bg-purple-100 rounded-full dark:text-purple-100 dark:bg-purple-500">
|
|
<span x-html="$icon('clock', 'w-5 h-5')"></span>
|
|
</div>
|
|
<div>
|
|
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Quick Tests</p>
|
|
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.avgDuration"></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Test Suites Grid -->
|
|
<div class="grid gap-6 mb-8 md:grid-cols-2">
|
|
<template x-for="suite in testSuites" :key="suite.id">
|
|
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
|
|
<div class="p-4 bg-gradient-to-r" :class="getColorClasses(suite.color).gradient">
|
|
<div class="flex items-center justify-between">
|
|
<h3 class="text-xl font-semibold text-white flex items-center">
|
|
<span x-html="$icon(suite.icon, 'w-6 h-6 mr-2 text-white')"></span>
|
|
<span x-text="suite.name"></span>
|
|
</h3>
|
|
<span class="px-3 py-1 bg-white bg-opacity-25 rounded-full text-xs text-white font-semibold">
|
|
<span x-text="suite.testCount"></span> Tests
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="p-6">
|
|
<p class="text-gray-600 dark:text-gray-400 mb-4" x-text="suite.description"></p>
|
|
|
|
<div class="space-y-2 mb-6">
|
|
<template x-for="feature in suite.features" :key="feature">
|
|
<div class="flex items-start text-sm">
|
|
<span x-html="$icon('check-circle', 'w-4 h-4 text-green-500 mr-2 mt-0.5 flex-shrink-0')"></span>
|
|
<span class="text-gray-600 dark:text-gray-400" x-text="feature"></span>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<div class="flex gap-2">
|
|
<button
|
|
@click="goToTest(suite.url)"
|
|
class="flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors"
|
|
:class="getColorClasses(suite.color).button">
|
|
<span x-html="$icon('play', 'w-4 h-4 mr-2 text-white')"></span>
|
|
Run Tests
|
|
</button>
|
|
<button class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors">
|
|
<span x-html="$icon('information-circle', 'w-5 h-5')"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<!-- Best Practices -->
|
|
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
|
<h2 class="mb-4 text-xl font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
|
<span x-html="$icon('light-bulb', 'w-6 h-6 mr-2 text-yellow-500')"></span>
|
|
Testing Best Practices
|
|
</h2>
|
|
|
|
<div class="grid md:grid-cols-2 gap-6">
|
|
<div>
|
|
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Before Testing</h3>
|
|
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Ensure FastAPI server is running on localhost:8000</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Open browser DevTools (F12) to see console logs</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Check Network tab for API requests</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Clear localStorage before starting fresh tests</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">During Testing</h3>
|
|
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Follow test steps in order</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Check expected results against actual behavior</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Look for errors in console and network tabs</span>
|
|
</li>
|
|
<li class="flex items-start">
|
|
<span class="text-purple-600 mr-2">•</span>
|
|
<span>Take screenshots if you find bugs</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Additional Resources -->
|
|
<div class="bg-blue-50 dark:bg-gray-800 border border-blue-200 dark:border-gray-700 rounded-lg p-6 mb-8">
|
|
<h3 class="mb-3 text-lg font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
|
<span x-html="$icon('book-open', 'w-5 h-5 mr-2 text-blue-600')"></span>
|
|
Additional Resources
|
|
</h3>
|
|
<div class="grid md:grid-cols-3 gap-4">
|
|
<a href="/admin/components" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
|
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">Component Library</h4>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">View all available UI components</p>
|
|
</a>
|
|
<a href="/admin/icons" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
|
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">Icons Browser</h4>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Browse all available icons</p>
|
|
</a>
|
|
<a href="#" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
|
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">API Documentation</h4>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">FastAPI endpoint reference</p>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block extra_scripts %}
|
|
{# ✅ CRITICAL: Load JavaScript file #}
|
|
<script src="{{ url_for('static', path='admin/js/testing-hub.js') }}"></script>
|
|
{% endblock %} |