Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
b47fd838
Commit
b47fd838
authored
8 years ago
by
Martin Schoeler
Browse files
Options
Downloads
Patches
Plain Diff
Manually Approve New Users test
start
parent
c84642c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/end-to-end/ui/12-settings.js
+70
-2
70 additions, 2 deletions
tests/end-to-end/ui/12-settings.js
tests/pageobjects/login.page.js
+1
-0
1 addition, 0 deletions
tests/pageobjects/login.page.js
with
71 additions
and
2 deletions
tests/end-to-end/ui/12-settings.js
+
70
−
2
View file @
b47fd838
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
/* globals expect */
/* globals expect */
/* eslint no-unused-vars: 0 */
/* eslint no-unused-vars: 0 */
import
loginPage
from
'
../../pageobjects/login.page
'
;
import
supertest
from
'
supertest
'
;
import
supertest
from
'
supertest
'
;
const
request
=
supertest
(
'
http://localhost:3000
'
);
const
request
=
supertest
(
'
http://localhost:3000
'
);
const
prefix
=
'
/api/v1/
'
;
const
prefix
=
'
/api/v1/
'
;
...
@@ -9,9 +10,10 @@ const prefix = '/api/v1/';
...
@@ -9,9 +10,10 @@ const prefix = '/api/v1/';
import
flexTab
from
'
../../pageobjects/flex-tab.page
'
;
import
flexTab
from
'
../../pageobjects/flex-tab.page
'
;
import
mainContent
from
'
../../pageobjects/main-content.page
'
;
import
mainContent
from
'
../../pageobjects/main-content.page
'
;
import
sideNav
from
'
../../pageobjects/side-nav.page
'
;
import
sideNav
from
'
../../pageobjects/side-nav.page
'
;
import
admin
from
'
../../pageobjects/administration.page
'
;
//test data imports
//test data imports
import
{
checkIfUserIsValid
}
from
'
../../data/checks
'
;
import
{
checkIfUserIsValid
,
checkIfUserIsAdmin
}
from
'
../../data/checks
'
;
import
{
targetUser
,
imgURL
}
from
'
../../data/interactions.js
'
;
import
{
targetUser
,
imgURL
}
from
'
../../data/interactions.js
'
;
import
{
adminUsername
,
adminEmail
,
adminPassword
,
username
,
email
,
password
}
from
'
../../data/user.js
'
;
import
{
adminUsername
,
adminEmail
,
adminPassword
,
username
,
email
,
password
}
from
'
../../data/user.js
'
;
...
@@ -42,7 +44,7 @@ var settingValue = {
...
@@ -42,7 +44,7 @@ var settingValue = {
value
:
undefined
value
:
undefined
};
};
describe
(
'
Changing settings via api
'
,
()
=>
{
describe
.
only
(
'
Changing settings via api
'
,
()
=>
{
before
((
done
)
=>
{
before
((
done
)
=>
{
checkIfUserIsValid
(
username
,
email
,
password
);
checkIfUserIsValid
(
username
,
email
,
password
);
sideNav
.
spotlightSearch
.
waitForVisible
(
10000
);
sideNav
.
spotlightSearch
.
waitForVisible
(
10000
);
...
@@ -420,5 +422,71 @@ describe('Changing settings via api', () => {
...
@@ -420,5 +422,71 @@ describe('Changing settings via api', () => {
});
});
});
});
});
});
describe
(
'
Manually Approve New Users
'
,
()
=>
{
before
(()
=>
{
sideNav
.
accountBoxUserName
.
waitForVisible
(
5000
);
sideNav
.
accountBoxUserName
.
click
();
sideNav
.
logout
.
waitForVisible
(
5000
);
sideNav
.
logout
.
click
();
loginPage
.
open
();
});
it
(
'
should change the Manually Approve New Users via api
'
,
(
done
)
=>
{
request
.
post
(
api
(
'
settings/Accounts_ManuallyApproveNewUsers
'
))
.
set
(
credentials
)
.
send
({
'
value
'
:
true
})
.
expect
(
'
Content-Type
'
,
'
application/json
'
)
.
expect
(
200
)
.
expect
((
res
)
=>
{
expect
(
res
.
body
).
to
.
have
.
property
(
'
success
'
,
true
);
})
.
end
(
done
);
});
it
(
'
register the user
'
,
()
=>
{
loginPage
.
registerButton
.
waitForVisible
(
5000
);
loginPage
.
registerButton
.
click
();
loginPage
.
nameField
.
waitForVisible
(
5000
);
loginPage
.
nameField
.
setValue
(
'
setting
'
+
username
);
loginPage
.
emailField
.
setValue
(
'
setting
'
+
email
);
loginPage
.
passwordField
.
setValue
(
password
);
loginPage
.
confirmPasswordField
.
setValue
(
password
);
loginPage
.
submit
();
loginPage
.
registrationSucceededCard
.
waitForVisible
(
5000
);
loginPage
.
registrationSucceededCard
.
getText
().
should
.
equal
(
'
Registration Succeeded
'
);
loginPage
.
backToLoginButton
.
click
();
});
it
(
'
login as admin and go to users
'
,
()
=>
{
checkIfUserIsAdmin
(
adminUsername
,
adminEmail
,
adminPassword
);
sideNav
.
accountBoxUserName
.
click
();
sideNav
.
admin
.
waitForVisible
(
5000
);
sideNav
.
admin
.
click
();
admin
.
usersLink
.
waitForVisible
(
5000
);
admin
.
usersLink
.
click
();
admin
.
usersFilter
.
waitForVisible
(
5000
);
});
it
(
'
search the user
'
,
()
=>
{
admin
.
usersFilter
.
click
();
admin
.
usersFilter
.
setValue
(
'
setting
'
+
username
);
});
it
(
'
should change the Manually Approve New Users via api
'
,
(
done
)
=>
{
request
.
post
(
api
(
'
settings/Accounts_ManuallyApproveNewUsers
'
))
.
set
(
credentials
)
.
send
({
'
value
'
:
false
})
.
expect
(
'
Content-Type
'
,
'
application/json
'
)
.
expect
(
200
)
.
expect
((
res
)
=>
{
expect
(
res
.
body
).
to
.
have
.
property
(
'
success
'
,
true
);
})
.
end
(
done
);
});
});
});
});
This diff is collapsed.
Click to expand it.
tests/pageobjects/login.page.js
+
1
−
0
View file @
b47fd838
...
@@ -18,6 +18,7 @@ class LoginPage extends Page {
...
@@ -18,6 +18,7 @@ class LoginPage extends Page {
get
emailInvalidText
()
{
return
browser
.
element
(
'
[name=email]~.input-error
'
);
}
get
emailInvalidText
()
{
return
browser
.
element
(
'
[name=email]~.input-error
'
);
}
get
passwordInvalidText
()
{
return
browser
.
element
(
'
[name=pass]~.input-error
'
);
}
get
passwordInvalidText
()
{
return
browser
.
element
(
'
[name=pass]~.input-error
'
);
}
get
confirmPasswordInvalidText
()
{
return
browser
.
element
(
'
[name=confirm-pass]~.input-error
'
);
}
get
confirmPasswordInvalidText
()
{
return
browser
.
element
(
'
[name=confirm-pass]~.input-error
'
);
}
get
registrationSucceededCard
()
{
return
browser
.
element
(
'
#login-card h2
'
);
}
open
()
{
open
()
{
super
.
open
(
''
);
super
.
open
(
''
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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