This is the codeAbility Sharing Platform! Learn more about the
codeAbility Sharing Platform
.
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
codeAbility Sharing Platform
Manage
Activity
Members
Labels
Plan
Issues
43
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
development
sharing
codeAbility Sharing Platform
Commits
70288994
There was an error fetching the commit references. Please try again later.
Commit
70288994
authored
2 years ago
by
Eduard Frankford
Browse files
Options
Downloads
Patches
Plain Diff
testing
parent
6ff21474
2 merge requests
!188
Merging Peer Reviewing et. al to Master
,
!164
211 peer reviewing functionality
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+3
-0
3 additions, 0 deletions
.gitlab-ci.yml
src/test/javascript/e2e/account/account.spec.ts
+22
-2
22 additions, 2 deletions
src/test/javascript/e2e/account/account.spec.ts
with
25 additions
and
2 deletions
.gitlab-ci.yml
+
3
−
0
View file @
70288994
...
@@ -104,11 +104,14 @@ frontend-test:
...
@@ -104,11 +104,14 @@ frontend-test:
e2e-test
:
e2e-test
:
services
:
services
:
-
selenium/standalone-chrome
-
selenium/standalone-chrome
image
:
ubuntu:20.04
stage
:
e2e
stage
:
e2e
cache
:
{}
cache
:
{}
dependencies
:
dependencies
:
-
frontend-test
-
frontend-test
script
:
script
:
-
apt-get install default-jre
-
apt-get -f install
-
npm run e2e
-
npm run e2e
# sonar-analyze:
# sonar-analyze:
# stage: analyze
# stage: analyze
...
...
This diff is collapsed.
Click to expand it.
src/test/javascript/e2e/account/account.spec.ts
+
22
−
2
View file @
70288994
...
@@ -13,7 +13,9 @@ describe('account', () => {
...
@@ -13,7 +13,9 @@ describe('account', () => {
let
settingsPage
:
SettingsPage
;
let
settingsPage
:
SettingsPage
;
before
(
async
()
=>
{
before
(
async
()
=>
{
browser
.
waitForAngularEnabled
(
true
);
await
browser
.
get
(
'
/
'
);
await
browser
.
get
(
'
/
'
);
browser
.
waitForAngularEnabled
(
false
);
await
browser
.
sleep
(
2000
);
await
browser
.
sleep
(
2000
);
// browser.ignoreSynchronization = true;
// browser.ignoreSynchronization = true;
...
@@ -21,22 +23,27 @@ describe('account', () => {
...
@@ -21,22 +23,27 @@ describe('account', () => {
});
});
it
(
'
should fail to login with bad password
'
,
async
()
=>
{
it
(
'
should fail to login with bad password
'
,
async
()
=>
{
// browser.waitForAngularEnabled(false);
signInPage
=
await
navBarPage
.
getSignInPage
();
signInPage
=
await
navBarPage
.
getSignInPage
();
await
signInPage
.
autoSignInUsing
(
username
,
'
foo
'
);
await
signInPage
.
autoSignInUsing
(
username
,
'
foo
'
);
await
browser
.
sleep
(
2000
);
const
expect2
=
'
login.messages.error.authentication
'
;
const
expect2
=
'
login.messages.error.authentication
'
;
const
value2
=
await
element
(
by
.
css
(
'
.alert-danger
'
)).
getAttribute
(
'
jhiTranslate
'
);
const
value2
=
await
element
(
by
.
css
(
'
.alert-danger
'
)).
getAttribute
(
'
jhiTranslate
'
);
console
.
log
(
expect2
);
console
.
log
(
expect2
);
console
.
log
(
value2
);
console
.
log
(
value2
);
await
browser
.
sleep
(
2000
);
expect
(
value2
).
to
.
eq
(
expect2
);
expect
(
value2
).
to
.
eq
(
expect2
);
});
});
it
(
'
should login successfully with admin account
'
,
async
()
=>
{
it
(
'
should login successfully with admin account
'
,
async
()
=>
{
browser
.
waitForAngularEnabled
(
true
);
await
browser
.
get
(
'
/
'
);
await
browser
.
get
(
'
/
'
);
browser
.
waitForAngularEnabled
(
false
);
signInPage
=
await
navBarPage
.
getSignInPage
();
signInPage
=
await
navBarPage
.
getSignInPage
();
await
signInPage
.
autoSignInUsing
(
username
,
password
);
await
signInPage
.
autoSignInUsing
(
username
,
password
);
await
browser
.
sleep
(
2000
);
const
expect2
=
'
home.logged.message
'
;
const
expect2
=
'
home.logged.message
'
;
await
browser
.
wait
(
ec
.
visibilityOf
(
element
(
by
.
id
(
'
home-logged-message
'
))));
await
browser
.
wait
(
ec
.
visibilityOf
(
element
(
by
.
id
(
'
home-logged-message
'
))));
const
value2
=
await
element
(
by
.
id
(
'
home-logged-message
'
)).
getAttribute
(
'
jhiTranslate
'
);
const
value2
=
await
element
(
by
.
id
(
'
home-logged-message
'
)).
getAttribute
(
'
jhiTranslate
'
);
...
@@ -46,12 +53,14 @@ describe('account', () => {
...
@@ -46,12 +53,14 @@ describe('account', () => {
it
(
'
should be able to update settings
'
,
async
()
=>
{
it
(
'
should be able to update settings
'
,
async
()
=>
{
await
navBarPage
.
clickOnAccountMenu
();
await
navBarPage
.
clickOnAccountMenu
();
settingsPage
=
await
navBarPage
.
getSettingsPage
();
settingsPage
=
await
navBarPage
.
getSettingsPage
();
await
browser
.
sleep
(
2000
);
const
expect1
=
'
settings.title
'
;
const
expect1
=
'
settings.title
'
;
const
value1
=
await
settingsPage
.
getTitle
();
const
value1
=
await
settingsPage
.
getTitle
();
expect
(
value1
).
to
.
eq
(
expect1
);
expect
(
value1
).
to
.
eq
(
expect1
);
await
settingsPage
.
save
();
await
settingsPage
.
save
();
await
browser
.
sleep
(
500
);
await
browser
.
sleep
(
500
);
await
browser
.
sleep
(
2000
);
const
expect2
=
'
settings.messages.success
'
;
const
expect2
=
'
settings.messages.success
'
;
const
alert
=
element
(
by
.
css
(
'
.alert-success
'
));
const
alert
=
element
(
by
.
css
(
'
.alert-success
'
));
const
value2
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
const
value2
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
...
@@ -60,6 +69,7 @@ describe('account', () => {
...
@@ -60,6 +69,7 @@ describe('account', () => {
it
(
'
should fail to update password when using incorrect current password
'
,
async
()
=>
{
it
(
'
should fail to update password when using incorrect current password
'
,
async
()
=>
{
passwordPage
=
await
navBarPage
.
getPasswordPage
();
passwordPage
=
await
navBarPage
.
getPasswordPage
();
await
browser
.
sleep
(
2000
);
expect
(
await
passwordPage
.
getTitle
()).
to
.
eq
(
'
password.title
'
);
expect
(
await
passwordPage
.
getTitle
()).
to
.
eq
(
'
password.title
'
);
...
@@ -67,6 +77,7 @@ describe('account', () => {
...
@@ -67,6 +77,7 @@ describe('account', () => {
await
passwordPage
.
setPassword
(
'
new_password
'
);
await
passwordPage
.
setPassword
(
'
new_password
'
);
await
passwordPage
.
setConfirmPassword
(
'
new_password
'
);
await
passwordPage
.
setConfirmPassword
(
'
new_password
'
);
await
passwordPage
.
save
();
await
passwordPage
.
save
();
await
browser
.
sleep
(
2000
);
const
expect2
=
'
password.messages.error
'
;
const
expect2
=
'
password.messages.error
'
;
const
alert
=
element
(
by
.
css
(
'
.alert-danger
'
));
const
alert
=
element
(
by
.
css
(
'
.alert-danger
'
));
...
@@ -77,21 +88,25 @@ describe('account', () => {
...
@@ -77,21 +88,25 @@ describe('account', () => {
it
(
'
should be able to update password
'
,
async
()
=>
{
it
(
'
should be able to update password
'
,
async
()
=>
{
passwordPage
=
await
navBarPage
.
getPasswordPage
();
passwordPage
=
await
navBarPage
.
getPasswordPage
();
await
browser
.
sleep
(
2000
);
expect
(
await
passwordPage
.
getTitle
()).
to
.
eq
(
'
password.title
'
);
expect
(
await
passwordPage
.
getTitle
()).
to
.
eq
(
'
password.title
'
);
await
passwordPage
.
setCurrentPassword
(
password
);
await
passwordPage
.
setCurrentPassword
(
password
);
await
passwordPage
.
setPassword
(
'
newpassword
'
);
await
passwordPage
.
setPassword
(
'
newpassword
'
);
await
passwordPage
.
setConfirmPassword
(
'
newpassword
'
);
await
passwordPage
.
setConfirmPassword
(
'
newpassword
'
);
await
passwordPage
.
save
();
await
passwordPage
.
save
();
await
browser
.
sleep
(
2000
);
const
successMsg
=
'
password.messages.success
'
;
const
successMsg
=
'
password.messages.success
'
;
const
alert
=
element
(
by
.
css
(
'
.alert-success
'
));
const
alert
=
element
(
by
.
css
(
'
.alert-success
'
));
const
alertValue
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
const
alertValue
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
expect
(
alertValue
).
to
.
eq
(
successMsg
);
expect
(
alertValue
).
to
.
eq
(
successMsg
);
await
navBarPage
.
autoSignOut
();
await
navBarPage
.
autoSignOut
();
await
browser
.
sleep
(
2000
);
signInPage
=
await
navBarPage
.
getSignInPage
();
signInPage
=
await
navBarPage
.
getSignInPage
();
await
signInPage
.
autoSignInUsing
(
username
,
'
newpassword
'
);
await
signInPage
.
autoSignInUsing
(
username
,
'
newpassword
'
);
await
browser
.
sleep
(
2000
);
// change back to default
// change back to default
await
navBarPage
.
clickOnPasswordMenu
();
await
navBarPage
.
clickOnPasswordMenu
();
...
@@ -100,6 +115,8 @@ describe('account', () => {
...
@@ -100,6 +115,8 @@ describe('account', () => {
await
passwordPage
.
setPassword
(
password
);
await
passwordPage
.
setPassword
(
password
);
await
passwordPage
.
setConfirmPassword
(
password
);
await
passwordPage
.
setConfirmPassword
(
password
);
await
passwordPage
.
save
();
await
passwordPage
.
save
();
await
browser
.
sleep
(
2000
);
// wait for success message
// wait for success message
const
alertValue2
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
const
alertValue2
=
await
alert
.
getAttribute
(
'
jhiTranslate
'
);
expect
(
alertValue2
).
to
.
eq
(
successMsg
);
expect
(
alertValue2
).
to
.
eq
(
successMsg
);
...
@@ -107,8 +124,9 @@ describe('account', () => {
...
@@ -107,8 +124,9 @@ describe('account', () => {
it
(
'
should navigate to 404 not found error page on non existing route and show user own navbar if valid authentication exists
'
,
async
()
=>
{
it
(
'
should navigate to 404 not found error page on non existing route and show user own navbar if valid authentication exists
'
,
async
()
=>
{
// don't sign out and refresh page with non existing route
// don't sign out and refresh page with non existing route
browser
.
waitForAngularEnabled
(
true
);
await
browser
.
get
(
'
/this-is-link-to-non-existing-page
'
);
await
browser
.
get
(
'
/this-is-link-to-non-existing-page
'
);
browser
.
waitForAngularEnabled
(
false
);
// should navigate to 404 not found page
// should navigate to 404 not found page
const
url
=
await
browser
.
getCurrentUrl
();
const
url
=
await
browser
.
getCurrentUrl
();
expect
(
url
).
to
.
endWith
(
'
404
'
);
expect
(
url
).
to
.
endWith
(
'
404
'
);
...
@@ -118,6 +136,8 @@ describe('account', () => {
...
@@ -118,6 +136,8 @@ describe('account', () => {
});
});
after
(
async
()
=>
{
after
(
async
()
=>
{
browser
.
waitForAngularEnabled
(
true
);
await
navBarPage
.
autoSignOut
();
await
navBarPage
.
autoSignOut
();
browser
.
waitForAngularEnabled
(
false
);
});
});
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment