1 <!DOCTYPE html>2 <html lang="en">3 <head>4 <meta charset="UTF-8">5 <meta name="viewport" content="width=device-width, initial-scale=1.0">6 <title>Flowtest Editor</title>7 <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">8 </head>9 <body class="bg-gray-100">10 <div class="container mx-auto p-4">11 <form class="space-y-6">12 <!-- Modal de bienvenida -->13 <div id="welcome-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden">14 <div class="bg-white p-6 rounded-lg shadow-md max-w-lg">15 <h2 class="text-xl font-semibold mb-4">Bienvenido a Flowtest Editor</h2>16 <p class="mb-4">Aquí puedes agregar y editar variables, requests y asserts directamente en la lista. Usa los botones "+" para añadir nuevos elementos.</p>17 <button type="button" onclick="closeWelcomeModal()" class="bg-blue-500 text-white px-4 py-2 rounded">Entendido</button>18 </div>19 </div>20 21 <!-- Lista de Elementos -->22 <div id="elements-list" class="space-y-4">23 <!-- Ejemplo de variable -->24 <div class="element bg-white p-4 rounded-lg shadow-md flex items-center space-x-4">25 <span class="text-gray-700">Variable</span>26 <input type="text" placeholder="Nombre" class="flex-1 p-2 border border-gray-300 rounded" />27 <input type="text" placeholder="Valor" class="flex-1 p-2 border border-gray-300 rounded" />28 <button type="button" onclick="removeElement(this)" class="text-red-500">x</button>29 </div>30 31 <!-- Ejemplo de request -->32 <div class="element bg-white p-4 rounded-lg shadow-md flex items-center space-x-4">33 <span class="text-gray-700">Request</span>34 <select class="flex-1 p-2 border border-gray-300 rounded">35 <option>GET</option>36 <option>POST</option>37 <option>PUT</option>38 <option>DELETE</option>39 </select>40 <input type="text" placeholder="URL" class="flex-1 p-2 border border-gray-300 rounded" />41 <textarea placeholder="Headers" class="flex-1 p-2 border border-gray-300 rounded"></textarea>42 <textarea placeholder="Body" class="flex-1 p-2 border border-gray-300 rounded"></textarea>43 <button type="button" onclick="removeElement(this)" class="text-red-500">x</button>44 </div>45 46 <!-- Ejemplo de assert -->47 <div class="element bg-white p-4 rounded-lg shadow-md space-y-4">48 <span class="text-gray-700">Assert</span>49 <div class="flex items-center space-x-4">50 <select class="flex-1 p-2 border border-gray-300 rounded" onchange="updateAssertInput(this)">51 <option value="equals">Igual a</option>52 <option value="not_equals">Distinto a</option>53 <option value="contains">Contiene</option>54 <option value="not_contains">No contiene</option>55 </select>56 <input type="text" placeholder="Referencia" class="flex-1 p-2 border border-gray-300 rounded assert-reference" list="references-datalist"/>57 <datalist id="references-datalist">58 <option value="response.status">59 <option value="response.headers.Content-Type">60 <option value="response.body.user.name">61 <!-- Añadir más opciones dinámicamente -->62 </datalist>63 <input type="text" placeholder="Valor" class="flex-1 p-2 border border-gray-300 rounded assert-value" />64 <button type="button" onclick="removeElement(this)" class="text-red-500">x</button>65 </div>66 </div>67 </div>68 69 <!-- Botones para Añadir Elemento -->70 <div class="flex justify-between">71 <button type="button" onclick="addVariable()" class="bg-blue-500 text-white px-4 py-2 rounded">+ Variable</button>72 <button type="button" onclick="addRequest()" class="bg-blue-500 text-white px-4 py-2 rounded">+ Request</button>73 <button type="button" onclick="addAssert()" class="bg-blue-500 text-white px-4 py-2 rounded">+ Assert</button>74 </div>75 76 <!-- Save Button -->77 <div class="flex justify-end mt-4">78 <button type="button" onclick="saveTest()" class="bg-green-500 text-white px-4 py-2 rounded">Save Test</button>79 </div>80 </form>81 </div>82 83 <script src="script.js"></script>84 </body>85 </html>86
Enlace
El enlace para compartir es: