@nbakka/mcp-appium 2.0.99 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,176 +0,0 @@
1
- let sessionId = '';
2
- let testCasesData = {};
3
-
4
- function initializeTestCases(data) {
5
- sessionId = data.sessionId;
6
- testCasesData = data.testCases;
7
-
8
- renderNewTestCases();
9
- renderModifiedTestCases();
10
- renderRemoveTestCases();
11
-
12
- // Hide empty sections
13
- toggleSectionVisibility();
14
- }
15
-
16
- function renderNewTestCases() {
17
- const container = document.getElementById('new-testcases');
18
- const newCases = testCasesData.new || [];
19
-
20
- if (newCases.length === 0) {
21
- container.innerHTML = '<p class="no-cases">No new test cases</p>';
22
- return;
23
- }
24
-
25
- container.innerHTML = newCases.map((testCase, index) => `
26
- <div class="test-case new" data-index="${index}" data-type="new">
27
- <div class="test-case-header">
28
- <span class="test-type new">New</span>
29
- <button class="remove-btn" onclick="removeTestCase('new', ${index})">Remove</button>
30
- </div>
31
- <div class="test-description">
32
- <textarea onchange="updateTestCase('new', ${index}, this.value)">${testCase}</textarea>
33
- </div>
34
- </div>
35
- `).join('');
36
- }
37
-
38
- function renderModifiedTestCases() {
39
- const container = document.getElementById('modified-testcases');
40
- const modifiedCases = testCasesData.modify || [];
41
-
42
- if (modifiedCases.length === 0) {
43
- container.innerHTML = '<p class="no-cases">No modified test cases</p>';
44
- return;
45
- }
46
-
47
- container.innerHTML = modifiedCases.map((testCase, index) => `
48
- <div class="test-case modify" data-index="${index}" data-type="modify">
49
- <div class="test-case-header">
50
- <span class="test-id">${testCase.id}</span>
51
- <div>
52
- <span class="test-type modify">Modify</span>
53
- <button class="remove-btn" onclick="removeTestCase('modify', ${index})">Remove</button>
54
- </div>
55
- </div>
56
- <div class="before-after">
57
- <div class="before-content">
58
- <h4>Before (Original)</h4>
59
- <div>${testCase.original}</div>
60
- </div>
61
- <div class="after-content">
62
- <h4>After (Modified)</h4>
63
- <textarea onchange="updateModifiedTestCase(${index}, this.value)">${testCase.modified}</textarea>
64
- </div>
65
- </div>
66
- </div>
67
- `).join('');
68
- }
69
-
70
- function renderRemoveTestCases() {
71
- const container = document.getElementById('remove-testcases');
72
- const removeCases = testCasesData.remove || [];
73
-
74
- if (removeCases.length === 0) {
75
- container.innerHTML = '<p class="no-cases">No test cases to remove</p>';
76
- return;
77
- }
78
-
79
- container.innerHTML = removeCases.map((testCase, index) => `
80
- <div class="test-case remove" data-index="${index}" data-type="remove">
81
- <div class="test-case-header">
82
- <span class="test-id">${testCase.id}</span>
83
- <span class="test-type">Remove</span>
84
- </div>
85
- <div class="test-description">
86
- <div>${testCase.description}</div>
87
- </div>
88
- </div>
89
- `).join('');
90
- }
91
-
92
- function removeTestCase(type, index) {
93
- if (confirm('Are you sure you want to remove this test case?')) {
94
- testCasesData[type].splice(index, 1);
95
-
96
- if (type === 'new') renderNewTestCases();
97
- else if (type === 'modify') renderModifiedTestCases();
98
-
99
- toggleSectionVisibility();
100
- }
101
- }
102
-
103
- function updateTestCase(type, index, value) {
104
- testCasesData[type][index] = value;
105
- }
106
-
107
- function updateModifiedTestCase(index, value) {
108
- testCasesData.modify[index].modified = value;
109
- }
110
-
111
- function toggleSectionVisibility() {
112
- const newSection = document.getElementById('new-testcases-section');
113
- const modifySection = document.getElementById('modified-testcases-section');
114
- const removeSection = document.getElementById('remove-testcases-section');
115
-
116
- newSection.classList.toggle('hidden', !testCasesData.new || testCasesData.new.length === 0);
117
- modifySection.classList.toggle('hidden', !testCasesData.modify || testCasesData.modify.length === 0);
118
- removeSection.classList.toggle('hidden', !testCasesData.remove || testCasesData.remove.length === 0);
119
- }
120
-
121
- function approveTestCases() {
122
- const approveBtn = document.getElementById('approve-btn');
123
- const cancelBtn = document.getElementById('cancel-btn');
124
- const status = document.getElementById('status');
125
-
126
- approveBtn.disabled = true;
127
- cancelBtn.disabled = true;
128
- approveBtn.innerHTML = 'Processing...';
129
- approveBtn.style.background = '#6c757d';
130
-
131
- status.style.display = 'block';
132
- status.className = 'status success';
133
- status.innerHTML = 'Test cases approved! Processing...';
134
-
135
- fetch(`/approve/${sessionId}`, {
136
- method: 'POST',
137
- headers: {
138
- 'Content-Type': 'application/json',
139
- },
140
- body: JSON.stringify(testCasesData)
141
- })
142
- .then(response => response.text())
143
- .then(data => {
144
- status.innerHTML = data + ' You can close this window.';
145
- setTimeout(() => {
146
- window.close();
147
- }, 3000);
148
- })
149
- .catch(error => {
150
- status.className = 'status error';
151
- status.innerHTML = 'Error: ' + error.message;
152
- approveBtn.disabled = false;
153
- cancelBtn.disabled = false;
154
- });
155
- }
156
-
157
- function cancelReview() {
158
- if (confirm('Are you sure you want to cancel the review? All changes will be lost.')) {
159
- fetch(`/cancel/${sessionId}`, { method: 'POST' })
160
- .then(() => {
161
- window.close();
162
- });
163
- }
164
- }
165
-
166
- // Load initial data when page loads
167
- window.addEventListener('DOMContentLoaded', function() {
168
- fetch('/api/testcases')
169
- .then(response => response.json())
170
- .then(data => {
171
- initializeTestCases(data);
172
- })
173
- .catch(error => {
174
- console.error('Error loading test cases:', error);
175
- });
176
- });
@@ -1,244 +0,0 @@
1
- body {
2
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
3
- margin: 0;
4
- padding: 20px;
5
- background-color: #f8f9fa;
6
- line-height: 1.6;
7
- }
8
-
9
- .container {
10
- max-width: 1400px;
11
- margin: 0 auto;
12
- background: white;
13
- padding: 30px;
14
- border-radius: 12px;
15
- box-shadow: 0 4px 20px rgba(0,0,0,0.1);
16
- }
17
-
18
- h1 {
19
- color: #2c3e50;
20
- text-align: center;
21
- border-bottom: 3px solid #3498db;
22
- padding-bottom: 15px;
23
- margin-bottom: 30px;
24
- }
25
-
26
- h2 {
27
- color: #34495e;
28
- border-left: 4px solid #3498db;
29
- padding-left: 15px;
30
- margin-top: 30px;
31
- }
32
-
33
- .section {
34
- margin-bottom: 40px;
35
- padding: 20px;
36
- border: 1px solid #e9ecef;
37
- border-radius: 8px;
38
- background: #fdfdfd;
39
- }
40
-
41
- .test-case {
42
- margin: 15px 0;
43
- padding: 20px;
44
- border: 1px solid #dee2e6;
45
- border-radius: 8px;
46
- background: white;
47
- position: relative;
48
- }
49
-
50
- .test-case.new {
51
- border-left: 4px solid #28a745;
52
- }
53
-
54
- .test-case.modify {
55
- border-left: 4px solid #ffc107;
56
- }
57
-
58
- .test-case.remove {
59
- border-left: 4px solid #dc3545;
60
- background: #fff5f5;
61
- }
62
-
63
- .test-case-header {
64
- display: flex;
65
- justify-content: space-between;
66
- align-items: center;
67
- margin-bottom: 15px;
68
- }
69
-
70
- .test-id {
71
- font-weight: bold;
72
- color: #3498db;
73
- font-size: 14px;
74
- background: #ecf0f1;
75
- padding: 4px 8px;
76
- border-radius: 4px;
77
- }
78
-
79
- .test-type {
80
- padding: 4px 12px;
81
- border-radius: 20px;
82
- font-size: 12px;
83
- font-weight: bold;
84
- text-transform: uppercase;
85
- }
86
-
87
- .test-type.new {
88
- background: #d4edda;
89
- color: #155724;
90
- }
91
-
92
- .test-type.modify {
93
- background: #fff3cd;
94
- color: #856404;
95
- }
96
-
97
- .remove-btn {
98
- background: #dc3545;
99
- color: white;
100
- border: none;
101
- padding: 6px 12px;
102
- border-radius: 4px;
103
- cursor: pointer;
104
- font-size: 12px;
105
- }
106
-
107
- .remove-btn:hover {
108
- background: #c82333;
109
- }
110
-
111
- .test-description {
112
- margin: 10px 0;
113
- }
114
-
115
- .test-description textarea {
116
- width: 100%;
117
- min-height: 60px;
118
- padding: 10px;
119
- border: 1px solid #ced4da;
120
- border-radius: 4px;
121
- font-family: inherit;
122
- resize: vertical;
123
- }
124
-
125
- .test-description textarea:focus {
126
- outline: none;
127
- border-color: #3498db;
128
- box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
129
- }
130
-
131
- .before-after {
132
- display: grid;
133
- grid-template-columns: 1fr 1fr;
134
- gap: 15px;
135
- margin-top: 15px;
136
- }
137
-
138
- .before-content, .after-content {
139
- padding: 10px;
140
- border-radius: 4px;
141
- }
142
-
143
- .before-content {
144
- background: #f8f9fa;
145
- border: 1px solid #dee2e6;
146
- }
147
-
148
- .after-content {
149
- background: #fff;
150
- border: 1px solid #ced4da;
151
- }
152
-
153
- .before-content h4, .after-content h4 {
154
- margin: 0 0 8px 0;
155
- font-size: 14px;
156
- color: #495057;
157
- }
158
-
159
- .after-content textarea {
160
- width: 100%;
161
- min-height: 50px;
162
- border: 1px solid #ced4da;
163
- border-radius: 4px;
164
- padding: 8px;
165
- font-family: inherit;
166
- }
167
-
168
- .button-container {
169
- text-align: center;
170
- margin-top: 40px;
171
- padding-top: 30px;
172
- border-top: 2px solid #e9ecef;
173
- }
174
-
175
- button {
176
- padding: 15px 30px;
177
- margin: 0 10px;
178
- border: none;
179
- border-radius: 6px;
180
- cursor: pointer;
181
- font-size: 16px;
182
- font-weight: bold;
183
- transition: all 0.3s ease;
184
- }
185
-
186
- #approve-btn {
187
- background: #28a745;
188
- color: white;
189
- }
190
-
191
- #approve-btn:hover {
192
- background: #218838;
193
- transform: translateY(-1px);
194
- }
195
-
196
- #cancel-btn {
197
- background: #6c757d;
198
- color: white;
199
- }
200
-
201
- #cancel-btn:hover {
202
- background: #5a6268;
203
- }
204
-
205
- .status {
206
- text-align: center;
207
- margin-top: 20px;
208
- font-weight: bold;
209
- display: none;
210
- padding: 15px;
211
- border-radius: 6px;
212
- }
213
-
214
- .status.success {
215
- background: #d4edda;
216
- color: #155724;
217
- border: 1px solid #c3e6cb;
218
- }
219
-
220
- .status.error {
221
- background: #f8d7da;
222
- color: #721c24;
223
- border: 1px solid #f5c6cb;
224
- }
225
-
226
- .hidden {
227
- display: none !important;
228
- }
229
-
230
- @media (max-width: 768px) {
231
- .before-after {
232
- grid-template-columns: 1fr;
233
- }
234
-
235
- .container {
236
- padding: 15px;
237
- }
238
-
239
- button {
240
- display: block;
241
- width: 100%;
242
- margin: 5px 0;
243
- }
244
- }