Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
e6769e0c
Commit
e6769e0c
authored
Jan 09, 2019
by
Yadd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into v2.0
parents
94679c3d
504e892e
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
996 additions
and
24 deletions
+996
-24
COPYING
COPYING
+1
-1
Makefile
Makefile
+3
-2
_example/conf/lmConf-1.json
_example/conf/lmConf-1.json
+2
-2
changelog
changelog
+3
-0
debian/control
debian/control
+1
-0
debian/copyright
debian/copyright
+1
-1
e2e-tests/handler/README.md
e2e-tests/handler/README.md
+47
-0
e2e-tests/lmConf-1.json
e2e-tests/lmConf-1.json
+11
-1
e2e-tests/manager/00-auth.js
e2e-tests/manager/00-auth.js
+2
-3
e2e-tests/manager/01-generalParameters.js
e2e-tests/manager/01-generalParameters.js
+214
-0
e2e-tests/manager/01-variables.js
e2e-tests/manager/01-variables.js
+16
-0
e2e-tests/manager/01-virtualHosts.js
e2e-tests/manager/01-virtualHosts.js
+23
-0
e2e-tests/manager/02-lang.js
e2e-tests/manager/02-lang.js
+1
-1
e2e-tests/manager/08-apply.js
e2e-tests/manager/08-apply.js
+1
-0
e2e-tests/manager/35-apply-old-conf.js
e2e-tests/manager/35-apply-old-conf.js
+2
-3
e2e-tests/manager/36-diff.js
e2e-tests/manager/36-diff.js
+1
-1
e2e-tests/manager/40-sessions.js
e2e-tests/manager/40-sessions.js
+1
-1
e2e-tests/portal/00-auth.js
e2e-tests/portal/00-auth.js
+86
-0
e2e-tests/portal/01-menu.js
e2e-tests/portal/01-menu.js
+90
-0
e2e-tests/portal/99-logout.js
e2e-tests/portal/99-logout.js
+11
-0
e2e-tests/portal/README.md
e2e-tests/portal/README.md
+47
-0
e2e-tests/protractor-conf.js
e2e-tests/protractor-conf.js
+5
-2
lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm
...nldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm
+1
-1
lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm
...dap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm
+1
-1
lemonldap-ng-manager/site/templates/sessions.tpl
lemonldap-ng-manager/site/templates/sessions.tpl
+1
-1
lemonldap-ng-portal/MANIFEST
lemonldap-ng-portal/MANIFEST
+9
-0
lemonldap-ng-portal/Makefile.PL
lemonldap-ng-portal/Makefile.PL
+1
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GPG.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GPG.pm
+158
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
+1
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
+48
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugin.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugin.pm
+37
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm
+9
-1
lemonldap-ng-portal/site/templates/bootstrap/gpgform.tpl
lemonldap-ng-portal/site/templates/bootstrap/gpgform.tpl
+53
-0
lemonldap-ng-portal/site/templates/bootstrap/login.tpl
lemonldap-ng-portal/site/templates/bootstrap/login.tpl
+17
-0
lemonldap-ng-portal/t/29-AuthGPG.t
lemonldap-ng-portal/t/29-AuthGPG.t
+55
-0
lemonldap-ng-portal/t/gpghome/key.asc
lemonldap-ng-portal/t/gpghome/key.asc
+0
-0
lemonldap-ng-portal/t/gpghome/openpgp-revocs.d/9482CEFB055809CBAFE6D71AAB2D5542891D1677.rev
...pgp-revocs.d/9482CEFB055809CBAFE6D71AAB2D5542891D1677.rev
+35
-0
lemonldap-ng-portal/t/gpghome/private-keys-v1.d/A076B0E7DB141A919271EE8B581CDFA8DA42F333.key
...te-keys-v1.d/A076B0E7DB141A919271EE8B581CDFA8DA42F333.key
+0
-0
lemonldap-ng-portal/t/gpghome/private-keys-v1.d/B7219440BCCD85200121CFB89F94C8D98C0397B3.key
...te-keys-v1.d/B7219440BCCD85200121CFB89F94C8D98C0397B3.key
+0
-0
lemonldap-ng-portal/t/gpghome/pubring.kbx
lemonldap-ng-portal/t/gpghome/pubring.kbx
+0
-0
lemonldap-ng-portal/t/gpghome/trustdb.gpg
lemonldap-ng-portal/t/gpghome/trustdb.gpg
+0
-0
scripts/doc.pl
scripts/doc.pl
+1
-1
No files found.
COPYING
View file @
e6769e0c
...
...
@@ -130,7 +130,7 @@ Copyright: 2009-2013 Jeff Mott
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/es5-shim/*
Copyright: 2009-2015,
Kristopher Michael Kowal and
contributors
Copyright: 2009-2015, contributors
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/file-saver.js/*
...
...
Makefile
View file @
e6769e0c
...
...
@@ -120,6 +120,7 @@ VHOSTLISTEN="*:$(PORT)"
TESTWEBSERVER
=
apache
TESTWEBSERVERPORT
=
19876
TESTUSESSL
=
0
E2E_TESTS
=
'portal/*.js'
# LDAP backend test
LLNGTESTLDAP_SLAPD_BIN
=
/usr/sbin/slapd
...
...
@@ -548,7 +549,7 @@ launch_protractor:
# Start e2e tests
# NB: you must have protractor installed
(
using npm
install
-g
protractor
)
# and have run update-webdriver at least once and have a node.js > 4.0
@
TESTWEBSERVERPORT
=
$(TESTWEBSERVERPORT)
protractor e2e-tests/protractor-conf.js
@
E2E_TESTS
=
$(E2E_TESTS)
TESTWEBSERVERPORT
=
$(TESTWEBSERVERPORT)
protractor e2e-tests/protractor-conf.js
stop_web_server
:
# Stop web server
...
...
@@ -568,7 +569,7 @@ plackup:
-F
>
e2e-tests/conf/fastcgi.log 2>&1 &
install_test
:
@
TESTWEBSERVERPORT
=
$(PORT)
protractor e2e-tests/protractor-conf.js
@
E2E_TESTS
=
$(E2E_TESTS)
TESTWEBSERVERPORT
=
$(PORT)
protractor e2e-tests/protractor-conf.js
# Install targets
# ---------------
...
...
_example/conf/lmConf-1.json
View file @
e6769e0c
...
...
@@ -75,7 +75,7 @@
"description"
:
"Official LemonLDAP::NG Website"
,
"display"
:
"on"
,
"logo"
:
"network.png"
,
"name"
:
"Offical Website"
,
"name"
:
"Offic
i
al Website"
,
"uri"
:
"http://lemonldap-ng.org/"
},
"type"
:
"application"
...
...
@@ -86,7 +86,7 @@
"authentication"
:
"Demo"
,
"cfgAuthor"
:
"The LemonLDAP::NG team"
,
"cfgNum"
:
1
,
"cfgVersion"
:
"2.0.
0
"
,
"cfgVersion"
:
"2.0.
1
"
,
"cookieName"
:
"lemonldap"
,
"demoExportedVars"
:
{
"cn"
:
"cn"
,
...
...
changelog
View file @
e6769e0c
lemonldap-ng (2.1.0) artful; urgency=medium
lemonldap-ng (2.0.1) artful; urgency=medium
* Bugs:
...
...
debian/control
View file @
e6769e0c
...
...
@@ -277,6 +277,7 @@ Suggests: libcrypt-u2f-server-perl,
libglib-perl,
libgssapi-perl,
libimage-magick-perl,
libipc-run-perl,
liblasso-perl,
libnet-facebook-oauth2-perl (>= 0.10),
libnet-openid-consumer-perl,
...
...
debian/copyright
View file @
e6769e0c
...
...
@@ -130,7 +130,7 @@ Copyright: 2009-2013 Jeff Mott
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/es5-shim/*
Copyright: 2009-2015,
Kristopher Michael Kowal and
contributors
Copyright: 2009-2015, contributors
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/file-saver.js/*
...
...
e2e-tests/handler/README.md
0 → 100644
View file @
e6769e0c
#End 2 End Testing (Protractor)
To run the end-2-end tests against the application you use
[
Protractor
](
https://github.com/angular/protractor
)
.
## Testing with Protractor
As a one-time setup, download webdriver.
```
npm run update-webdriver
```
Start the Protractor test runner using the e2e configuration:
```
make e2e_test
```
## Devel tips
{
locator_: {
using: 'css selector',
value: '[ng-click="getLanguage(lang)"]'
},
parentElementFinder_: null,
opt_actionResult_: {
then: [Function: then],
cancel: [Function: cancel],
isPending: [Function: isPending]
},
opt_index_: 1,
click: [Function],
sendKeys: [Function],
getTagName: [Function],
getCssValue: [Function],
getAttribute: [Function],
getText: [Function],
getSize: [Function],
getLocation: [Function],
isEnabled: [Function],
isSelected: [Function],
submit: [Function],
clear: [Function],
isDisplayed: [Function],
getOuterHtml: [Function],
getInnerHtml: [Function],
toWireValue: [Function]
}
e2e-tests/lmConf-1.json
View file @
e6769e0c
...
...
@@ -57,6 +57,16 @@
},
"type"
:
"application"
},
"0008-app"
:
{
"options"
:
{
"description"
:
"Explore WebSSO 2FA sessions"
,
"display"
:
"auto"
,
"logo"
:
"database.png"
,
"name"
:
"2FA Sessions explorer"
,
"uri"
:
"http://manager.example.com:__port__/2ndfa.html"
},
"type"
:
"application"
},
"type"
:
"category"
},
"0008-cat"
:
{
...
...
@@ -76,7 +86,7 @@
"description"
:
"Official LemonLDAP::NG Website"
,
"display"
:
"on"
,
"logo"
:
"network.png"
,
"name"
:
"Offical Website"
,
"name"
:
"Offic
i
al Website"
,
"uri"
:
"http://lemonldap-ng.org/"
},
"type"
:
"application"
...
...
e2e-tests/manager/00-auth.js
View file @
e6769e0c
...
...
@@ -3,14 +3,13 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe
(
'
00 Lemonldap::NG
'
,
function
()
{
describe
(
'
Auth mechanism
'
,
function
()
{
it
(
'
should want to authenticate
'
,
function
()
{
browser
.
driver
.
get
(
'
http://auth.example.com:
'
+
process
.
env
.
TESTWEBSERVERPORT
+
'
/
'
);
// Login attempt
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='user']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='password']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//button[@type='submit']
"
)).
click
();
});
});
});
\ No newline at end of file
});
e2e-tests/manager/01-generalParameters.js
0 → 100644
View file @
e6769e0c
'
use strict
'
;
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe
(
'
01 Lemonldap::NG Manager
'
,
function
()
{
describe
(
'
Tree display -> General Parameters
'
,
function
()
{
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
// Portal
it
(
'
General Parameters > Portal -> Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
14
);
});
it
(
'
General Parameters > Portal > URL => Match
'
,
function
()
{
element
(
by
.
id
(
'
t-portal
'
)).
click
();
expect
(
element
(
by
.
id
(
'
textinput
'
)).
getAttribute
(
'
value
'
)).
toEqual
(
'
http://auth.example.com:
'
+
process
.
env
.
TESTWEBSERVERPORT
+
'
/
'
);
});
it
(
'
General Parameters > Portal > Menu => Append 2 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalMenu
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
16
);
});
it
(
'
General Parameters > Portal > Menu > Module Activation => Append 5 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalModules
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
21
);
});
it
(
'
General Parameters > Portal > Menu > Cat. and Apps. => Append 11 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-applicationList
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
32
);
});
it
(
'
General Parameters > Portal > Customization => Append 8 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalCustomization
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
40
);
});
it
(
'
General Parameters > Portal > Customization > Buttons => Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalButtons
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
44
);
});
it
(
'
General Parameters > Portal > Customization > Password Management => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-passwordManagement
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
47
);
});
it
(
'
General Parameters > Portal > Customization > Other => Append 6 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-portalOther
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
53
);
});
// Authentication Parameters
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Authn. parameters => Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-authParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
14
);
});
it
(
'
General Parameters > Authn. parameters > Authn. modules => Should have 26 modules availabled with "Demonstration" selected
'
,
function
()
{
element
(
by
.
id
(
'
t-authentication
'
)).
click
();
expect
(
element
(
by
.
css
(
'
option[selected="selected"]
'
)).
getAttribute
(
'
Value
'
)).
toEqual
(
'
Demo
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
item in currentNode.select
'
)).
count
()).
toEqual
(
26
);
});
it
(
'
General Parameters > Authn. parameters > Users modules => Should have 7 modules availabled with "Same" selected
'
,
function
()
{
element
(
by
.
id
(
'
t-userDB
'
)).
click
();
expect
(
element
(
by
.
css
(
'
option[selected="selected"]
'
)).
getAttribute
(
'
Value
'
)).
toEqual
(
'
Same
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
item in currentNode.select
'
)).
count
()).
toEqual
(
7
);
});
it
(
'
General Parameters > Authn. parameters > Password modules => Should have 8 modules availabled with "Demo" selected
'
,
function
()
{
element
(
by
.
id
(
'
t-passwordDB
'
)).
click
();
expect
(
element
(
by
.
css
(
'
option[selected="selected"]
'
)).
getAttribute
(
'
Value
'
)).
toEqual
(
'
Demo
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
item in currentNode.select
'
)).
count
()).
toEqual
(
8
);
});
it
(
'
General Parameters > Authn. parameters > Register modules => Should have 5 modules availabled with "Demo" selected
'
,
function
()
{
element
(
by
.
id
(
'
t-registerDB
'
)).
click
();
expect
(
element
(
by
.
css
(
'
option[selected="selected"]
'
)).
getAttribute
(
'
Value
'
)).
toEqual
(
'
Demo
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
item in currentNode.select
'
)).
count
()).
toEqual
(
5
);
});
it
(
'
should have a hash form if a key is clicked
'
,
function
()
{
element
(
by
.
id
(
'
a-demoParams
'
)).
click
();
element
(
by
.
id
(
'
a-demoExportedVars
'
)).
click
();
element
(
by
.
id
(
'
t-demoExportedVars/cn
'
)).
click
();
expect
(
element
.
all
(
by
.
id
(
'
hashkeyinput
'
)).
count
()).
toEqual
(
1
);
});
// Issuer Modules
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
//var mainNodes = element.all(by.repeater('node in data track by node.id'));
//expect(mainNodes.count()).toEqual(12);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Issuer modules => Append 5 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
15
);
});
it
(
'
General Parameters > Issuer modules > SAML => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerDBSAML
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
18
);
});
it
(
'
General Parameters > Issuer modules > CAS => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerDBCAS
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
21
);
});
it
(
'
General Parameters > Issuer modules > OpenID => Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerDBOpenID
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
25
);
});
it
(
'
General Parameters > Issuer modules > OpenIDConnect => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerDBOpenIDConnect
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
28
);
});
it
(
'
General Parameters > Issuer modules > GET => Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-issuerDBGet
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
32
);
});
// Logs
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Logs => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-logParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
13
);
});
// Cookies
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Cookies => Append 6 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-cookieParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
16
);
});
// Sessions
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Sessions => Append 8 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-sessionParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
18
);
});
it
(
'
General Parameters > Sessions > Opening conditions => New grant rule button + 2 rules
'
,
function
()
{
element
(
by
.
id
(
'
t-grantSessionRules
'
)).
click
();
element
(
by
.
css
(
'
[ng-click="menuClick(button)"]
'
)).
click
();
element
(
by
.
css
(
'
[ng-click="menuClick(button)"]
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
s in currentNode.nodes
'
)).
count
()).
toEqual
(
2
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr
'
)).
count
()).
toEqual
(
2
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr/td/input
'
)).
count
()).
toEqual
(
6
);
});
it
(
'
General Parameters > Sessions > Session storage => Append 4 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-sessionStorage
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
24
);
});
it
(
'
General Parameters > Sessions > Multiple sessions => Append 6 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-multipleSessions
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
30
);
});
it
(
'
General Parameters > Sessions > Persistent sessions => Append 2 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-persistentSessions
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
32
);
});
it
(
'
General Parameters > Sessions > Persistent storage options => Append 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
t-persistentStorageOptions
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
35
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr
'
)).
count
()).
toEqual
(
3
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr/td/input
'
)).
count
()).
toEqual
(
6
);
});
// Configuration reload
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters should display 10 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
10
);
});
it
(
'
General Parameters > Configuration reload => Append 2 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-reloadParams
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
General Parameters > Configuration relaod > Reload URLs => "New entry" button + 2 new URLS
'
,
function
()
{
element
(
by
.
id
(
'
t-reloadUrls
'
)).
click
();
element
(
by
.
css
(
'
[ng-click="menuClick(button)"]
'
)).
click
();
element
(
by
.
css
(
'
[ng-click="menuClick(button)"]
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
14
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr
'
)).
count
()).
toEqual
(
2
);
expect
(
element
.
all
(
by
.
xpath
(
'
//tbody/tr/td/input
'
)).
count
()).
toEqual
(
4
);
});
});
});
\ No newline at end of file
e2e-tests/manager/01-variables.js
0 → 100644
View file @
e6769e0c
'
use strict
'
;
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe
(
'
01 Lemonldap::NG Manager
'
,
function
()
{
describe
(
'
Tree display -> Variables
'
,
function
()
{
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
Variables should display 3 sub nodes
'
,
function
()
{
element
(
by
.
id
(
'
a-variables
'
)).
click
();
expect
(
element
.
all
(
by
.
repeater
(
'
node in node.nodes track by node.id
'
)).
count
()).
toEqual
(
3
);
});
});
});
\ No newline at end of file
e2e-tests/manager/01-
tree
.js
→
e2e-tests/manager/01-
virtualHosts
.js
View file @
e6769e0c
...
...
@@ -3,15 +3,11 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe
(
'
01 Lemonldap::NG Manager
'
,
function
()
{
describe
(
'
Tree display
'
,
function
()
{
it
(
'
should display 9 main nodes
'
,
function
()
{
it
(
'
Main => should display 12 main nodes
'
,
function
()
{
browser
.
get
(
'
/
'
);
var
mainNodes
=
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
));
expect
(
mainNodes
.
count
()).
toEqual
(
12
);
expect
(
element
.
all
(
by
.
repeater
(
'
node in data track by node.id
'
)).
count
()).
toEqual
(
12
);
});
it
(
'
should find a rule
'
,
function
()
{
browser
.
get
(
'
/#/confs/1
'
);
var
vhs
=
element
(
by
.
id
(
'
a-virtualHosts
'
));
...
...
@@ -23,18 +19,5 @@ describe('01 Lemonldap::NG Manager', function() {
var
def
=
element
.
all
(
by
.
id
(
"
t-virtualHosts/manager.example.com/locationRules/1
"
));
expect
(
def
.
count
()).
toEqual
(
1
);
});
it
(
'
should find 19 auth/user modules but only Demo visible
'
,
function
()
{
browser
.
get
(
'
/#/confs/1
'
);
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
element
(
by
.
id
(
'
a-authParams
'
)).
click
();
/* todo */
});
it
(
'
should have a hash form if a key is clicked
'
,
function
()
{
element
(
by
.
id
(
'
a-demoParams
'
)).
click
();
element
(
by
.
id
(
'
a-demoExportedVars
'
)).
click
();
element
(
by
.
id
(
'
t-demoExportedVars/cn
'
)).
click
();
var
def
=
element
.
all
(
by
.
id
(
'
hashkeyinput
'
));
expect
(
def
.
count
()).
toEqual
(
1
);
});
});
});
\ No newline at end of file
e2e-tests/manager/02-lang.js
View file @
e6769e0c
...
...
@@ -12,7 +12,7 @@ describe('02 Lemonldap::NG Manager', function() {
"
fr
"
:
"
Paramètres généraux
"
};
var
els
=
element
.
all
(
by
.
css
(
'
[ng-click="getLanguage(lang)"]
'
));
expect
(
els
.
count
()).
toEqual
(
8
);
expect
(
els
.
count
()).
toEqual
(
14
);
els
.
each
(
function
(
el
)
{
el
.
isDisplayed
().
then
(
function
(
isVisible
)
{
if
(
isVisible
)
{
...
...
e2e-tests/manager/08-apply.js
View file @
e6769e0c
...
...
@@ -9,6 +9,7 @@ describe('08 Lemonldap::NG Manager', function() {
it
(
'
should be able to add reload urls
'
,
function
()
{
browser
.
get
(
'
/#/confs/latest
'
);
element
(
by
.
id
(
'
a-generalParameters
'
)).
click
();
element
(
by
.
id
(
'
t-reloadParams
'
)).
click
();
element
(
by
.
id
(
'
t-reloadUrls
'
)).
click
();
element
(
by
.
css
(
'
.glyphicon-plus-sign
'
)).
click
();
element
(
by
.
id
(
'
a-reloadUrls
'
)).
click
();
...
...
e2e-tests/manager/35-apply-old-conf.js
View file @
e6769e0c
...
...
@@ -5,14 +5,13 @@
describe
(
'
35 Lemonldap::NG Manager
'
,
function
()
{
it
(
'
should be able to restore an old configuration
'
,
function
()
{
browser
.
get
(
'
/#/confs/1
'
);
browser
.
get
(
'
/#
!
/confs/1
'
);
element
(
by
.
id
(
'
save
'
)).
click
();
element
(
by
.
id
(
'
longtextinput
'
)).
sendKeys
(
'
Restore conf 1
'
);
element
(
by
.
id
(
'
saveok
'
)).
click
();
browser
.
sleep
(
500
);
element
(
by
.
id
(
'
messageok
'
)).
click
();
browser
.
sleep
(
500
);
element
(
by
.
id
(
'
forcesave
'
)).
click
();
element
(
by
.
id
(
'
save
'
)).
click
();
element
(
by
.
id
(
'
longtextinput
'
)).
sendKeys
(
'
Force to restore conf 1
'
);
element
(
by
.
id
(
'
saveok
'
)).
click
();
element
(
by
.
id
(
'
messageok
'
)).
click
();
...
...
e2e-tests/manager/36-diff.js
View file @
e6769e0c
...
...
@@ -7,7 +7,7 @@ describe('36 Lemonldap::NG Manager', function() {
describe
(
'
Diff interface
'
,
function
()
{
it
(
'
should find key changed
'
,
function
()
{
browser
.
get
(
'
/diff.html#6/7
'
);
browser
.
get
(
'
/diff.html#
!/
6/7
'
);
element
(
by
.
id
(
'
t-generalParameters
'
)).
click
();
element
(
by
.
id
(
'
t-advancedParams
'
)).
click
();
element
(
by
.
id
(
'
t-security
'
)).
click
();
...
...
e2e-tests/manager/40-sessions.js
View file @
e6769e0c
...
...
@@ -5,7 +5,7 @@ describe('40 Lemonldap::NG Manager', function() {
it
(
'
should display other modules
'
,
function
()
{
browser
.
get
(
'
/
'
);
var
links
=
element
.
all
(
by
.
repeater
(
'
l in links
'
));
expect
(
links
.
count
()).
toEqual
(
3
);
expect
(
links
.
count
()).
toEqual
(
4
);
element
(
by
.
xpath
(
"
//a[@href='sessions.html']
"
)).
click
();
});
...
...
e2e-tests/portal/00-auth.js
0 → 100644
View file @
e6769e0c
'
use strict
'
;
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe
(
'
00 Lemonldap::NG
'
,
function
()
{
describe
(
'
Auth mechanism
'
,
function
()
{
it
(
'
Portal should display 11 lang flags
'
,
function
()
{
browser
.
driver
.
get
(
'
http://auth.example.com:
'
+
process
.
env
.
TESTWEBSERVERPORT
+
'
/
'
);
browser
.
driver
.
findElements
(
by
.
className
(
'
langicon
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
11
);
});
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//img[@title='en']
"
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trmsg="9"]
'
)).
getText
()).
toEqual
(
'
Authentication required
'
);
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="createAccount"]
'
)).
getText
()).
toEqual
(
'
Create an account
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//img[@title='it']
"
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trmsg="9"]
'
)).
getText
()).
toEqual
(
'
Autenticazione necessaria
'
);
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="createAccount"]
'
)).
getText
()).
toEqual
(
'
Crea un account
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//img[@title='fr']
"
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="createAccount"]
'
)).
getText
()).
toEqual
(
'
Créer un compte
'
);
});
it
(
'
should create an account
'
,
function
()
{
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="createAccount"]
'
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trmsg="78"]
'
)).
getText
()).
toEqual
(
'
Merci de saisir vos informations
'
);
// A four inputs form + one captcha
browser
.
driver
.
findElements
(
by
.
className
(
'
input-group
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
4
);
});
browser
.
driver
.
findElements
(
by
.
className
(
'
img-thumbnail
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
1
);
});
});
it
(
'
should authenticate with history
'
,
function
()
{
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="back2Portal"]
'
)).
getText
()).
toEqual
(
'
Retourner au portail
'
);
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="back2Portal"]
'
)).
click
();
// Failed login attempt
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='user']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='password']
"
)).
sendKeys
(
'
ohwd
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='checkLogins']
"
)).
click
();
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//button[@type='submit']
"
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trmsg="5"]
'
)).
getText
()).
toEqual
(
'
Mot de passe ou identifiant incorrect
'
);
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="goToPortal"]
'
)).
click
();
// Login attempt
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='user']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='password']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='checkLogins']
"
)).
click
();
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//button[@type='submit']
"
)).
click
();
// Change lang
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//img[@title='de']
"
)).
click
();
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="info"]
'
)).
getText
()).
toEqual
(
"
Information
"
);
});
it
(
'
should display history
'
,
function
()
{
// Two entries
browser
.
driver
.
findElements
(
by
.
xpath
(
'
//table/tbody/tr
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
2
);
});
// Expect history with one login and one failed login
browser
.
driver
.
findElements
(
by
.
xpath
(
'
//form/div/div/h3
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
3
);