From 49e575e68102ec9a6574ad87b833f70bc14de748 Mon Sep 17 00:00:00 2001 From: Alexandre Chatiron Date: Thu, 29 Dec 2016 17:08:42 +0800 Subject: [PATCH] * [#1067] test(tag): add demo and test for used of #{set} and #{get} --- .../app/controllers/tagDemos/TagDemos.java | 4 ++++ .../app/views/tagDemos/TagDemos/set.html | 12 ++++++++++++ .../test/tagDemos/TagDemos/set.test.html | 9 +++++++++ 3 files changed, 25 insertions(+) create mode 100644 samples-and-tests/just-test-cases/app/views/tagDemos/TagDemos/set.html create mode 100644 samples-and-tests/just-test-cases/test/tagDemos/TagDemos/set.test.html diff --git a/samples-and-tests/just-test-cases/app/controllers/tagDemos/TagDemos.java b/samples-and-tests/just-test-cases/app/controllers/tagDemos/TagDemos.java index 6e8cd5a04f..bc46fb090c 100644 --- a/samples-and-tests/just-test-cases/app/controllers/tagDemos/TagDemos.java +++ b/samples-and-tests/just-test-cases/app/controllers/tagDemos/TagDemos.java @@ -11,5 +11,9 @@ public static void yesNo() { public static void i18n() { render(); } + + public static void set() { + render(); + } } diff --git a/samples-and-tests/just-test-cases/app/views/tagDemos/TagDemos/set.html b/samples-and-tests/just-test-cases/app/views/tagDemos/TagDemos/set.html new file mode 100644 index 0000000000..415ba2157b --- /dev/null +++ b/samples-and-tests/just-test-cases/app/views/tagDemos/TagDemos/set.html @@ -0,0 +1,12 @@ +We have declared #{set transactionsData:@Application.hello()/} +#{set transactionsData:@Application.hello()/} + + +We can use it in form: +#{form transactionsData, method:'POST', id:'creationForm' } + + +#{/form} \ No newline at end of file diff --git a/samples-and-tests/just-test-cases/test/tagDemos/TagDemos/set.test.html b/samples-and-tests/just-test-cases/test/tagDemos/TagDemos/set.test.html new file mode 100644 index 0000000000..602f10efa0 --- /dev/null +++ b/samples-and-tests/just-test-cases/test/tagDemos/TagDemos/set.test.html @@ -0,0 +1,9 @@ +#{selenium 'set'} + open('@{tagDemos.TagDemos.set()}') + // Test with #get tag + assertTextPresent('Get var with #{get 'transactionsData' /}: /sayHello') + // Test with Expressions accessor + assertTextPresent('Get var with ${transactionsData}: /sayHello') + // Test in form tag param + assertHtmlSource('*
*') +#{/selenium}