[py-svn] r35165 - in py/dist/py/test/rsession: . webdata
guido at codespeak.net
guido at codespeak.net
Thu Nov 30 15:53:00 CET 2006
Author: guido
Date: Thu Nov 30 15:52:57 2006
New Revision: 35165
Modified:
py/dist/py/test/rsession/webdata/index.html
py/dist/py/test/rsession/webdata/source.js
py/dist/py/test/rsession/webjs.py
Log:
Shuffled HTML around a bit and applied some CSS. Also made that the page keeps
scrolling along with the tests until some message is displayed in the message
box.
Modified: py/dist/py/test/rsession/webdata/index.html
==============================================================================
--- py/dist/py/test/rsession/webdata/index.html (original)
+++ py/dist/py/test/rsession/webdata/index.html Thu Nov 30 15:52:57 2006
@@ -1,46 +1,116 @@
<html>
-<head>
- <title>Py.test</title>
- <script type="text/javascript" src="/jssource">
- </script>
-</head>
-<body onload="main()">
-<a name="beginning">
-<h3 id="Tests">Tests</h3>
-</a>
-<div style="visibility:hidden; position:fixed; left:100px; top:10px" id="info">
-</div>
-<table style="position:fixed; right:50px; top:50px; background-color:beige" id="navbar">
- <tr>
- <td><b>Navbar</b></td>
- </tr>
- <tr>
- <td><a href="#beginning"><b>Top</b></a></td>
- </tr>
- <tr>
- <td><a href="#message"><b>Traceback info</b></a></td>
- </tr>
- <tr>
- <td><a href="#aftermessage"><b>End of Traceback</b></a></td>
- </tr>
-</table>
-<table id="hosts">
- <tr id="hostrow"></tr>
-</table>
-<table>
-<tbody id="jobs" style="visibility:hidden; background-color:#FFA">
-</tbody>
-</table>
-<table id="main_table">
-</table>
-<fieldset id="messagebox_fieldset">
-<legend><b>Data:</b></legend>
-<a name="message">
-<div id="messagebox"></div>
-</a>
-</fieldset>
-<a name="aftermessage">
-<div id="testmain"></div>
-</a>
-</body>
+ <head>
+ <title>Py.test</title>
+ <script type="text/javascript" src="/jssource"></script>
+ <style type="text/css">
+
+ body, td, div {
+ font-family: Andale mono;
+ background-color: #ffd;
+ color: #003;
+ }
+
+ #info {
+ visibility: hidden;
+ position: fixed;
+ left: 0px;
+ top: 0px;
+ text-align: center;
+ width: 100%;
+ z-index: 2;
+ }
+
+ #navbar {
+ position: fixed;
+ right: 1em;
+ top: 1em;
+ background-color: #ffd;
+ border: 1px solid #003;
+ z-index: 1;
+ }
+
+ #navbar tr, #navbar td {
+ border: 0px;
+ }
+
+ #navbar a {
+ color: #003;
+ text-decoration: none;
+ }
+
+ #navbar .title {
+ font-weight: bold;
+ }
+
+ #jobs {
+ position: absolute;
+ visibility: hidden;
+ right: 2px;
+ }
+
+ #jobs, #jobs td {
+ background-color: #ffd;
+ border: 1px solid #003;
+ }
+
+ #jobs tr, #jobs td {
+ border: 0px;
+ }
+
+ #hosts {
+ width: 100%;
+ }
+
+ </style>
+ </head>
+ <body onload="main()">
+ <a name="beginning">
+ <h3 id="Tests">Tests</h3>
+ </a>
+ <div id="info">
+  
+ </div>
+ <table id="navbar">
+ <tbody>
+ <tr>
+ <td class="title">Hosts status</td>
+ </tr>
+ <tr>
+ <td>
+ <table id="hosts">
+ <tbody id="hostsbody">
+ </tbody>
+ </table>
+ <table>
+ <tbody id="jobs">
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="title">Navigation</td>
+ </tr>
+ <tr>
+ <td><a href="#beginning">Top</a></td>
+ </tr>
+ <tr>
+ <td><a href="#message">Traceback info</a></td>
+ </tr>
+ <tr>
+ <td><a href="#aftermessage">End of Traceback</a></td>
+ </tr>
+ </tbody>
+ </table>
+ <table id="main_table">
+ </table>
+ <fieldset id="messagebox_fieldset">
+ <legend><b>Data:</b></legend>
+ <a name="message">
+ <div id="messagebox"></div>
+ </a>
+ </fieldset>
+ <a name="aftermessage">
+ <div id="testmain"></div>
+ </a>
+ </body>
</html>
Modified: py/dist/py/test/rsession/webdata/source.js
==============================================================================
Binary files. No diff available.
Modified: py/dist/py/test/rsession/webjs.py
==============================================================================
--- py/dist/py/test/rsession/webjs.py (original)
+++ py/dist/py/test/rsession/webjs.py Thu Nov 30 15:52:57 2006
@@ -32,6 +32,7 @@
def __init__(self):
self.pending = []
self.host = ""
+ self.data_empty = True
glob = Globals()
@@ -182,6 +183,9 @@
td.appendChild(txt)
tr.appendChild(td)
module_part.appendChild(tr)
+ if glob.data_empty:
+ mbox = dom.get_document().getElementById('messagebox')
+ mbox.parentNode.scrollIntoView()
return True
def show_skip(item_name="aa"):
@@ -196,6 +200,7 @@
pre.appendChild(txt)
msgbox.appendChild(pre)
dom.get_document().location = "#message"
+ glob.data_empty = False
def show_traceback(item_name="aa"):
data = ("====== Traceback: =========\n%s\n======== Stdout: ========\n%s\n"
@@ -236,14 +241,16 @@
glob.host = ""
def host_init(host_dict):
- elem = dom.get_document().getElementById("hostrow")
+ tbody = dom.get_document().getElementById("hostsbody")
for host in host_dict.keys():
+ tr = create_elem('tr')
+ tbody.appendChild(tr)
td = create_elem("td")
td.style.background = "#ff0000"
txt = create_text_elem(host_dict[host])
td.appendChild(txt)
td.id = host
- elem.appendChild(td)
+ tr.appendChild(td)
td.setAttribute("onmouseover", "show_host('%s')" % host)
td.setAttribute("onmouseout", "hide_host()")
glob.host_dict = host_dict
More information about the pytest-commit
mailing list