|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>Test Cases - TestCaseMaster Pro</title> |
|
|
<link rel="stylesheet" href="style.css"> |
|
|
<script src="https://cdn.tailwindcss.com"></script> |
|
|
<script src="https://unpkg.com/feather-icons"></script> |
|
|
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> |
|
|
<script src="components/navbar.js"></script> |
|
|
<script src="components/sidebar.js"></script> |
|
|
<script src="components/test-case-item.js"></script> |
|
|
</head> |
|
|
<body class="bg-gray-50"> |
|
|
<custom-navbar></custom-navbar> |
|
|
|
|
|
<div class="flex"> |
|
|
<custom-sidebar></custom-sidebar> |
|
|
|
|
|
<main class="flex-1 p-8"> |
|
|
<div class="flex justify-between items-center mb-8"> |
|
|
<h1 class="text-3xl font-bold text-gray-800" id="page-title">Test Cases</h1> |
|
|
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center"> |
|
|
<i data-feather="plus" class="mr-2"></i> Create Test Case |
|
|
</button> |
|
|
</div> |
|
|
|
|
|
<div class="bg-white rounded-lg shadow p-6 mb-6"> |
|
|
<div class="flex items-center justify-between mb-4"> |
|
|
<h2 class="text-xl font-semibold">Filter Test Cases</h2> |
|
|
<div class="flex items-center space-x-4"> |
|
|
<div class="relative"> |
|
|
<input type="text" placeholder="Search test cases..." |
|
|
class="pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"> |
|
|
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i> |
|
|
</div> |
|
|
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
|
<option>All Status</option> |
|
|
<option>Passed</option> |
|
|
<option>Failed</option> |
|
|
<option>Pending</option> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="grid grid-cols-1 gap-4" id="test-cases-container"> |
|
|
|
|
|
</div> |
|
|
</main> |
|
|
</div> |
|
|
|
|
|
<script> |
|
|
feather.replace(); |
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
const urlParams = new URLSearchParams(window.location.search); |
|
|
const type = urlParams.get('type') || 'all'; |
|
|
|
|
|
|
|
|
document.getElementById('page-title').textContent = |
|
|
`${type.charAt(0).toUpperCase() + type.slice(1)} Test Cases`; |
|
|
|
|
|
|
|
|
loadTestCases(type); |
|
|
}); |
|
|
|
|
|
function loadTestCases(type) { |
|
|
const container = document.getElementById('test-cases-container'); |
|
|
container.innerHTML = ''; |
|
|
|
|
|
|
|
|
const testCases = [ |
|
|
{ |
|
|
id: 1, |
|
|
title: 'SIT - Login functionality', |
|
|
description: 'Validate login flow in system integration environment', |
|
|
priority: 'High', |
|
|
status: 'Passed', |
|
|
type: 'SIT', |
|
|
lastRun: '2 hours ago' |
|
|
}, |
|
|
{ |
|
|
id: 2, |
|
|
title: 'UAT - Checkout process', |
|
|
description: 'End-to-end checkout validation with real users', |
|
|
priority: 'Critical', |
|
|
status: 'Pending', |
|
|
type: 'UAT', |
|
|
lastRun: 'Not run yet' |
|
|
}, |
|
|
{ |
|
|
id: 3, |
|
|
title: 'Functional - Password reset', |
|
|
description: 'Verify password reset functionality', |
|
|
priority: 'High', |
|
|
status: 'Passed', |
|
|
type: 'Functional', |
|
|
lastRun: '1 day ago' |
|
|
}, |
|
|
{ |
|
|
id: 4, |
|
|
title: 'SIT - API integration', |
|
|
description: 'Validate all API integrations', |
|
|
priority: 'Medium', |
|
|
status: 'Warning', |
|
|
type: 'SIT', |
|
|
lastRun: '3 days ago' |
|
|
}, |
|
|
{ |
|
|
id: 5, |
|
|
title: 'UAT - Mobile responsiveness', |
|
|
description: 'User acceptance testing for mobile devices', |
|
|
priority: 'High', |
|
|
status: 'Failed', |
|
|
type: 'UAT', |
|
|
lastRun: '5 days ago' |
|
|
} |
|
|
]; |
|
|
|
|
|
const filteredCases = type === 'all' |
|
|
? testCases |
|
|
: testCases.filter(c => c.type.toLowerCase() === type); |
|
|
|
|
|
|
|
|
filteredCases.forEach(testCase => { |
|
|
const el = document.createElement('test-case-item'); |
|
|
el.setAttribute('data', JSON.stringify(testCase)); |
|
|
container.appendChild(el); |
|
|
}); |
|
|
} |
|
|
</script> |
|
|
<script src="script.js"></script> |
|
|
</body> |
|
|
</html> |