forked from playframework/play1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [playframework#1067] test(tag): add demo and test for used of #{set…
…} and #{get}
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,9 @@ public static void yesNo() { | |
public static void i18n() { | ||
render(); | ||
} | ||
|
||
public static void set() { | ||
render(); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
samples-and-tests/just-test-cases/app/views/tagDemos/TagDemos/set.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
We have declared #{set transactionsData:@Application.hello()/} | ||
#{set transactionsData:@Application.hello()/} | ||
<ul> | ||
<li>Get var with #{get 'transactionsData' /}: #{get 'transactionsData' /}</li> | ||
<li>Get var with ${transactionsData}: ${transactionsData?.url}</li> | ||
</ul> | ||
|
||
We can use it in form: | ||
#{form transactionsData, method:'POST', id:'creationForm' } | ||
<input name="test"> | ||
<input type="submit"> | ||
#{/form} |
9 changes: 9 additions & 0 deletions
9
samples-and-tests/just-test-cases/test/tagDemos/TagDemos/set.test.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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('*<form action="/sayHello" method="post" accept-charset="utf-8" id="creationForm">*') | ||
#{/selenium} |