~kalikiana/+junk/ciathome

« back to all changes in this revision

Viewing changes to site/index.html

  • Committer: Florian Boucault
  • Date: 2014-02-15 00:42:13 UTC
  • Revision ID: florian.boucault@canonical.com-20140215004213-bxgmump2rfcmpca2
Added ability to input exact testcase to run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
            overflow-y: auto;
52
52
        }
53
53
        header {
54
 
            font-weight: bold;
55
54
            padding-top: 20px;
56
55
            padding-bottom: 10px;
57
56
        }
67
66
            var testsRunning = false;
68
67
            var logfile = "";
69
68
            var url;
 
69
            var testcase;
70
70
            var flashing;
71
71
            var plugged;
72
72
 
123
123
            function updateLogFileLink() {
124
124
                
125
125
            }
126
 
            
 
126
 
127
127
            function updateHeader() {
128
128
                var header = document.getElementById('header');
129
 
                header.innerHTML = "Testing on latest image with packages from:<br>" + url;
 
129
                header.innerHTML = "<b>Testing on latest image from channel 'devel'.</b>"
 
130
                header.innerHTML += "<br>"
 
131
                header.innerHTML += "<b>Packages from:</b> " + url;
 
132
                header.innerHTML += "<br>"
 
133
                header.innerHTML += "<b>Testcase:</b> " + testcase;
130
134
            }
131
135
 
132
136
            function clearOutput() {
134
138
                output.textContent = "";
135
139
            }
136
140
 
137
 
            function launchTests(url) {
138
 
                sendMessage('LAUNCH_TESTS', url);
 
141
            function launchTests(url, testcase) {
 
142
                sendMessage('LAUNCH_TESTS', url + "|||" + testcase);
139
143
            }
140
144
 
141
145
            function cancelTests() {
171
175
                        logfile = message.content;
172
176
                        updateLogFileLink();
173
177
                    } else if (message.type == "TESTS_LAUNCHED") {
174
 
                        url = message.content;
 
178
                        parsed = message.content.split("|||");
 
179
                        url = parsed[0];
 
180
                        testcase = parsed[1];
 
181
                        console.log("tests launched", message.content, url, testcase)
175
182
                        clearOutput();
176
183
                        updateHeader();
177
184
                    } else if (message.type == "FLASHING") {
193
200
    </head>
194
201
    <body>
195
202
        <input id="debUrl" size="80" placeholder="URL of zip file from Jenkins">
196
 
        <button id="testButton" onClick="launchTests(debUrl.value);">Launch Tests</button>
 
203
        <button id="testButton" onClick="launchTests(debUrl.value, testcaseInput.value);">Launch Tests</button>
197
204
        <button id="cancelButton" onClick="cancelTests();" disabled=true>Cancel</button>
198
205
        <button id="rebootButton" onClick="reboot();" disabled=true>Reboot Device</button>
 
206
        <input id="testcaseInput" size="80" placeholder="Test case to be run, leave empty for all tests">
199
207
        <div id="deviceStatus"></div>
200
208
        <header id="header"></header>
201
209
        <pre class="console" id="output"></pre>