Permalink
Browse files

add test case for issue #74

  • Loading branch information...
chanwit committed May 11, 2011
1 parent 3e8c428 commit f704b5b79689b4b517dee967cdd704dc67c44a1b
Showing with 51 additions and 0 deletions.
  1. +14 −0 grails-app/composers/zk/Issue74Composer.groovy
  2. +19 −0 test/selenium/zk/Issue74Tests.groovy
  3. +18 −0 web-app/issue_74.zul
@@ -0,0 +1,14 @@
package zk
import org.zkoss.zkgrails.*
class Issue74Composer extends GrailsComposer {
def lblUser
def afterCompose = { window ->
session['user'] = "mock user"
lblUser.value = session['user']
}
}
@@ -0,0 +1,19 @@
package zk
import grails.test.*
import com.thoughtworks.selenium.*
import grails.plugins.selenium.SeleniumAware
@Mixin(SeleniumAware)
class Issue74Tests extends GroovyTestCase {
void testSession() {
selenium.with {
setSpeed "1000"
open "/zk/issue_74.zul"
// user label
assertEquals "mock user", getText("zk_comp_4")
}
}
}
View
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?page zscriptLanguage="GroovyGrails"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<window id="wnd" apply="zk.issue74Composer">
<hbox>
<image src="${z.resource(dir:'images', file:'grails_logo.png')}"/>
</hbox>
<label id="lblUser"/>
</window>
</zk>

0 comments on commit f704b5b

Please sign in to comment.