Software Test Case Generator

Software Test Case Generator

General Information

Classification

Pre-conditions & Environment

Test Execution Steps

# Step Description Test Data Input Expected Result Action
1
2

Post-conditions

Please fill out the previous tabs to generate the preview.

Test Case Specification

ID:
Title:
Priority: Type:
Designed By: Date:

Pre-conditions & Environment

Test Data

Test Procedure

# Step Description Test Data Expected Result Actual / Status

Post-conditions

Tested By (Signature)
Date Tested

Pre-conditions: ${pre}

${stepsHtml}
# Step Data Expected Result
`; document.getElementById('tc-preview-area').innerHTML = previewHtml; tcNextTab('tc-tab-preview'); // Populate Hidden PDF Container document.getElementById('pdf-id').innerText = id; document.getElementById('pdf-title').innerText = title; document.getElementById('pdf-module').innerText = module; document.getElementById('pdf-priority').innerText = priority; document.getElementById('pdf-type').innerText = type; document.getElementById('pdf-author').innerText = author; document.getElementById('pdf-date').innerText = date; // Sanitize textareas for HTML document.getElementById('pdf-precond').innerText = pre; document.getElementById('pdf-data').innerText = data; document.getElementById('pdf-postcond').innerText = post; // PDF Table Body const pdfTbody = document.getElementById('pdf-steps-body'); pdfTbody.innerHTML = ''; // clear rows.forEach(row => { const num = row.querySelector('.step-num').innerText; const desc = row.querySelector('.input-desc').value; const tData = row.querySelector('.input-data').value; const exp = row.querySelector('.input-exp').value; const tr = document.createElement('tr'); tr.innerHTML = ` ${num} ${desc} ${tData} ${exp} `; // Empty last cell for manual entry pdfTbody.appendChild(tr); }); }; // --- Download PDF --- document.getElementById('tc-download-btn').addEventListener('click', function() { const element = document.getElementById('tc-print-container'); const id = document.getElementById('tc-id').value || 'Test_Case'; const opt = { margin: 0.5, filename: `${id}_Spec.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' } }; html2pdf().set(opt).from(element).save(); }); });
Scroll to Top