Author: jvloothuis
Date: Sun Feb 18 09:54:09 2007
New Revision: 39150

Added:
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/2
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/__init__.py
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.kss
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/seltest_coreplugin.py
Modified:
   kukit/kss.demo/trunk/kss/demo/browser/configure.zcml
Log:
Added tests for the new toggleClass core plugin extension


Modified: kukit/kss.demo/trunk/kss/demo/browser/configure.zcml
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/configure.zcml        (original)
+++ kukit/kss.demo/trunk/kss/demo/browser/configure.zcml        Sun Feb 18 
09:54:09 2007
@@ -5,6 +5,7 @@
 
   <include package=".parameterfunction" />
   <include package=".selectors" />
+  <include package=".coreplugin" />
   
   <browser:resource
     file="demo.css"

Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/2
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/2  Sun Feb 18 09:54:09 2007
@@ -0,0 +1,53 @@
+<html>
+  <head>
+    <link rel="kinetic-stylesheet" type="text/css"
+          tal:attributes="href
+          string:${context/@@absolute_url}/++resource++coreplugin.kss"/>
+    <link rel="stylesheet" type="text/css"
+          tal:attributes="href
+          string:${context/@@absolute_url}/++resource++demo.css"/>
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+    <style type="text/css">
+      div.nested { border: 1px solid green; padding: 0.4em; }
+      .selected { background-color: cyan; }
+    </style>
+  </head>
+  <body>
+    <div id="global-links">
+      <ul>
+        <li><a href=".">All demos</a></li>
+        <li><a href="javascript:void(createLoggingPane(true))">Show logging
+      pane</a></li>
+        <li><a href="./++resource++coreplugin.kss">View KSS resource</a></li>
+      </ul>
+    </div>  
+    <h2>Selectors</h2>
+    <p>We test the selectors which are used in KSS. The selectors allow you to
+      specify what node to take action on etc.</p> 
+    <h3>
+      <code>parentnode()</code> with node in path
+    </h3>
+    <div class="help">
+        Click the text link.
+    </div>
+    <div id="target">Target
+      <a class="button click cursorPointer" href="#" id="parentnodeok">Click 
me!</a>
+    </div>
+    <div class="help">
+        Clicking the text link below should not update the target.
+    </div>
+    <div>
+      <a  class="button click cursorPointer" href="#" 
id="parentnodenotok">Click me!</a>
+    </div>
+
+
+
+    <div class="nested" id="nesteddivs0">
+      <div class="nested" id="nesteddivs1">
+        <div class="nested" id="nesteddivs2">
+          <a href="#" id="parentnodechain" class="button click cursorPointer" 
>Click me!</a>
+        </div>
+      </div>
+    </div>
+  </body>
+</html>

Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/__init__.py
==============================================================================

Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml     Sun Feb 
18 09:54:09 2007
@@ -0,0 +1,20 @@
+<configure xmlns="http://namespaces.zope.org/zope";
+           xmlns:browser="http://namespaces.zope.org/browser";
+                  i18n_domain="kss"
+                  >
+
+  <!-- forms -->
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="coreplugin.pt"
+      name="coreplugin.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="coreplugin.kss"
+    name="coreplugin.kss"
+  />
+
+</configure>
+

Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.kss
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.kss     Sun Feb 
18 09:54:09 2007
@@ -0,0 +1,5 @@
+
+#toggleclass-button:click {
+    action-client: toggleClass;
+    toggleClass-classname: 'selected';
+} 

Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt      Sun Feb 
18 09:54:09 2007
@@ -0,0 +1,37 @@
+<html>
+  <head>
+    <link rel="kinetic-stylesheet" type="text/css"
+          tal:attributes="href
+          string:${context/@@absolute_url}/++resource++coreplugin.kss"/>
+    <link rel="stylesheet" type="text/css"
+          tal:attributes="href
+          string:${context/@@absolute_url}/++resource++demo.css"/>
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+    <style type="text/css">
+      div.nested { border: 1px solid green; padding: 0.4em; }
+      .selected { background-color: darkblue; color: white !important; 
border-color: yellow !important}
+    </style>
+  </head>
+  <body>
+    <div id="global-links">
+      <ul>
+        <li><a href=".">All demos</a></li>
+        <li><a href="javascript:void(createLoggingPane(true))">Show logging
+      pane</a></li>
+        <li><a href="./++resource++coreplugin.kss">View KSS resource</a></li>
+      </ul>
+    </div>  
+    <h2>Core plugins</h2>
+    <p>The core plugins are tested here.</p> 
+    <h3>
+      <code>toggleClass</code>
+    </h3>
+    <div class="help">
+        Toggeling the class means adding and removing it. Click the text link
+        to see the button highlight. Click it again to remove the highlight.
+    </div>
+    <div>
+      <a  class="button click cursorPointer" href="#" 
id="toggleclass-button">Click me!</a>
+    </div>
+  </body>
+</html>

Added: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html  Sun Feb 
18 09:54:09 2007
@@ -0,0 +1,44 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>coreplugin</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">coreplugin</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/demo/coreplugin.html</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertAttribute</td>
+       <td>[EMAIL PROTECTED]</td>
+       <td>button click cursorPointer</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>toggleclass-button</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertAttribute</td>
+       <td>[EMAIL PROTECTED]</td>
+       <td>button click cursorPointer selected</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>toggleclass-button</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertAttribute</td>
+       <td>[EMAIL PROTECTED]</td>
+       <td>button click cursorPointer</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Added: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/seltest_coreplugin.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/seltest_coreplugin.py    
Sun Feb 18 09:54:09 2007
@@ -0,0 +1,22 @@
+from seleniumtestcase import SeleniumTestCase
+import unittest, time
+
+def getTestClass():
+   return seltest_coreplugin
+
+class seltest_coreplugin(SeleniumTestCase):
+
+    def test_seltest_coreplugin(self):
+        sel = self.selenium
+        sel.open("/demo/coreplugin.html")
+        self.assertEqual("button click cursorPointer", 
sel.get_attribute("[EMAIL PROTECTED]"))
+        sel.click("toggleclass-button")
+        self.assertEqual("button click cursorPointer selected", 
sel.get_attribute("[EMAIL PROTECTED]"))
+        sel.click("toggleclass-button")
+        self.assertEqual("button click cursorPointer", 
sel.get_attribute("[EMAIL PROTECTED]"))
+def test_suite():
+    return unittest.makeSuite(getTestClass())
+
+if __name__ == "__main__":
+    unittest.main()
+
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to