Spaces:
Running
Running
File size: 16,837 Bytes
7520416 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | <!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cenários - Mobile Test Pilot</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#21223a',
secondary: '#ff580f',
}
}
}
}
</script>
</head>
<body class="bg-primary min-h-screen text-white">
<custom-sidebar></custom-sidebar>
<main class="ml-64 p-8">
<div class="max-w-7xl mx-auto">
<div class="flex items-center justify-between mb-8">
<div>
<h1 class="text-3xl font-bold mb-2">Cenários de Teste</h1>
<p class="text-gray-300">Organize seus testes em cenários separados como branches</p>
</div>
<div class="flex items-center gap-4">
<div class="relative">
<input type="text" placeholder="Buscar cenário..." class="bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 pl-10 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50">
<i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"></i>
</div>
<button onclick="openCreateScenarioModal()" class="bg-secondary hover:bg-orange-600 text-white px-4 py-2 rounded-lg flex items-center gap-2">
<i data-feather="plus" class="w-4 h-4"></i>
Novo Cenário
</button>
</div>
</div>
<!-- Estatísticas -->
<div class="grid grid-cols-4 gap-6 mb-8">
<div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Total de Cenários</p>
<p class="text-2xl font-bold">8</p>
</div>
<div class="w-12 h-12 bg-secondary bg-opacity-20 rounded-full flex items-center justify-center">
<i data-feather="git-branch" class="text-secondary"></i>
</div>
</div>
</div>
<div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Cenários Ativos</p>
<p class="text-2xl font-bold text-green-400">5</p>
</div>
<div class="w-12 h-12 bg-green-500 bg-opacity-20 rounded-full flex items-center justify-center">
<i data-feather="activity" class="text-green-400"></i>
</div>
</div>
</div>
<div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Testes por Cenário</p>
<p class="text-2xl font-bold text-blue-400">12</p>
</div>
<div class="w-12 h-12 bg-blue-500 bg-opacity-20 rounded-full flex items-center justify-center">
<i data-feather="bar-chart-2" class="text-blue-400"></i>
</div>
</div>
</div>
<div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Cenários Concluídos</p>
<p class="text-2xl font-bold text-purple-400">3</p>
</div>
<div class="w-12 h-12 bg-purple-500 bg-opacity-20 rounded-full flex items-center justify-center">
<i data-feather="check-circle" class="text-purple-400"></i>
</div>
</div>
</div>
</div>
<!-- Grid de Cenários -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Cenário 1 -->
<div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl hover:bg-gray-800 transition-colors cursor-pointer" onclick="viewScenario('login-flow')">
<div class="flex items-center justify-between mb-4">
<span class="bg-green-500 text-white px-3 py-1 rounded-full text-xs">Ativo</span>
<div class="flex gap-2">
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Editar">
<i data-feather="edit" class="w-3 h-3"></i>
</button>
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Configurar">
<i data-feather="settings" class="w-3 h-3"></i>
</button>
</div>
</div>
<div class="flex items-center gap-3 mb-4">
<div class="w-12 h-12 bg-green-500 bg-opacity-20 rounded-xl flex items-center justify-center">
<i data-feather="user" class="text-green-400"></i>
</div>
<div>
<h3 class="font-semibold text-lg">Fluxo de Login</h3>
<p class="text-sm text-gray-400">Testes de autenticação</p>
</div>
</div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div>
<p class="text-sm text-gray-400">Testes</p>
<p class="font-semibold">8</p>
</div>
<div>
<p class="text-sm text-gray-400">Sucesso</p>
<p class="font-semibold text-green-400">6</p>
</div>
</div>
<div class="flex items-center justify-between text-sm text-gray-400">
<span>Criado: 15/12</span>
<span>v1.0</span>
</div>
</div>
<!-- Cenário 2 -->
<div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl hover:bg-gray-800 transition-colors cursor-pointer" onclick="viewScenario('checkout-flow')">
<div class="flex items-center justify-between mb-4">
<span class="bg-blue-500 text-white px-3 py-1 rounded-full text-xs">Ativo</span>
<div class="flex gap-2">
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Editar">
<i data-feather="edit" class="w-3 h-3"></i>
</button>
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Configurar">
<i data-feather="settings" class="w-3 h-3"></i>
</button>
</div>
</div>
<div class="flex items-center gap-3 mb-4">
<div class="w-12 h-12 bg-blue-500 bg-opacity-20 rounded-xl flex items-center justify-center">
<i data-feather="shopping-cart" class="text-blue-400"></i>
</div>
<div>
<h3 class="font-semibold text-lg">Fluxo de Checkout</h3>
<p class="text-sm text-gray-400">Processo de compra</p>
</div>
</div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div>
<p class="text-sm text-gray-400">Testes</p>
<p class="font-semibold">12</p>
</div>
<div>
<p class="text-sm text-gray-400">Sucesso</p>
<p class="font-semibold text-green-400">10</p>
</div>
</div>
<div class="flex items-center justify-between text-sm text-gray-400">
<span>Criado: 14/12</span>
<span>v2.1</span>
</div>
</div>
<!-- Cenário 3 -->
<div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl hover:bg-gray-800 transition-colors cursor-pointer" onclick="viewScenario('performance-tests')">
<div class="flex items-center justify-between mb-4">
<span class="bg-yellow-500 text-white px-3 py-1 rounded-full text-xs">Pausado</span>
<div class="flex gap-2">
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Editar">
<i data-feather="edit" class="w-3 h-3"></i>
</button>
<button class="p-1 hover:bg-gray-700 rounded transition-colors" title="Configurar">
<i data-feather="settings" class="w-3 h-3"></i>
</button>
</div>
</div>
<div class="flex items-center gap-3 mb-4">
<div class="w-12 h-12 bg-yellow-500 bg-opacity-20 rounded-xl flex items-center justify-center">
<i data-feather="bar-chart-2" class="text-yellow-400"></i>
</div>
<div>
<h3 class="font-semibold text-lg">Testes de Performance</h3>
<p class="text-sm text-gray-400">Análise de desempenho</p>
</div>
</div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div>
<p class="text-sm text-gray-400">Testes</p>
<p class="font-semibold">6</p>
</div>
<div>
<p class="text-sm text-gray-400">Sucesso</p>
<p class="font-semibold text-green-400">4</p>
</div>
</div>
<div class="flex items-center justify-between text-sm text-gray-400">
<span>Criado: 13/12</span>
<span>v1.5</span>
</div>
</div>
</div>
<!-- Botão para ver mais cenários -->
<div class="text-center mt-8">
<button class="bg-gray-800 hover:bg-gray-700 text-white px-6 py-3 rounded-lg flex items-center gap-2 mx-auto">
<i data-feather="plus" class="w-4 h-4"></i>
Carregar Mais Cenários
</button>
</div>
</div>
</main>
<!-- Modal de Criação de Cenário -->
<div id="createScenarioModal" class="fixed inset-0 bg-black bg-opacity-75 hidden flex items-center justify-center z-50 p-4">
<div class="bg-primary rounded-2xl border border-gray-700 w-full max-w-2xl">
<div class="p-6 border-b border-gray-700 flex justify-between items-center">
<h3 class="text-xl font-semibold">Criar Novo Cenário</h3>
<button onclick="closeCreateScenarioModal()" class="text-gray-400 hover:text-white">
<i data-feather="x"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Nome do Cenário</label>
<input type="text" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50" placeholder="Ex: Fluxo de Pagamento">
</div>
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Descrição</label>
<textarea class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50" rows="3" placeholder="Descreva o propósito deste cenário de teste"></textarea>
</div>
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Plataforma Alvo</label>
<select class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50">
<option value="android">Android</option>
<option value="ios">iOS</option>
<option value="both">Ambas as Plataformas</option>
</select>
</div>
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Versão</label>
<input type="text" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50" placeholder="Ex: v1.0.0">
</div>
<div class="flex justify-end gap-3">
<button onclick="closeCreateScenarioModal()" class="px-4 py-2 text-gray-300 hover:text-white transition-colors">
Cancelar
</button>
<button onclick="createScenario()" class="bg-secondary hover:bg-orange-600 text-white px-6 py-2 rounded-lg transition-colors duration-300 flex items-center gap-2">
<i data-feather="plus" class="w-4 h-4"></i>
Criar Cenário
</button>
</div>
</div>
</div>
</div>
<script src="components/sidebar.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
function openCreateScenarioModal() {
document.getElementById('createScenarioModal').classList.remove('hidden');
document.getElementById('createScenarioModal').classList.add('flex');
}
function closeCreateScenarioModal() {
document.getElementById('createScenarioModal').classList.add('hidden');
document.getElementById('createScenarioModal').classList.remove('flex');
}
function createScenario() {
// Simular criação de cenário
alert('Cenário criado com sucesso!');
closeCreateScenarioModal();
}
function viewScenario(scenarioId) {
// Redirecionar para a página de detalhes do cenário
window.location.href = `scenario-detail.html?id=${scenarioId}`;
}
// Atualizar sidebar para marcar a página ativa
document.addEventListener('DOMContentLoaded', function() {
const sidebar = document.querySelector('custom-sidebar');
if (sidebar) {
const navItems = sidebar.shadowRoot.querySelectorAll('.nav-item');
navItems.forEach(item => {
if (item.querySelector('span').textContent === 'Cenários') {
item.classList.add('active');
} else {
item.classList.remove('active');
}
});
}
});
</script>
</body>
</html> |