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
824817f7
Commit
824817f7
authored
Jan 09, 2019
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP - Improve e2e tests (#1600)
parent
69e518b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
3 deletions
+82
-3
e2e-tests/lemonldap-ng.ini
e2e-tests/lemonldap-ng.ini
+2
-2
e2e-tests/lmConf-1.json
e2e-tests/lmConf-1.json
+1
-1
e2e-tests/portal/01-menu.js
e2e-tests/portal/01-menu.js
+38
-0
e2e-tests/portal/10-sfaManager.js
e2e-tests/portal/10-sfaManager.js
+41
-0
No files found.
e2e-tests/lemonldap-ng.ini
View file @
824817f7
...
@@ -24,8 +24,8 @@ staticPrefix = /static
...
@@ -24,8 +24,8 @@ staticPrefix = /static
languages
=
fr, en, vi, it, ar, de, zh, nl, es, pt, ro
languages
=
fr, en, vi, it, ar, de, zh, nl, es, pt, ro
templateDir
=
__pwd__/lemonldap-ng-portal/site/templates
templateDir
=
__pwd__/lemonldap-ng-portal/site/templates
portalStatus
=
1
portalStatus
=
1
;
totp2fActivation = 1
totp2fActivation
=
1
;
totp2fSelfRegistration = 1
totp2fSelfRegistration
=
1
[handler]
[handler]
...
...
e2e-tests/lmConf-1.json
View file @
824817f7
...
@@ -165,7 +165,7 @@
...
@@ -165,7 +165,7 @@
"_whatToTrace"
:
"$_auth eq 'SAML' ?
\"
$_user
\\
@$_idpConfKey
\"
: $_auth eq 'OpenIDConnect' ?
\"
$_user
\\
@$_oidcConnectedRP
\"
:
\"
$_user
\"
"
"_whatToTrace"
:
"$_auth eq 'SAML' ?
\"
$_user
\\
@$_idpConfKey
\"
: $_auth eq 'OpenIDConnect' ?
\"
$_user
\\
@$_oidcConnectedRP
\"
:
\"
$_user
\"
"
},
},
"mailUrl"
:
"http://auth.example.com:__port__/resetpwd"
,
"mailUrl"
:
"http://auth.example.com:__port__/resetpwd"
,
"notification"
:
0
,
"notification"
:
1
,
"notificationStorage"
:
"File"
,
"notificationStorage"
:
"File"
,
"notificationStorageOptions"
:
{
"notificationStorageOptions"
:
{
"dirName"
:
"__pwd__/e2e-tests/conf"
"dirName"
:
"__pwd__/e2e-tests/conf"
...
...
e2e-tests/portal/01-menu.js
View file @
824817f7
...
@@ -68,6 +68,8 @@ describe('01 Lemonldap::NG', function() {
...
@@ -68,6 +68,8 @@ describe('01 Lemonldap::NG', function() {
links
[
0
].
click
();
links
[
0
].
click
();
browser
.
sleep
(
1000
);
browser
.
sleep
(
1000
);
});
});
});
it
(
'
Should have seven links
'
,
function
()
{
browser
.
driver
.
findElements
(
by
.
xpath
(
'
//main/div/div/div/div/h4
'
)).
then
(
function
(
elems
)
{
browser
.
driver
.
findElements
(
by
.
xpath
(
'
//main/div/div/div/div/h4
'
)).
then
(
function
(
elems
)
{
expect
(
elems
.
length
).
toEqual
(
7
);
expect
(
elems
.
length
).
toEqual
(
7
);
expect
(
elems
[
0
].
getText
()).
toEqual
(
'
Sample applications
'
);
expect
(
elems
[
0
].
getText
()).
toEqual
(
'
Sample applications
'
);
...
@@ -85,6 +87,42 @@ describe('01 Lemonldap::NG', function() {
...
@@ -85,6 +87,42 @@ describe('01 Lemonldap::NG', function() {
expect
(
elems
[
6
].
getText
()).
toEqual
(
'
Local documentation
'
);
expect
(
elems
[
6
].
getText
()).
toEqual
(
'
Local documentation
'
);
expect
(
elems
[
7
].
getText
()).
toEqual
(
'
Official Website
'
);
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
();
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
();
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
();
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
();
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
+
'
/
'
);
});
});
});
});
});
});
e2e-tests/portal/10-sfaManager.js
0 → 100644
View file @
824817f7
'
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();
// 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
);
});
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
'
);
links
[
3
].
click
();
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//button[@type='button']
"
)).
click
();
browser
.
sleep
(
1000
);
expect
(
browser
.
driver
.
findElement
(
by
.
css
(
'
[trspan="yourApps"]
'
)).
getText
()).
toEqual
(
'
Vos applications
'
);
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment