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
6173aace
Commit
6173aace
authored
Jul 01, 2020
by
Sanad Liaquat (Personal)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add step for failed login
parent
83b582a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb
...eatures/browser_ui/1_manage/login/log_in_with_2fa_spec.rb
+10
-1
No files found.
qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb
View file @
6173aace
...
...
@@ -34,13 +34,20 @@ module QA
group
.
add_member
(
developer_user
,
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
it
'allows enforcing
and logging in with 2fa
'
do
it
'allows enforcing
2FA via UI and logging in with 2FA
'
do
enforce_two_factor_authentication_on_group
(
group
)
enable_two_factor_authentication_for_user
(
developer_user
)
Flow
::
Login
.
sign_in
(
as:
developer_user
,
skip_page_validation:
true
)
Page
::
Main
::
TwoFactorAuth
.
perform
do
|
two_fa_auth
|
two_fa_auth
.
set_2fa_code
(
'000000'
)
two_fa_auth
.
click_verify_code_button
end
expect
(
page
).
to
have_text
(
'Invalid two-factor code'
)
Page
::
Main
::
TwoFactorAuth
.
perform
do
|
two_fa_auth
|
two_fa_auth
.
set_2fa_code
(
@otp
.
fresh_otp
)
two_fa_auth
.
click_verify_code_button
...
...
@@ -65,6 +72,8 @@ module QA
@owner_api_client
||=
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
owner_user
)
end
# We are intentionally using the UI to enforce 2FA to exercise the flow with UI.
# Any future tests should use the API for this purpose.
def
enforce_two_factor_authentication_on_group
(
group
)
Flow
::
Login
.
while_signed_in
(
as:
owner_user
)
do
group
.
visit!
...
...
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