Files
crm.clientright.ru/crm_extensions/tests/test_full_integration.html

157 lines
7.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧪 Тест полной интеграции Nextcloud редактора</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; background: #f5f5f5; }
.test-panel {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.button {
background: #007bff;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
margin: 5px;
}
.button.success { background: #28a745; }
.button.warning { background: #ffc107; color: #000; }
.button:hover { opacity: 0.8; }
.status { padding: 10px; margin: 10px 0; border-radius: 5px; }
.status.success { background: #d4edda; color: #155724; }
.status.error { background: #f8d7da; color: #721c24; }
.status.info { background: #d1ecf1; color: #0c5460; }
.log { background: #000; color: #0f0; padding: 15px; border-radius: 5px; font-family: monospace; font-size: 12px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; }
</style>
</head>
<body>
<div class="test-panel">
<h1>🧪 Тест интеграции Nextcloud редактора</h1>
<p>Комплексное тестирование системы редактирования документов</p>
<div id="status" class="status info">
⏳ Готов к тестированию
</div>
<h3>🔧 Тесты компонентов:</h3>
<button class="button" onclick="testS3Connection()">Тест S3 подключения</button>
<button class="button" onclick="testNextcloudConnection()">Тест Nextcloud</button>
<button class="button" onclick="testFileUpload()">Тест загрузки файла</button>
<button class="button success" onclick="testFullWorkflow()">Полный тест workflow</button>
<h3>📋 Результаты тестов:</h3>
<div id="test-results" class="log"></div>
<h3>💡 Инструкции:</h3>
<ol>
<li>Сначала запустите тесты компонентов</li>
<li>Если всё работает - запустите полный тест</li>
<li>Проверьте что файл появился в Nextcloud</li>
<li>Откройте редактор и внесите изменения</li>
<li>Синхронизируйте изменения обратно</li>
</ol>
</div>
<script>
const logArea = document.getElementById('test-results');
const statusDiv = document.getElementById('status');
function addLog(message, type = 'info') {
const timestamp = new Date().toLocaleTimeString();
const logEntry = `[${timestamp}] ${type.toUpperCase()}: ${message}\n`;
logArea.textContent += logEntry;
logArea.scrollTop = logArea.scrollHeight;
}
function setStatus(message, type = 'info') {
statusDiv.textContent = message;
statusDiv.className = 'status ' + type;
}
async function testS3Connection() {
addLog('Тестирование S3 подключения...');
setStatus('🔍 Тестирую S3...', 'info');
try {
const response = await fetch('/crm_extensions/tests/test_s3_simple.php');
const result = await response.text();
if (result.includes('S3 хранилище полностью готово')) {
addLog('S3 подключение: ✅ УСПЕШНО', 'success');
setStatus('✅ S3 работает отлично!', 'success');
} else {
addLog('S3 подключение: ❌ ОШИБКА', 'error');
addLog('Детали: ' + result.substring(0, 200) + '...', 'error');
setStatus('❌ Проблема с S3', 'error');
}
} catch (error) {
addLog('S3 тест ошибка: ' + error.message, 'error');
setStatus('❌ Ошибка теста S3', 'error');
}
}
async function testNextcloudConnection() {
addLog('Тестирование Nextcloud подключения...');
setStatus('☁️ Тестирую Nextcloud...', 'info');
try {
const response = await fetch('/crm_extensions/tests/test_nextcloud.php');
const result = await response.text();
if (result.includes('Nextcloud полностью готов')) {
addLog('Nextcloud подключение: ✅ УСПЕШНО', 'success');
setStatus('✅ Nextcloud готов к работе!', 'success');
} else {
addLog('Nextcloud подключение: ⚠️ ЧАСТИЧНО', 'warning');
addLog('Детали: ' + result.substring(0, 200) + '...', 'warning');
setStatus('⚠️ Nextcloud работает с ограничениями', 'warning');
}
} catch (error) {
addLog('Nextcloud тест ошибка: ' + error.message, 'error');
setStatus('❌ Ошибка теста Nextcloud', 'error');
}
}
async function testFileUpload() {
addLog('Тестирование загрузки файла...');
setStatus('📁 Тестирую загрузку...', 'info');
// Здесь будет тест загрузки файла через API
addLog('Тест загрузки файла: 🔄 В РАЗРАБОТКЕ', 'info');
setStatus('🔄 Функция в разработке', 'info');
}
async function testFullWorkflow() {
addLog('=== ЗАПУСК ПОЛНОГО ТЕСТА WORKFLOW ===');
setStatus('🚀 Полное тестирование...', 'info');
// Последовательное тестирование всех компонентов
await testS3Connection();
await new Promise(resolve => setTimeout(resolve, 1000));
await testNextcloudConnection();
await new Promise(resolve => setTimeout(resolve, 1000));
await testFileUpload();
addLog('=== ПОЛНЫЙ ТЕСТ ЗАВЕРШЁН ===');
setStatus('🎉 Тестирование завершено!', 'success');
}
// Инициализация
document.addEventListener('DOMContentLoaded', function() {
addLog('Система тестирования загружена');
addLog('Готов к тестированию интеграции S3 + Nextcloud + vTiger');
});
</script>
</body>
</html>