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
0699f7a7
Commit
0699f7a7
authored
Dec 30, 2020
by
Sanad Liaquat (Personal)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stablize register spec
parent
ad7bbd28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
38 deletions
+49
-38
qa/qa/flow/sign_up.rb
qa/qa/flow/sign_up.rb
+23
-25
qa/qa/page/base.rb
qa/qa/page/base.rb
+4
-1
qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
...specs/features/browser_ui/1_manage/login/register_spec.rb
+22
-12
No files found.
qa/qa/flow/sign_up.rb
View file @
0699f7a7
...
...
@@ -6,9 +6,8 @@ module QA
module_function
def
sign_up!
(
user
)
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
Page
::
Main
::
Login
.
perform
(
&
:switch_to_register_page
)
success
=
Support
::
Retrier
.
retry_until
(
raise_on_failure:
false
)
do
Page
::
Registration
::
SignUp
.
perform
do
|
sign_up
|
sign_up
.
fill_new_user_first_name_field
(
user
.
first_name
)
sign_up
.
fill_new_user_last_name_field
(
user
.
last_name
)
...
...
@@ -28,14 +27,13 @@ module QA
Page
::
Registration
::
Welcome
.
perform
(
&
:click_get_started_button_if_available
)
if
user
.
expect_fabrication_success
success
=
if
user
.
expect_fabrication_success
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
else
Page
::
Main
::
Menu
.
perform
(
&
:not_signed_in?
)
end
end
raise
"Failed
to register the user
"
unless
success
raise
"Failed
user registration attempt. Registration was expected to
#{
user
.
expect_fabrication_success
?
'succeed'
:
'fail'
}
but
#{
success
?
'succeeded'
:
'failed'
}
.
"
unless
success
end
def
disable_sign_ups
...
...
qa/qa/page/base.rb
View file @
0699f7a7
...
...
@@ -135,8 +135,11 @@ module QA
def
check_element
(
name
)
retry_until
(
sleep_interval:
1
)
do
find_element
(
name
).
set
(
true
)
checked
=
find_element
(
name
).
checked?
find_element
(
name
).
checked?
QA
::
Runtime
::
Logger
.
debug
(
checked
?
"
#{
name
}
was checked"
:
"
#{
name
}
was not checked"
)
checked
end
end
...
...
qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
View file @
0699f7a7
...
...
@@ -98,10 +98,12 @@ module QA
before
do
enable_require_admin_approval_after_user_signup_via_ui
Support
::
Retrier
.
retry_on_exception
do
@user
=
Resource
::
User
.
fabricate_via_browser_ui!
do
|
user
|
user
.
expect_fabrication_success
=
false
end
end
end
it
'allows user login after approval'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1076'
do
expect
(
page
).
to
have_text
(
signed_up_waiting_approval_text
)
...
...
@@ -148,15 +150,20 @@ module QA
end
def
set_require_admin_approval_after_user_signup_via_api
(
enable_or_disable
)
return
if
Runtime
::
ApplicationSettings
.
get_application_settings
[
:require_admin_approval_after_user_signup
]
==
enable_or_disable
return
if
get_require_admin_approval_after_user_signup_via_api
==
enable_or_disable
Runtime
::
ApplicationSettings
.
set_application_settings
(
require_admin_approval_after_user_signup:
enable_or_disable
)
sleep
10
# It takes a moment for the setting to come into effect
end
def
get_require_admin_approval_after_user_signup_via_api
Runtime
::
ApplicationSettings
.
get_application_settings
[
:require_admin_approval_after_user_signup
]
end
def
enable_require_admin_approval_after_user_signup_via_ui
unless
Runtime
::
ApplicationSettings
.
get_application_settings
[
:require_admin_approval_after_user_signup
]
unless
get_require_admin_approval_after_user_signup_via_api
QA
::
Support
::
Retrier
.
retry_until
do
Flow
::
Login
.
while_signed_in_as_admin
do
Page
::
Main
::
Menu
.
perform
(
&
:go_to_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_general_settings
)
...
...
@@ -167,7 +174,10 @@ module QA
end
end
sleep
10
# It takes a moment for the setting to come into effect
sleep
15
# It takes a moment for the setting to come into effect
get_require_admin_approval_after_user_signup_via_api
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