Author: shywolf9982
Date: Sat Mar 29 13:23:15 2008
New Revision: 53089

Modified:
   kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/index.py
   kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/registry.py
Log:
* Integrated the index so that it passes the right filtering and auth 
parameters required by the suite runner


Modified: kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/index.py
==============================================================================
--- kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/index.py        
(original)
+++ kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/index.py        Sat Mar 
29 13:23:15 2008
@@ -16,7 +16,7 @@
         results = [
                 dict(
                     title = 'KSS core',  
-                    id = 'ksscore'
+                    id = ''
                 ),
             ]
         for application in registry.applications:
@@ -28,4 +28,3 @@
                         id = application_id
                     ))
         return results
-

Modified: kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/registry.py
==============================================================================
--- kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/registry.py     
(original)
+++ kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/registry.py     Sat Mar 
29 13:23:15 2008
@@ -7,6 +7,7 @@
 from kss.demo.selenium_utils.builder import cookSeleniumTests
 import os.path
 import re
+import urllib
 try:
     from Products.Five import BrowserView
     BrowserView         # make pyflakes happy
@@ -123,8 +124,26 @@
 
     def getZuiteHomePage(self, path):
         """Redirects to the Zuite home page, Zuite object is found from 
path."""
+        # XXX: this actually does some parameter name searching, which is not 
optimal. If you find
+        # a better way to implement multiple submit buttons and have the form 
post a key-value pair
+        # that tells us what we pressed, feel free to kill this code
+        form = self.request.form
+        application = None
+        for key in form.keys():
+            if key.find("submit_") == 0:
+                application = key[7:].lower()
+                break
+        params_dict = dict(
+            admin_username = form.get('admin_username', ''),
+            admin_password = form.get('admin_password', ''),
+            application = application
+        )
+        params_string = urllib.urlencode(params_dict)
+        test_url = "%s/suite.html?%s" % (self.context.absolute_url(), 
params_string)
+        test_param = urllib.quote(test_url)
+        
         zuite = self.context.aq_inner.aq_parent.restrictedTraverse(path)
-        html = "%s/core/TestRunner.html?test=%s/suite.html" % 
(zuite.absolute_url(), self.context.absolute_url())
+        html = "%s/core/TestRunner.html?test=%s" % (zuite.absolute_url(), 
test_param)
         return self.request.response.redirect(html)
 
 class KSSDemoRegistryAdminView(BrowserView):
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to