Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
f6afc788
Commit
f6afc788
authored
Jan 26, 2019
by
Christophe Maudoux
🐛
Browse files
WIP - Improve e2e tests (#1600)
parent
6cb03669
Changes
1
Hide whitespace changes
Inline
Side-by-side
e2e-tests/manager/02-menu.js
0 → 100644
View file @
f6afc788
'
use strict
'
;
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
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
)
{
el
.
isDisplayed
().
then
(
function
(
isVisible
)
{
if
(
isVisible
)
{
el
.
getAttribute
(
'
src
'
).
then
(
function
(
lang
)
{
lang
=
lang
.
replace
(
/^.*
\/(\w
+
)\.
png$/
,
'
$1
'
);
el
.
click
();
var
gp
=
element
(
by
.
id
(
'
t-generalParameters
'
));
expect
(
gp
.
getText
()).
toEqual
(
tests
[
lang
]);
});
}
});
});
});
it
(
'
Should display Menu -> Links
'
,
function
()
{
element
(
by
.
id
(
"
mainlangmenu
"
)).
click
();
browser
.
sleep
(
5000
);
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
'
);
});
});
});
Write
Preview
Supports
Markdown
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