Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1ff7ee6c
Commit
1ff7ee6c
authored
Apr 27, 2021
by
Andrejs Cunskis
Committed by
Mike Greiling
Apr 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update set up new password handling in e2e tests
parent
d1c676e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
app/views/profiles/passwords/new.html.haml
app/views/profiles/passwords/new.html.haml
+4
-4
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+9
-11
qa/qa/page/profile/password.rb
qa/qa/page/profile/password.rb
+14
-0
No files found.
app/views/profiles/passwords/new.html.haml
View file @
1ff7ee6c
...
...
@@ -16,16 +16,16 @@
.col-sm-2.col-form-label
=
f
.
label
:current_password
,
_
(
'Current password'
)
.col-sm-10
=
f
.
password_field
:current_password
,
required:
true
,
class:
'form-control gl-form-input'
=
f
.
password_field
:current_password
,
required:
true
,
class:
'form-control gl-form-input'
,
data:
{
qa_selector:
'current_password_field'
}
.form-group.row
.col-sm-2.col-form-label
=
f
.
label
:password
,
_
(
'New password'
)
.col-sm-10
=
f
.
password_field
:password
,
required:
true
,
class:
'form-control gl-form-input'
=
f
.
password_field
:password
,
required:
true
,
class:
'form-control gl-form-input'
,
data:
{
qa_selector:
'new_password_field'
}
.form-group.row
.col-sm-2.col-form-label
=
f
.
label
:password_confirmation
,
_
(
'Password confirmation'
)
.col-sm-10
=
f
.
password_field
:password_confirmation
,
required:
true
,
class:
'form-control gl-form-input'
=
f
.
password_field
:password_confirmation
,
required:
true
,
class:
'form-control gl-form-input'
,
data:
{
qa_selector:
'confirm_password_field'
}
.form-actions
=
f
.
submit
_
(
'Set new password'
),
class:
'gl-button btn btn-confirm'
=
f
.
submit
_
(
'Set new password'
),
class:
'gl-button btn btn-confirm'
,
data:
{
qa_selector:
'set_new_password_button'
}
qa/qa/page/main/login.rb
View file @
1ff7ee6c
...
...
@@ -50,15 +50,17 @@ module QA
return
if
Page
::
Main
::
Menu
.
perform
(
&
:signed_in?
)
using_wait_time
0
do
set_initial_password_if_present
raise
'If an LDAP user is provided, it must be used for sign-in'
,
QA
::
Resource
::
User
::
InvalidUserError
if
Runtime
::
User
.
ldap_user?
&&
user
&&
user
.
username
!=
Runtime
::
User
.
ldap_username
if
Runtime
::
User
.
ldap_user?
&&
user
&&
user
.
username
!=
Runtime
::
User
.
ldap_username
raise
'If an LDAP user is provided, it must be used for sign-in'
,
QA
::
Resource
::
User
::
InvalidUserError
end
if
Runtime
::
User
.
ldap_user?
sign_in_using_ldap_credentials
(
user:
user
||
Runtime
::
User
)
else
sign_in_using_gitlab_credentials
(
user:
user
||
Runtime
::
User
,
skip_page_validation:
skip_page_validation
)
end
set_initial_password_if_present
end
end
...
...
@@ -69,8 +71,6 @@ module QA
end
using_wait_time
0
do
set_initial_password_if_present
sign_in_using_gitlab_credentials
(
user:
admin
)
end
...
...
@@ -81,8 +81,6 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
using_wait_time
0
do
set_initial_password_if_present
switch_to_ldap_tab
fill_element
:username_field
,
user
.
ldap_username
...
...
@@ -169,11 +167,11 @@ module QA
end
def
set_initial_password_if_present
return
unless
has_content?
(
'
Change your
password'
)
return
unless
has_content?
(
'
Set up new
password'
)
fill_element
:password_field
,
Runtime
::
User
.
password
fill_element
:password_confirmation_field
,
Runtime
::
User
.
password
click_element
:change_password_button
Profile
::
Password
.
perform
do
|
new_password_page
|
new_password_page
.
set_new_password
(
Runtime
::
User
.
password
,
Runtime
::
User
.
password
)
end
end
end
end
...
...
qa/qa/page/profile/password.rb
View file @
1ff7ee6c
...
...
@@ -11,12 +11,26 @@ module QA
element
:save_password_button
end
view
'app/views/profiles/passwords/new.html.haml'
do
element
:current_password_field
element
:new_password_field
element
:confirm_password_field
element
:set_new_password_button
end
def
update_password
(
new_password
,
current_password
)
find_element
(
:current_password_field
).
set
current_password
find_element
(
:new_password_field
).
set
new_password
find_element
(
:confirm_password_field
).
set
new_password
click_element
(
:save_password_button
)
end
def
set_new_password
(
new_password
,
current_password
)
fill_element
:current_password_field
,
current_password
fill_element
:new_password_field
,
new_password
fill_element
:confirm_password_field
,
new_password
click_element
:set_new_password_button
end
end
end
end
...
...
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