Commit 52d3d43c authored by Xavier Guimard's avatar Xavier Guimard

Merge branch 2.0

parent af672623
lemonldap-ng (2.1.0) artful; urgency=medium
lemonldap-ng (2.0.1) artful; urgency=medium
* Bugs:
......
lemonldap-ng (2.1.0) artful; urgency=medium
lemonldap-ng (2.0.1-1) unstable; urgency=medium
* New release. See changes on our website:
......
......@@ -10,6 +10,7 @@ describe('10 Lemonldap::NG', function() {
// browser.driver.findElement(by.xpath("//input[@name='password']")).sendKeys('dwho');
// browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
// Toggle Menu bar
// Need to be clicked twice ???
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
......@@ -25,12 +26,34 @@ describe('10 Lemonldap::NG', function() {
links[0].click();
browser.sleep(1000);
});
});
it('Should submit TOTP form', function() {
browser.driver.findElements(by.css('[role="button"]')).then(function(links) {
expect(links.length).toEqual(4);
expect(links[0].getText()).toEqual('Générer une nouvelle clef');
expect(links[1].getText()).toEqual('Enregistrer');
expect(links[2].getText()).toEqual('Gestionnaire 2ndFA');
expect(links[3].getText()).toEqual('Aller au portail');
expect(browser.driver.findElement(by.css('[trspan="yourNewTotpKey"]')).getText()).toEqual('Votre nouvelle clef TOTP. Testez-la et entrez le code');
// Submit an empty form
browser.driver.findElement(by.id('verify')).click();
expect(browser.driver.findElement(by.css('[trspan="yourNewTotpKey"]')).getText()).toEqual('Remplissez le formulaire');
browser.sleep(500);
// Submit a bad TOTP code
browser.driver.findElement(by.xpath("//input[@name='TOTPName']")).sendKeys('_TEST_');
browser.driver.findElement(by.xpath("//input[@name='code']")).sendKeys('1234567');
browser.driver.findElement(by.id('verify')).click();
expect(browser.driver.findElement(by.css('[trspan="yourNewTotpKey"]')).getText()).toEqual('Mauvais code');
browser.sleep(500);
// Generate a new TOTP code
browser.driver.findElement(by.id('changekey')).click();
expect(browser.driver.findElement(by.css('[trspan="yourNewTotpKey"]')).getText()).toEqual('Votre nouvelle clef TOTP. Testez-la et entrez le code');
browser.sleep(500);
// Back to Portal
links[3].click();
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
......
......@@ -127,7 +127,7 @@ sub scanTree {
$self->newConf->{cfgNum} = $self->req->params('cfgNum');
$self->newConf->{cfgAuthor}
= $self->req->userData
->{ $Lemonldap::NG::Handler::Main::tsv->{whatToTrace}
->{ &Lemonldap::NG::Handler::Main::tsv->{whatToTrace}
|| '_whatToTrace' } // "anonymous";
$self->newConf->{cfgAuthorIP} = $self->req->address;
$self->newConf->{cfgDate} = time;
......
......@@ -250,7 +250,7 @@ sub tests {
cookieTTL => sub {
return 1 unless ( defined $conf->{cookieExpiration} );
return ( 0, "Cookie TTL must be higher than one minute" )
unless ( $conf->{cookieExpiration} > 60 );
unless ( $conf->{cookieExpiration} == 0 || $conf->{cookieExpiration} > 60 );
return ( 1, "Cookie TTL should be higher or equal than one hour" )
unless ( $conf->{cookieExpiration} >= 3600
|| $conf->{cookieExpiration} == 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment