...
 
Commits (136)
......@@ -109,7 +109,7 @@ License: CC-BY-NC-ND-3.0 or GFDL-1.3
Comment: downloaded from https://commons.wikimedia.org
Files: lemonldap-ng-manager/site/htdocs/static/bwr/angular*
Copyright: 2010-2017, Google, Inc. https://angularjs.org
Copyright: 2010-2018, Google, Inc. https://angularjs.org
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/angular-bootstrap/*
......@@ -121,7 +121,7 @@ Copyright: 2014, unspecified
License: Expat
Files: lemonldap-ng-*/site/htdocs/static/bwr/bootstrap/*
Copyright: 2011-2016, Twitter Inc.
Copyright: 2011-2018, Twitter Inc.
License: Expat
Files: lemonldap-ng-portal/site/htdocs/static/bwr/crypto-js/*
......@@ -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/*
......
......@@ -111,6 +111,9 @@ UWSGIGROUP=$(APACHEGROUP)
# Apache version
APACHEVERSION=2.X
# Apache log dir
APACHELOGDIR=/var/log/apache2
# DNS Domain for cookie and virtual hosts
DNSDOMAIN=example.com
......@@ -120,6 +123,7 @@ VHOSTLISTEN="*:$(PORT)"
TESTWEBSERVER=apache
TESTWEBSERVERPORT=19876
TESTUSESSL=0
E2E_TESTS='portal/*.js'
# LDAP backend test
LLNGTESTLDAP_SLAPD_BIN=/usr/sbin/slapd
......@@ -379,12 +383,8 @@ autopkgtest: all
e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_server
nox_full_test: test prepare_test_server start_web_server
X -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./e2e-tests/conf/X.log -config ./e2e-tests/xorg.conf :11 & \
echo $$! > e2e-tests/conf/X.pid
-DISPLAY=:11 $(MAKE) launch_protractor
kill $$(cat e2e-tests/conf/X.pid)
$(MAKE) stop_web_server
nox_e2e_test:
xvfb-run -a -s "-screen 0 800x600x16" $(MAKE) e2e_test
prepare_test_server:
-@mkdir -p e2e-tests/conf/sessions/lock e2e-tests/conf/persistents/lock
......@@ -408,6 +408,7 @@ prepare_test_server:
#@cp -f e2e-tests/index.* e2e-tests/conf/
@cp -f $(SRCMANAGERDIR)/site/htdocs/manager* e2e-tests/conf/manager
@cp -f $(SRCPORTALDIR)/site/htdocs/index* e2e-tests/conf/portal
@cp e2e-tests/persistent/5efe8af397fc3577e05b483aca964f1b e2e-tests/conf/persistents
@cp e2e-tests/saml-sp.xml e2e-tests/conf/site/saml-sp.xml
@cp e2e-tests/rules.json e2e-tests/conf/site/test.json
@for f in $$(find e2e-tests/conf -name '*.fcgi'); do \
......@@ -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
# ---------------
......@@ -711,6 +712,7 @@ install_webserver_conf:
s#__MANAGERSITEDIR__#$(MANAGERSITEDIR)/#g; \
s#__MANAGERSTATICDIR__#$(MANAGERSTATICDIR)/#g; \
s#__TESTDIR__#$(TESTDIR)/#g; \
s#__APACHELOGDIR__#$(APACHELOGDIR)#g; \
s#__PORT__#$(PORT)#g; \
s#__CONFDIR__#$(CONFDIR)#g; \
s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#g; \
......
......@@ -75,7 +75,7 @@
"description" : "Official LemonLDAP::NG Website",
"display" : "on",
"logo" : "network.png",
"name" : "Offical Website",
"name" : "Official 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",
......
......@@ -12,9 +12,6 @@
# IMPORTANT:
# To protect applications, see test-apache.conf template in example files
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
# Load LemonLDAP::NG Handler
PerlOptions +GlobalRequest
PerlModule Lemonldap::NG::Handler::ApacheMP2
......
......@@ -2,9 +2,6 @@
# Apache configuration for LemonLDAP::NG Manager
#====================================================================
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
# To insert LLNG user id in Apache logs, declare this format and use it in
# CustomLog directive
#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng
......@@ -14,8 +11,8 @@
ServerName manager.__DNSDOMAIN__
LogLevel notice
# See above to set LLNG user id in Apache logs
#CustomLog ${APACHE_LOG_DIR}/manager.log llng
#ErrorLog ${APACHE_LOG_DIR}/lm_err.log
#CustomLog __APACHELOGDIR__/manager.log llng
#ErrorLog __APACHELOGDIR__/lm_err.log
# FASTCGI CONFIGURATION
# ---------------------
......
......@@ -14,8 +14,8 @@
ServerName manager.__DNSDOMAIN__
LogLevel notice
# See above to set LLNG user id in Apache logs
#CustomLog ${APACHE_LOG_DIR}/manager.log llng
#ErrorLog ${APACHE_LOG_DIR}/lm_err.log
#CustomLog __APACHELOGDIR__/manager.log llng
#ErrorLog __APACHELOGDIR__/lm_err.log
# FASTCGI CONFIGURATION
# ---------------------
......
......@@ -14,8 +14,8 @@
ServerName manager.__DNSDOMAIN__
LogLevel notice
# See above to set LLNG user id in Apache logs
#CustomLog ${APACHE_LOG_DIR}/manager.log llng
#ErrorLog ${APACHE_LOG_DIR}/lm_err.log
#CustomLog __APACHELOGDIR__/manager.log llng
#ErrorLog __APACHELOGDIR__/lm_err.log
# FASTCGI CONFIGURATION
# ---------------------
......
......@@ -2,9 +2,6 @@
# Apache configuration for LemonLDAP::NG Portal
#====================================================================
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
# To insert LLNG user id in Apache logs, declare this format and use it in
# CustomLog directive
#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng
......@@ -13,7 +10,7 @@
<VirtualHost __VHOSTLISTEN__>
ServerName auth.__DNSDOMAIN__
# See above to set LLNG user id in Apache logs
#CustomLog /var/log/apache2/portal.log llng
#CustomLog __APACHELOGDIR__/portal.log llng
# DocumentRoot (FCGI scripts)
DocumentRoot __PORTALSITEDIR__
......@@ -46,7 +43,7 @@
#FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:64321
# Static files
Alias /static/ __PORTALSTATICDIR__/
Alias /static/ __PORTALSTATICDIR__
<Directory __PORTALSTATICDIR__>
Require all granted
Options +FollowSymLinks
......
......@@ -13,7 +13,7 @@
<VirtualHost __VHOSTLISTEN__>
ServerName auth.__DNSDOMAIN__
# See above to set LLNG user id in Apache logs
#CustomLog /var/log/apache2/portal.log llng
#CustomLog __APACHELOGDIR__/portal.log llng
# DocumentRoot (FCGI scripts)
DocumentRoot __PORTALSITEDIR__
......@@ -52,7 +52,7 @@
#FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:64321
# Static files
Alias /static/ __PORTALSTATICDIR__/
Alias /static/ __PORTALSTATICDIR__
<Directory __PORTALSTATICDIR__>
Require all granted
Options +FollowSymLinks
......
......@@ -13,7 +13,7 @@
<VirtualHost __VHOSTLISTEN__>
ServerName auth.__DNSDOMAIN__
# See above to set LLNG user id in Apache logs
#CustomLog /var/log/apache2/portal.log llng
#CustomLog __APACHELOGDIR__/portal.log llng
# DocumentRoot (FCGI scripts)
DocumentRoot __PORTALSITEDIR__
......@@ -47,7 +47,7 @@
#FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:64321
# Static files
Alias /static/ __PORTALSTATICDIR__/
Alias /static/ __PORTALSTATICDIR__
<Directory __PORTALSTATICDIR__>
Order allow,deny
Allow from all
......
......@@ -2,8 +2,6 @@
# Apache configuration for LemonLDAP::NG sample applications
#====================================================================
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
PerlModule Lemonldap::NG::Handler::ApacheMP2::Menu
# Sample application
......
......@@ -61,10 +61,10 @@ server {
# Set manually your headers
#auth_request_set $authuser $upstream_http_auth_user;
#proxy_set_header Auth-User $authuser;
# OR in the correspondinc block
# OR in the corresponding block
#fastcgi_param HTTP_AUTH_USER $authuser;
# Then (if LUA not supported), change cookie header to hide LLNG cookie
# Then (if LUA is not supported), change cookie header to hide LLNG cookie
#auth_request_set $lmcookie $upstream_http_cookie;
#proxy_set_header Cookie: $lmcookie;
# OR in the corresponding block
......
lemonldap-ng (2.1.0) artful; urgency=medium
lemonldap-ng (2.0.1) artful; urgency=medium
* Bugs:
......
......@@ -47,7 +47,7 @@ Build-Depends-Indep: libapache-session-perl,
libxml-libxslt-perl,
libxml-simple-perl,
perl
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/lemonldap-ng
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/lemonldap-ng.git
Homepage: https://lemonldap-ng.org/
......
......@@ -109,7 +109,7 @@ License: CC-BY-NC-ND-3.0 or GFDL-1.3
Comment: downloaded from https://commons.wikimedia.org
Files: lemonldap-ng-manager/site/htdocs/static/bwr/angular*
Copyright: 2010-2017, Google, Inc. https://angularjs.org
Copyright: 2010-2018, Google, Inc. https://angularjs.org
License: Expat
Files: lemonldap-ng-manager/site/htdocs/static/bwr/angular-bootstrap/*
......@@ -121,7 +121,7 @@ Copyright: 2014, unspecified
License: Expat
Files: lemonldap-ng-*/site/htdocs/static/bwr/bootstrap/*
Copyright: 2011-2016, Twitter Inc.
Copyright: 2011-2018, Twitter Inc.
License: Expat
Files: lemonldap-ng-portal/site/htdocs/static/bwr/crypto-js/*
......@@ -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/*
......
......@@ -43,20 +43,43 @@
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<h1 class="sectionedit1" id="cas_server">CAS server</h1>
<ul class="toc">
<li class="level1"><div class="li"><a href="#presentation">Presentation</a></div></li>
<li class="level1"><div class="li"><a href="#configuration">Configuration</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#enabling_cas">Enabling CAS</a></div></li>
<li class="level2"><div class="li"><a href="#configuring_the_cas_service">Configuring the CAS Service</a></div></li>
<li class="level2"><div class="li"><a href="#configuring_cas_applications">Configuring CAS Applications</a></div>
<ul class="toc">
<li class="level3"><div class="li"><a href="#options">Options</a></div></li>
<li class="level3"><div class="li"><a href="#exported_attributes">Exported Attributes</a></div></li>
</ul></li>
</ul></li>
</ul>
</div>
</div>
<!-- TOC END -->
<p>
AS server
</p>
<div class="level1">
</div>
<!-- EDIT1 SECTION "CAS server" [1-26] -->
<h2 class="sectionedit2" id="presentation">Presentation</h2>
<h2 class="sectionedit1" id="presentation">Presentation</h2>
<div class="level2">
<p>
<abbr title="LemonLDAP::NG">LL::NG</abbr> can be used as a <abbr title="Central Authentication Service">CAS</abbr> server. It can allow one to federate <abbr title="LemonLDAP::NG">LL::NG</abbr> with:
</p>
<ul>
<li class="level1"><div class="li"> Another <a href="authcas.html" class="wikilink1" title="documentation:2.0:authcas">CAS authentication</a> <abbr title="LemonLDAP::NG">LL::NG</abbr> provider</div>
<li class="level1"><div class="li"> Another <a href="authcas.html" class="wikilink1" title="documentation:2.1:authcas">CAS authentication</a> <abbr title="LemonLDAP::NG">LL::NG</abbr> provider</div>
</li>
<li class="level1"><div class="li"> Any <abbr title="Central Authentication Service">CAS</abbr> consumer</div>
</li>
......@@ -67,36 +90,41 @@
</p>
</div>
<!-- EDIT2 SECTION "Presentation" [27-397] -->
<h2 class="sectionedit3" id="configuration">Configuration</h2>
<!-- EDIT1 SECTION "Presentation" [19-389] -->
<h2 class="sectionedit2" id="configuration">Configuration</h2>
<div class="level2">
</div>
<!-- EDIT2 SECTION "Configuration" [390-416] -->
<h3 class="sectionedit3" id="enabling_cas">Enabling CAS</h3>
<div class="level3">
<p>
In the Manager, go in <code>General Parameters</code> » <code>Issuer modules</code> » <code><abbr title="Central Authentication Service">CAS</abbr></code> and configure:
</p>
<ul>
<li class="level1"><div class="li"> <strong>Activation</strong>: set to <code>On</code>.</div>
</li>
<li class="level1"><div class="li"> <strong>Path</strong>: keep <code>^/cas/</code> unless you have change <a href="configlocation.html#portal" class="wikilink1" title="documentation:2.0:configlocation">Apache portal configuration</a> file.</div>
</li>
<li class="level1"><div class="li"> <strong>Use rule</strong>: a rule to allow user to use this module, set to 1 to always allow.</div>
<li class="level1"><div class="li"> <strong>Path</strong>: it is recommended to keep the default value (<code>^/cas/</code>)</div>
</li>
</ul>
<div class="notetip">For example, to allow only users with a strong authentication level:
<pre class="code">$authenticationLevel &gt; 2</pre>
</div>
<!-- EDIT3 SECTION "Enabling CAS" [417-640] -->
<h3 class="sectionedit4" id="configuring_the_cas_service">Configuring the CAS Service</h3>
<div class="level3">
<p>
Then go in <code>Options</code> to define:
Then go in <code><abbr title="Central Authentication Service">CAS</abbr> Service</code> to define:
</p>
<ul>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> login</strong>: the session key used to fill user login (value will be transmitted to <abbr title="Central Authentication Service">CAS</abbr> clients).</div>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> login</strong>: the session key transmitted to <abbr title="Central Authentication Service">CAS</abbr> client as the main identifier (<abbr title="Central Authentication Service">CAS</abbr> Principal)</div>
</li>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> attributes</strong>: list of attributes that will be transmitted in validate response. Keys are the name of attribute in the <abbr title="Central Authentication Service">CAS</abbr> response, values are the name of session key.</div>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> attributes</strong>: list of attributes that will be transmitted by default in the validate response. Keys are the name of attribute in the <abbr title="Central Authentication Service">CAS</abbr> response, values are the name of session key. </div>
</li>
<li class="level1"><div class="li"> <strong>Access control policy</strong>: define if access control should be done on <abbr title="Central Authentication Service">CAS</abbr> service. Three options:</div>
<ul>
<li class="level2"><div class="li"> <strong>none</strong>: no access control, the server will answer without checking if the user is authorized for the service (this is the default)</div>
<li class="level2"><div class="li"> <strong>none</strong>: no access control. The <abbr title="Central Authentication Service">CAS</abbr> service will accept non-declared <abbr title="Central Authentication Service">CAS</abbr> applications and ignore access control rules. This is the default.</div>
</li>
<li class="level2"><div class="li"> <strong>error</strong>: if user has no access, an error is shown on the portal, the user is not redirected to <abbr title="Central Authentication Service">CAS</abbr> service</div>
</li>
......@@ -104,12 +132,54 @@ Then go in <code>Options</code> to define:
</li>
</ul>
</li>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> session module name and options</strong>: choose a specific module if you do not want to mix <abbr title="Central Authentication Service">CAS</abbr> sessions and normal sessions (see <a href="samlservice.html#saml_sessions_module_name_and_options" class="wikilink1" title="documentation:2.0:samlservice">why</a>).</div>
<li class="level1"><div class="li"> <strong><abbr title="Central Authentication Service">CAS</abbr> session module name and options</strong>: choose a specific module if you do not want to mix <abbr title="Central Authentication Service">CAS</abbr> sessions and normal sessions (see <a href="samlservice.html#saml_sessions_module_name_and_options" class="wikilink1" title="documentation:2.1:samlservice">why</a>).</div>
</li>
</ul>
<div class="notetip">If <code><abbr title="Central Authentication Service">CAS</abbr> login</code> is not set, it uses <code>General Parameters</code> » <code>Logs</code> » <code>REMOTE_USER</code> data, which is set to <code>uid</code> by default
</div>
</div>
<!-- EDIT3 SECTION "Configuration" [398-] --></div>
<!-- EDIT4 SECTION "Configuring the CAS Service" [641-1923] -->
<h3 class="sectionedit5" id="configuring_cas_applications">Configuring CAS Applications</h3>
<div class="level3">
<p>
If an access control policy other than <code>none</code> is specified, applications that want to authenticate users through the <abbr title="Central Authentication Service">CAS</abbr> protocol have to be declared before LemonLDAP::NG accepts to issue service tickets for them.
</p>
<p>
Go to <code><abbr title="Central Authentication Service">CAS</abbr> Applications</code> and then <code>Add <abbr title="Central Authentication Service">CAS</abbr> Application</code>. Give a technical name (no spaces, no special characters), like “app-example”.
</p>
<p>
You can then access the configuration of this application.
</p>
</div>
<h4 id="options">Options</h4>
<div class="level4">
<ul>
<li class="level1"><div class="li"> <strong>Service <abbr title="Uniform Resource Locator">URL</abbr></strong> : the service (user-facing) <abbr title="Uniform Resource Locator">URL</abbr> of the <abbr title="Central Authentication Service">CAS</abbr>-enabled application.</div>
</li>
<li class="level1"><div class="li"> <strong>Rule</strong> : The access control rule to enforce on this application. If left blank, access will be allowed for everyone.</div>
</li>
</ul>
<div class="noteimportant">If the access control policy is set to <code>none</code>, this rule will be ignored
</div>
</div>
<h4 id="exported_attributes">Exported Attributes</h4>
<div class="level4">
<p>
You may add a list of attributes that will be transmitted in the validate response. Keys are the name of attribute in the <abbr title="Central Authentication Service">CAS</abbr> response, values are the name of session key.
</p>
<p>
The attributes defined here will completely replace any attributes you may have declared in the global <code><abbr title="Central Authentication Service">CAS</abbr> Service</code> configuration. In order to re-use the global configuration, simply set this section to an empty list.
</p>
</div>
<!-- EDIT5 SECTION "Configuring CAS Applications" [1924-] --></div>
</body>
</html>
......@@ -24,8 +24,10 @@ staticPrefix = /static
languages = fr, en, vi, it, ar, de, zh, nl, es, pt, ro
templateDir = __pwd__/lemonldap-ng-portal/site/templates
portalStatus = 1
;totp2fActivation = 1
;totp2fSelfRegistration = 1
totp2fActivation = 1
totp2fSelfRegistration = 1
captcha_mail_enabled = 0
portalDisplayResetPassword = 1
[handler]
......
......@@ -86,7 +86,7 @@
"description": "Official LemonLDAP::NG Website",
"display": "on",
"logo": "network.png",
"name": "Offical Website",
"name": "Official Website",
"uri": "http://lemonldap-ng.org/"
},
"type": "application"
......@@ -165,7 +165,7 @@
"_whatToTrace": "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : $_auth eq 'OpenIDConnect' ? \"$_user\\@$_oidcConnectedRP\" : \"$_user\""
},
"mailUrl": "http://auth.example.com:__port__/resetpwd",
"notification": 0,
"notification": 1,
"notificationStorage": "File",
"notificationStorageOptions": {
"dirName": "__pwd__/e2e-tests/conf"
......
......@@ -70,6 +70,7 @@ describe('01 Lemonldap::NG Manager', function() {
});
it('General Parameters > Authn. parameters > Users modules => Should have 7 modules availabled with "Same" selected', function() {
element(by.id('t-userDB')).click();
browser.sleep(1000);
expect(element(by.css('option[selected="selected"]')).getAttribute('Value')).toEqual('Same');
expect(element.all(by.repeater('item in currentNode.select')).count()).toEqual(7);
});
......
......@@ -2,15 +2,21 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('02 Lemonldap::NG Manager', function() {
describe('translation', function() {
describe('02 Lemonldap::NG Manger', function() {
describe('Menu', function() {
it('should translate in english and french', function() {
var tests = {
"en": "General Parameters",
"fr": "Paramètres généraux"
};
// // Login attempt
// browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
// 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();
// browser.get('/');
var els = element.all(by.css('[ng-click="getLanguage(lang)"]'));
expect(els.count()).toEqual(14);
els.each(function(el) {
......@@ -26,5 +32,14 @@ describe('02 Lemonldap::NG Manager', function() {
});
});
});
it('Should display Menu -> Links', function() {
element(by.id("mainlangmenu")).click();
browser.sleep(500);
var links = element.all(by.repeater('menulink in menulinks'));
expect(links.count()).toEqual(4);
expect(links.get(0).getText()).toEqual('Retour au portail');
expect(links.get(1).getText()).toEqual('Déconnexion');
});
});
});
......@@ -44,7 +44,7 @@ describe('05 Lemonldap::NG Manager', function() {
['exportedVars', 'macros', 'groups'].forEach(function(type) {
element(by.id('a-' + type)).click();
element(by.id('t-' + type)).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
expect(element(by.id('t-' + type + '/n' + id)).getText()).toEqual('new');
browser.sleep(3000);
id++;
......
......@@ -7,14 +7,19 @@ describe('06 Lemonldap::NG Manager', function() {
describe('Form control, part 2', function() {
it('should display portal skin choice', function() {
browser.get('/#/confs/1');
browser.get('/#!/confs/lastest');
element(by.id('a-generalParameters')).click();
element(by.id('a-portalParams')).click();
element(by.id('a-portalCustomization')).click();
element(by.id('t-portalSkin')).click();
element(by.css('[ng-click="showModal(\'portalSkinChoice.html\')"]')).click();
browser.sleep(1000);
var skinChoice = element.all(by.repeater('b in currentNode.select'));
expect(skinChoice.count()).toEqual(1);
element(by.css('[trspan="cancel"]')).click();
browser.sleep(1000);
});
});
});
......@@ -7,37 +7,57 @@ describe('07 Lemonldap::NG Manager', function() {
describe('Form control, part 3 - authParams', function() {
it('should display auth modules chosen', function() {
browser.get('/#/confs/1');
browser.get('/#!/confs/latest');
browser.sleep(2000);
element(by.id('a-generalParameters')).click();
browser.sleep(1000);
element(by.id('a-authParams')).click();
browser.sleep(1000);
element(by.id('t-authentication')).click();
browser.sleep(2000);
expect(element(by.id('t-demoParams')).isDisplayed()).toBeTruthy();
element(by.xpath("//option[@value='Apache']")).click();
browser.sleep(2000);
expect(element(by.id('t-apacheParams')).isDisplayed()).toBeTruthy();
});
it('should display auth modules chosen with authChoice', function() {
element(by.xpath("//option[@value='Choice']")).click();
browser.sleep(1000);
expect(element(by.id('t-choiceParams')).isDisplayed()).toBeTruthy();
element(by.id('a-choiceParams')).click();
browser.sleep(1000);
element(by.id('t-authChoiceModules')).click();
element(by.css('.glyphicon-plus-sign')).click();
browser.sleep(2000);
//element(by.css('.glyphicon-plus-sign')).click();
browser.sleep(2000);
element(by.id('a-authChoiceModules')).click();
browser.sleep(2000);
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('t-authChoiceModules/n1')).click();
element(by.xpath("//option[@value='LDAP']")).click();
browser.sleep(2000);
element.all(by.xpath("//option[@value='LDAP']")).first().click();
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
it('should display auth modules chosen with authCombination', function() {
element(by.id('t-authentication')).click();
browser.sleep(1000);
element(by.xpath("//option[@value='Combination']")).click();
browser.sleep(1000);
expect(element(by.id('t-combinationParams')).isDisplayed()).toBeTruthy();
element(by.id('a-combinationParams')).click();
browser.sleep(1000);
element(by.id('t-combModules')).click();
browser.sleep(2000);
element(by.css('.glyphicon-plus-sign')).click();
element(by.xpath("//option[@value='DBI']")).click();
expect(element(by.id('t-dbiParams')).isDisplayed()).toBeTruthy();
element(by.xpath("//option[@value='LDAP']")).click();
element.all(by.xpath("//option[@value='LDAP']")).first().click();
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
});
......
......@@ -7,7 +7,7 @@ describe('07u Lemonldap::NG Manager', function() {
describe('Apply mechanism', function() {
it('should be able to send UTF-8 chars', function() {
browser.get('/#/confs/latest');
browser.get('/#!/confs/latest');
element(by.id('a-generalParameters')).click();
element(by.id('a-advancedParams')).click();
element(by.id('a-security')).click();
......@@ -18,6 +18,8 @@ describe('07u Lemonldap::NG Manager', function() {
element(by.id('save')).click();
element(by.id('longtextinput')).sendKeys('UTF-8 tests');
element(by.id('saveok')).click();
browser.sleep(2000);
element(by.id('messageok')).click();
expect(element(by.id('cfgnum')).getText()).toEqual('2');
});
......
......@@ -7,25 +7,38 @@ describe('08 Lemonldap::NG Manager', function() {
describe('Apply mechanism', function() {
it('should be able to add reload urls', function() {
browser.get('/#/confs/latest');
browser.get('/#!/confs/latest');
browser.sleep(1000);
element(by.id('a-generalParameters')).click();
element(by.id('t-reloadParams')).click();
element(by.id('a-reloadParams')).click();
element(by.id('t-reloadUrls')).click();
element(by.css('.glyphicon-plus-sign')).click();
element(by.id('a-reloadUrls')).click();
browser.sleep(1000);
//element(by.id('a-reloadUrls')).click();
element(by.css('.glyphicon-plus-sign')).click();
browser.sleep(1000);
element(by.id('t-reloadUrls/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('auth.example.com:19876');
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/nothing');
browser.sleep(1000);
element(by.id('hashkeyinput')).clear().sendKeys('auth.example.com');
browser.sleep(1000);
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/common/icons/ok.png');
browser.sleep(1000);
element(by.css('.glyphicon-plus-sign')).click();
element(by.id('t-reloadUrls/n2')).click();
element(by.id('hashkeyinput')).clear().sendKeys('manager.example.com:19876');
element(by.id('hashvalueinput')).clear().sendKeys('http://auth.example.com:19876/static/js/manager.js');
element(by.id('hashkeyinput')).clear().sendKeys('manager.example.com');
element(by.id('hashvalueinput')).clear().sendKeys('http://manager.example.com:19876/static/js/manager.js');
browser.sleep(1000);
});
it('should save new configuration', function() {
element(by.id('save')).click();
element(by.id('longtextinput')).sendKeys('Reload URLs test');
element(by.id('saveok')).click();
expect(element.all(by.repeater('item in item.items')).count()).toEqual(2);
browser.sleep(1000);
element(by.id('messageok')).click();
expect(element(by.id('cfgnum')).getText()).toEqual('3');
});
......
......@@ -9,7 +9,7 @@ describe('11 Lemonldap::NG Manager', function() {
it('should add an OIDC OP', function() {
browser.get('/#/confs/latest');
element(by.id('t-oidcOPMetaDataNodes')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('promptok')).click();
browser.sleep(500);
element(by.id('a-oidcOPMetaDataNodes/new__op-example')).click();
......@@ -18,7 +18,7 @@ describe('11 Lemonldap::NG Manager', function() {
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataJWKS')).click();
element(by.id('filetext')).sendKeys('{"c":"d"}');
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars')).click();
element(by.id('t-oidcOPMetaDataNodes/new__op-example/oidcOPMetaDataExportedVars/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyKey');
......
......@@ -9,12 +9,12 @@ describe('12 Lemonldap::NG Manager', function() {
it('should add an OIDC RP', function() {
browser.get('/#/confs/latest');
element(by.id('t-oidcRPMetaDataNodes')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
element(by.id('promptok')).click();
browser.sleep(500);
element(by.id('a-oidcRPMetaDataNodes/new__rp-example')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataExportedVars/n1')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyKey');
......@@ -24,7 +24,7 @@ describe('12 Lemonldap::NG Manager', function() {
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsClientID')).click();
element(by.id('textinput')).clear().sendKeys('MyClientID');
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims')).click();
element(by.css('.glyphicon-plus-sign')).click();
element.all(by.css('.glyphicon-plus-sign')).first().click();
//element(by.id('a-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims')).click();
element(by.id('t-oidcRPMetaDataNodes/new__rp-example/oidcRPMetaDataOptionsExtraClaims/n2')).click();
element(by.id('hashkeyinput')).clear().sendKeys('MyClaim');
......
......@@ -7,7 +7,9 @@ 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#!/5/6');
browser.sleep(5000);
element(by.id('t-generalParameters')).click();
element(by.id('t-advancedParams')).click();
element(by.id('t-security')).click();
......
......@@ -6,17 +6,18 @@ describe('40 Lemonldap::NG Manager', function() {
browser.get('/');
var links = element.all(by.repeater('l in links'));
expect(links.count()).toEqual(4);
element(by.xpath("//a[@href='sessions.html']")).click();
element.all(by.xpath("//a[@href='sessions.html']")).first().click();
});
});
describe('40 Lemonldap::NG Session explorer', function() {
describe('40 Lemonldap::NG Sessions explorer', function() {
var session, ip;
it('Should display at least my session', function() {
browser.get('/sessions.html');
expect(element.all(by.xpath("//a[@href='sessions.html']")).first().getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
var t = element.all(by.repeater('node in data track by node.id'));
expect(t.count()).toBeGreaterThan(0);
element(by.id("a-d")).click();
......
'use strict';
describe('50 Lemonldap::NG Manager', function() {
it('should display 2FA Sessions explorer', function() {
//// Login attempt
// browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
// 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();
browser.get('/');
var links = element.all(by.repeater('l in links'));
expect(links.count()).toEqual(4);
expect(element.all(by.xpath("//a[@href='2ndfa.html']")).first().getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
element.all(by.xpath("//a[@href='2ndfa.html']")).first().click();
});
});
describe('50 Lemonldap::NG 2FA Sessions explorer', function() {
it('Should display at least my persistent session', function() {
browser.get('/2ndfa.html');
expect(element(by.id('a-persistent')).getText()).toEqual('Explorateur sessions 2ndFA ');
expect(element.all(by.css("input[type=checkbox]")).count()).toEqual(3);
expect(element.all(by.css("input[type=text]")).count()).toEqual(1);
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
element(by.id("a-d")).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
element(by.id("s-5efe8af397fc3577e05b483aca964f1b")).click();
browser.sleep(500);
});
it('Should display Dwho session', function() {
expect(element(by.tagName('h1')).getText()).toEqual('Contenu de la session 5efe8af397fc3577e05b483aca964f1b');
var titles = element.all(by.tagName('h2'));
expect(titles.get(0).getText()).toEqual('Dates');
expect(titles.get(1).getText()).toEqual("Seconds Facteurs d'Authentification");
var nodes = element.all(by.className('glyphicon-minus-sign'));
expect(nodes.count()).toEqual(3);
nodes.get(0).click();
expect(element.all(by.className('glyphicon-minus-sign')).count()).toEqual(2);
});
it('Should filter persistent sessions', function() {
element(by.css('input[ng-model="U2FCheck"]')).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
element(by.css('input[ng-model="UBKCheck"]')).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
element(by.css('input[ng-model="TOTPCheck"]')).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(0);
expect(element.all(by.className('label-warning')).get(0).getText()).toEqual('Aucune donnée à afficher');
element(by.css('input[ng-model="TOTPCheck"]')).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
element(by.css('input[ng-model="searchString"]')).clear().sendKeys('dw');
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
expect(element(by.id("a-dw")));
browser.sleep(500);
element(by.css('input[ng-model="searchString"]')).clear().sendKeys('dwho');
expect(element(by.id("a-dwho")));
browser.sleep(500);
element(by.css('input[ng-model="searchString"]')).clear().sendKeys('a');
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(0);
expect(element.all(by.className('label-warning')).get(0).getText()).toEqual('Aucune donnée à afficher');
browser.sleep(500);
element(by.className('glyphicon-search')).click();
expect(element.all(by.repeater('node in data track by node.id')).count()).toEqual(1);
browser.sleep(500);
});
});
{"_session_kind":"Persistent","_loginHistory":{"successLogin":[{"ipAddr":"127.0.0.1","_utime":1548016089}]},"_2fDevices":"[{\"type\":\"U2F\",\"_keyHandle\":\"CTPeZD3aFrNOY4yVWH4o1MKSn2aLH2OwLOWTtrQSlt_6LtUyki5nzrwBEeuxj7PRSujFZQDaMTfrEb-gr22Qfg\",\"_userKey\":\"BI1MGzKj1C9mMV8PwrYMggQXlItLBNSB19rNnFgUpLMBjAkMW8w3Sqg8s_hUGbdfdWX99duquzIzRLUtRUEvJLo\",\"name\":\"MyU2FKey\",\"epoch\":1548016193},{\"epoch\":1548016213,\"name\":\"MyYubikey\",\"_yubikey\":\"cccccchehfff\",\"type\":\"UBK\"},{\"epoch\":1548018950,\"name\":\"MyU2FKeyBlue\",\"_userKey\":\"BDEa8pQfV9agdvsX63bcwceRTXR_QvDdm5hQ5ZKQUaH4HlOi8ab4fQfl9CIACALWYm0jQcpfaRAcACiSCdwGrnI\",\"_keyHandle\":\"ZD_G6EfDv4FzttWS9RCS80SaSlRTXgtJU9r-1gInsQ4Jj1555r7nnrYhIvRfE4CTyH7NyGrt9fMnMMgByAx97Q\",\"type\":\"U2F\"}]","_session_id":"5efe8af397fc3577e05b483aca964f1b","_session_uid":"dwho","_updateTime":"20190120221550","_utime":1548016089}
\ No newline at end of file
......@@ -6,19 +6,24 @@ 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.sleep(500);
browser.driver.findElements(by.className('langicon')).then(function(elems) {
expect(elems.length).toEqual(11);
});
browser.sleep(500);
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');
expect(browser.driver.findElement(by.css('[trspan="resetPwd"]')).getText()).toEqual('Reset my password');
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');
expect(browser.driver.findElement(by.css('[trspan="resetPwd"]')).getText()).toEqual('Reimpostare la password');
browser.driver.findElement(by.xpath("//img[@title='fr']")).click();
expect(browser.driver.findElement(by.css('[trspan="createAccount"]')).getText()).toEqual('Créer un compte');
expect(browser.driver.findElement(by.css('[trspan="resetPwd"]')).getText()).toEqual('Réinitialiser mon mot de passe');
});
it('should want to crete an account', function() {
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');
......@@ -29,8 +34,30 @@ describe('00 Lemonldap::NG', function() {
browser.driver.findElements(by.className('img-thumbnail')).then(function(elems) {
expect(elems.length).toEqual(1);
});
browser.driver.findElement(by.xpath("//input[@name='firstname']")).sendKeys('doctor');
browser.driver.findElement(by.xpath("//input[@name='lastname']")).sendKeys('who');
browser.driver.findElement(by.xpath("//input[@name='mail']")).sendKeys('dwho@badwolf.com');
browser.driver.findElement(by.xpath("//input[@name='captcha']")).sendKeys('1234567');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
expect(browser.driver.findElement(by.css('[trmsg="76"]')).getText()).toEqual('Erreur dans la saisie du captcha');
browser.driver.findElement(by.css('[trspan="back2Portal"]')).click();
});
it('should reset my password', function() {
browser.driver.findElement(by.css('[trspan="resetPwd"]')).click();
expect(browser.driver.findElement(by.css('[trmsg="69"]')).getText()).toEqual('Merci de saisir votre adresse mail');
expect(browser.driver.findElement(by.css('[trspan="sendPwd"]')).getText()).toEqual('Envoyez-moi un lien');
// A one input form
browser.driver.findElements(by.className('input-group')).then(function(elems) {
expect(elems.length).toEqual(1);
});
browser.driver.findElement(by.xpath("//input[@name='mail']")).sendKeys('dwho@badwolf.com');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
expect(browser.driver.findElement(by.css('[trmsg="72"]')).getText()).toEqual('Un mail de confirmation vous a été envoyé');
expect(browser.driver.findElement(by.css('[trspan="mailSent2"]')).getText()).toEqual('Un message a été envoyé à votre adresse mail.');
expect(browser.driver.findElement(by.css('[trspan="linkValidUntil"]')).getText()).toEqual("Ce message contient un lien pour réinitialiser votre mot de passe, ce lien est valide jusqu'au");
});
it('should want to authenticate with history', function() {
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();
......@@ -47,13 +74,17 @@ describe('00 Lemonldap::NG', function() {
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() {
// Three entries
browser.driver.findElements(by.xpath('//table/tbody/tr')).then(function(elems) {
expect(elems.length).toEqual(5);
expect(elems.length).toEqual(3);
});
// Expect history with one login and one failed login
// Expect history with two logins and one failed login
browser.driver.findElements(by.xpath('//form/div/div/h3')).then(function(elems) {
expect(elems.length).toEqual(3);
expect(elems[0].getText()).toEqual('Information');
......@@ -67,11 +98,12 @@ describe('00 Lemonldap::NG', function() {
expect(elems[4].getText()).toEqual('Fehlermeldung');
});
browser.driver.findElements(by.xpath('//table/tbody/tr/td')).then(function(elems) {
expect(elems.length).toEqual(11);
expect(elems.length).toEqual(7);
expect(elems[1].getText()).toEqual('127.0.0.1');
expect(elems[3].getText()).toEqual('127.0.0.1');
expect(elems[5].getText()).toEqual('127.0.0.1');
expect(elems[6].getText()).toEqual('Benutzername oder Passwort nicht korrekt');
});
browser.sleep(5000);
expect(browser.driver.findElement(by.css('[trspan="PE5"]')).getText()).toEqual('Benutzername oder Passwort nicht korrekt');
expect(browser.driver.findElement(by.id('timer')).getText()).toMatch(/^Du wirst in \d{2} Sekunden umgeleitet$/);
browser.driver.findElement(by.xpath("//button[@type='reset']")).click();
......
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('0 Lemonldap::NG', function() {
describe('Portal should display Menu', function() {
it('Should have four buttons', function() {
browser.driver.findElement(by.xpath("//img[@title='fr']")).click();
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
// Change password form
browser.driver.findElements(by.xpath('//li/a/span/img')).then(function(links) {
expect(links.length).toEqual(4);
links[1].click();
browser.sleep(1000);
browser.driver.findElement(by.xpath("//input[@name='oldpassword']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//input[@name='newpassword']")).sendKeys('newpwd');
browser.driver.findElement(by.xpath("//input[@name='confirmpassword']")).sendKeys('newpwd');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
expect(browser.driver.findElement(by.css('[trmsg="35"]')).getText()).toEqual('Le mot de passe a été changé');
browser.driver.findElement(by.css('[trspan="goToPortal"]')).click();
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
});
// History page
browser.driver.findElements(by.xpath('//li/a/span/img')).then(function(links) {
expect(links.length).toEqual(4);
links[2].click();
browser.sleep(1000);
// Expect history with one login and one failed login
browser.driver.findElements(by.xpath('//main/div/div/div/div/h4')).then(function(elems) {
expect(elems.length).toEqual(7);
expect(elems[4].getText()).toEqual('Dernières connexions');
expect(elems[5].getText()).toEqual('Dernières connexions refusées');
});
browser.driver.findElements(by.xpath('//table/thead/tr/th')).then(function(elems) {
expect(elems.length).toEqual(5);
expect(elems[0].getText()).toEqual('Date');
expect(elems[1].getText()).toEqual('Adresse IP');
expect(elems[2].getText()).toEqual('Date');
expect(elems[3].getText()).toEqual('Adresse IP');
expect(elems[4].getText()).toEqual("Message d'erreur");
});
browser.driver.findElements(by.xpath('//table/tbody/tr/td')).then(function(elems) {
expect(elems.length).toEqual(7);
expect(elems[1].getText()).toEqual('127.0.0.1');
expect(elems[3].getText()).toEqual('127.0.0.1');
expect(elems[5].getText()).toEqual('127.0.0.1');
expect(elems[6].getText()).toEqual('Mot de passe ou identifiant incorrect');
});
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
});
// Logout page
browser.driver.findElements(by.xpath('//li/a/span/img')).then(function(links) {
expect(links.length).toEqual(4);
links[3].click();
browser.sleep(1000);
expect(browser.driver.findElement(by.css('[trspan="areYouSure"]')).getText()).toEqual('Êtes-vous sûr ?');
expect(browser.driver.findElement(by.css('[trspan="imSure"]')).getText()).toEqual('Je suis sûr');
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
});
// Applications page
browser.driver.findElements(by.xpath('//li/a/span/img')).then(function(links) {
expect(links.length).toEqual(4);
links[0].click();
browser.sleep(1000);
});
});
it('Should have seven links', function() {
browser.driver.findElements(by.xpath('//main/div/div/div/div/h4')).then(function(elems) {
expect(elems.length).toEqual(7);
expect(elems[0].getText()).toEqual('Sample applications');
expect(elems[1].getText()).toEqual('Administration');
expect(elems[2].getText()).toEqual('Documentation');
});
browser.driver.findElements(by.xpath('//main/div/div/div/div/div/div/div/a/div/div/div/h5')).then(function(elems) {
expect(elems.length).toEqual(8);
expect(elems[0].getText()).toEqual('Application Test 1');
expect(elems[1].getText()).toEqual('Application Test 2');
expect(elems[2].getText()).toEqual('WebSSO Manager');
expect(elems[3].getText()).toEqual('Notifications explorer');
expect(elems[4].getText()).toEqual('Sessions explorer');
expect(elems[5].getText()).toEqual('2FA Sessions explorer');
expect(elems[6].getText()).toEqual('Local documentation');
expect(elems[7].getText()).toEqual('Official Website');
});
browser.driver.findElement(by.css('[alt="Application Test 1"]')).click();
browser.sleep(1000);
expect(browser.driver.findElement(by.id('v-Host')).getText()).toEqual('test1.example.com:' + process.env.TESTWEBSERVERPORT );
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="Application Test 2"]')).click();
browser.sleep(1000);
expect(browser.driver.findElement(by.id('v-Host')).getText()).toEqual('test2.example.com:' + process.env.TESTWEBSERVERPORT );
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="WebSSO Manager"]')).click();
expect(element.all(by.xpath("//a[@href='manager.html']")).first().getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
browser.sleep(1000);
expect(browser.driver.findElement(by.css('[trspan="currentConfiguration"]')).getText()).toEqual('Configuration actuelle');
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="Sessions explorer"]')).click();
expect(element.all(by.xpath("//a[@href='sessions.html']")).first().getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
browser.sleep(1000);
expect(browser.driver.findElement(by.css('[trspan="session_s"]')).getText()).toEqual('session(s)');
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="Notifications explorer"]')).click();
expect(element(by.xpath("//a[@href='notifications.html']")).getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
browser.sleep(1000);
expect(browser.driver.findElement(by.css('[trspan="noDatas"]')).getText()).toEqual('Aucune donnée à afficher');
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="2FA Sessions explorer"]')).click();
expect(element.all(by.xpath("//a[@href='2ndfa.html']")).first().getCssValue("color")).toEqual('rgba(157, 157, 157, 1)');
browser.sleep(1000);
expect(browser.driver.findElement(by.id('a-persistent')).getText()).toEqual('Explorateur sessions 2ndFA ');
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.css('[alt="Local documentation"]')).click();
browser.sleep(1000);
expect(browser.driver.findElement(by.xpath("//body/div/h1")).getText()).toEqual('LemonLDAP::NG offline documentation');
browser.driver.findElement(by.tagName('a')).click();
expect(browser.driver.findElement(by.tagName('h1')).getText()).toEqual('Documentation for LemonLDAP::NG 2.0');
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
});
});
});
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('10 Lemonldap::NG', function() {
describe('Second Factor Manager', function() {
it('Should have two links in dropDown menu', function() {
// // Login attempt
// browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
// 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();
// Toggle Menu bar
// Need to be clicked twice ???
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
browser.driver.findElement(by.css('[data-toggle="dropdown"]')).click();
browser.sleep(1000);
browser.driver.findElement(by.xpath("//button[@type='button']")).click();
browser.sleep(1000);
browser.driver.findElement(by.css('[data-toggle="dropdown"]')).click();
//
browser.driver.findElements(by.className('dropdown-item')).then(function(links) {
expect(links.length).toEqual(2);
links[0].click();
browser.sleep(1000);
});
});
it('Should display 2FA Manager', function() {
expect(browser.driver.findElement(by.css('[trspan="choose2f"]')).getText()).toEqual('Choisissez votre second facteur');
browser.driver.findElements(by.xpath('//table/thead/tr/th')).then(function(elems) {
expect(elems.length).toEqual(4);
expect(elems[0].getText()).toEqual('Type');
expect(elems[1].getText()).toEqual('Nom');
expect(elems[2].getText()).toEqual('Date');
// expect(elems[3].getText()).toEqual('Action');
});
browser.driver.findElements(by.xpath('//table/tbody/tr/td')).then(function(elems) {
expect(elems.length).toEqual(12);
expect(elems[0].getText()).toEqual('U2F');
expect(elems[1].getText()).toEqual('MyU2FKey');
expect(elems[2].getText()).toEqual('20/01/2019 à 21:29:53');
expect(elems[4].getText()).toEqual('UBK');
expect(elems[5].getText()).toEqual('MyYubikey');
expect(elems[6].getText()).toEqual('20/01/2019 à 21:30:13');
expect(elems[8].getText()).toEqual('U2F');
expect(elems[9].getText()).toEqual('MyU2FKeyBlue');
expect(elems[10].getText()).toEqual('20/01/2019 à 22:15:50');
});
expect(browser.driver.findElement(by.className('card-footer')).getText()).toEqual('TOTP2F');
browser.driver.findElements(by.className('btn-danger')).then(function(elems) {
expect(elems.length).toEqual(0);
// elems[0].click();
});
// expect(browser.driver.findElement(by.css('[trspan="choose2f"]')).getText()).toEqual("Vous n'êtes pas autorisé à faire cette requête");
browser.driver.findElement(by.xpath("//img[@title='totp2F']")).click();
});
it('Should display and 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[