Test form replay feature (closes: #630)

This commit is contained in:
Xavier Guimard 2016-02-18 08:15:37 +00:00
parent f5856422e0
commit baedbcef1a
3 changed files with 27 additions and 1 deletions

13
_example/form.html Normal file
View File

@ -0,0 +1,13 @@
<html>
<head>
<title></title>
</head>
<body>
<form id="test" method="post" action="index.pl">
<input name="postuid" placeholder="postuid" />
<input name="postmail" placeholder="postmail" />
<input name="poststatic" placeholder="poststatic" />
<input name="post" type="submit" />
</form>
</body>
</html>

View File

@ -153,7 +153,7 @@ print "<thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody>\n";
foreach ( sort $cgi->param() ) {
my $tmp = $cgi->param($_);
print "<tr><td>$_</td><td><big>☞</big> $tmp</td></tr>\n";
print qq{<tr><td>$_</td><td><big>☞</big> <span id="field_$_">$tmp</span></td></tr>\n};
}
print "</tbody></table>\n";
print "</div>\n";

View File

@ -0,0 +1,13 @@
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('Lemonldap::NG', function() {
describe('Form replay mechanism', function() {
it('should redirect to index.pl', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/form.html');
expect(browser.driver.findElement(by.id('field_postuid')).getText()).toEqual('dwho');
});
});
});