1 document.addEventListener('DOMContentLoaded', function() {2 document.getElementById('welcome-modal').classList.remove('hidden');3 });4 5 function closeWelcomeModal() {6 document.getElementById('welcome-modal').classList.add('hidden');7 }8 9 function addVariable() {10 const list = document.getElementById('elements-list');11 const div = document.createElement('div');12 div.classList.add('element', 'bg-white', 'p-4', 'rounded-lg', 'shadow-md', 'flex', 'items-center', 'space-x-4');13 div.innerHTML = `14 <span class="text-gray-700">Variable</span>15 <input type="text" placeholder="Nombre" class="flex-1 p-2 border border-gray-300 rounded" />16 <input type="text" placeholder="Valor" class="flex-1 p-2 border border-gray-300 rounded" />17 <button type="button" onclick="removeElement(this)" class="text-red-500">x</button>18 `;19 list.appendChild(div);20 }21 22 function addRequest() {23 const list = document.getElementById('elements-list');24 const div = document.createElement('div');25 div.classList.add('element', 'bg-white', 'p-4', 'rounded-lg', 'shadow-md', 'flex', 'items-center', 'space-x-4');26 div.innerHTML = `27 <span class="text-gray-700">Request</span>28 <select class="flex-1 p-2 border border-gray-300 rounded">29 <option>GET</option>30 <option>POST</option>31 <option>PUT</option>32 <option>DELETE</option>33 </select>34 <input type="text" placeholder="URL" class="flex-1 p-2 border border-gray-300 rounded" />35 <textarea placeholder="Headers" class="flex-1 p-2 border border-gray-300 rounded"></textarea>36 <textarea placeholder="Body" class="flex-1 p-2 border border-gray-300 rounded"></textarea>37 <button type="button" onclick="removeElement(this)" class="text-red-500">x</button>38 `;39 list.appendChild(div);40 }41 42 function addAssert() {43 const list = document.getElementById('elements-list');44 const div = document.createElement('div');45 div.classList.add('element', 'bg-white', 'p-4', 'rounded-lg', 'shadow-md', 'space-y-4');46 div.innerHTML = `47 <span class="text-gray-700">Assert</span>48 <div class="flex items-center space-x-4">49 <select class="flex-1 p-2 border border-gray-300 rounded" onchange="updateAssertInput(this)">50 <option value="equals">Igual a</option>51 <option value="not_equals">Distinto a</option>52 <option value="contains">Contiene</option>53 <option value="not_contains">No contiene</option>54 </select>55 <input type="text" placeholder="Referencia" class="flex-1 p-2 border border-gray-300 rounded assert-reference" list="references-datalist"/>56 <datalist id="references-datalist">57 <option value="response.status">58 <option value="response.headers.Content-Type">59 <option value="response.body.user.name">60 <!-- Añadir más opciones dinámicamente -->61 </datalist>62 <input type="text" placeholder="Valor" class="flex-1 p-263
Enlace
El enlace para compartir es: