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
37c593c8
Commit
37c593c8
authored
Jan 11, 2022
by
Sanad Liaquat
Committed by
Andrew Fontaine
Jan 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user registration and user_registration_billing_spec e2e specs
parent
5dd91446
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
121 additions
and
70 deletions
+121
-70
app/views/registrations/welcome/show.html.haml
app/views/registrations/welcome/show.html.haml
+1
-1
ee/app/views/registrations/welcome/_setup_for_company.html.haml
.../views/registrations/welcome/_setup_for_company.html.haml
+1
-1
qa/lib/gitlab/page/main/welcome.rb
qa/lib/gitlab/page/main/welcome.rb
+0
-13
qa/lib/gitlab/page/main/welcome.stub.rb
qa/lib/gitlab/page/main/welcome.stub.rb
+0
-33
qa/qa/ee/page/registration/welcome.rb
qa/qa/ee/page/registration/welcome.rb
+14
-3
qa/qa/flow/sign_up.rb
qa/qa/flow/sign_up.rb
+4
-1
qa/qa/flow/user_onboarding.rb
qa/qa/flow/user_onboarding.rb
+19
-0
qa/qa/page/dashboard/welcome.rb
qa/qa/page/dashboard/welcome.rb
+4
-0
qa/qa/page/registration/sign_up.rb
qa/qa/page/registration/sign_up.rb
+0
-4
qa/qa/page/registration/welcome.rb
qa/qa/page/registration/welcome.rb
+17
-6
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+14
-0
qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
...specs/features/browser_ui/1_manage/login/register_spec.rb
+5
-4
qa/qa/specs/features/ee/browser_ui/11_fulfillment/purchase/user_registration_billing_spec.rb
...11_fulfillment/purchase/user_registration_billing_spec.rb
+2
-4
qa/spec/runtime/env_spec.rb
qa/spec/runtime/env_spec.rb
+40
-0
No files found.
app/views/registrations/welcome/show.html.haml
View file @
37c593c8
...
...
@@ -22,7 +22,7 @@
.row
.form-group.col-sm-12
=
f
.
label
:role
,
_
(
'Role'
),
class:
'label-bold'
=
f
.
select
:role
,
::
User
.
roles
.
keys
.
map
{
|
role
|
[
role
.
titleize
,
role
]
},
{
include_blank:
_
(
'Select a role'
)
},
class:
'form-control js-user-role-dropdown'
,
autofocus:
true
,
required:
true
=
f
.
select
:role
,
::
User
.
roles
.
keys
.
map
{
|
role
|
[
role
.
titleize
,
role
]
},
{
include_blank:
_
(
'Select a role'
)
},
class:
'form-control js-user-role-dropdown'
,
autofocus:
true
,
required:
true
,
data:
{
qa_selector:
'role_dropdown'
}
-
if
Feature
.
enabled?
(
:user_other_role_details
)
.row
.form-group.col-sm-12.js-other-role-group.hidden
...
...
ee/app/views/registrations/welcome/_setup_for_company.html.haml
View file @
37c593c8
...
...
@@ -8,7 +8,7 @@
=
f
.
label
:setup_for_company
,
setup_for_company_label_text
,
class:
'label-bold'
.gl-display-flex.gl-flex-direction-column.gl-lg-flex-direction-row
.gl-flex-grow-1
=
f
.
radio_button
:setup_for_company
,
true
,
class:
'js-setup-for-company'
,
required:
true
=
f
.
radio_button
:setup_for_company
,
true
,
class:
'js-setup-for-company'
,
required:
true
,
data:
{
qa_selector:
'setup_for_company_radio'
}
=
f
.
label
:setup_for_company
,
_
(
'My company or team'
),
class:
'normal'
,
value:
'true'
.gl-flex-grow-1
=
f
.
radio_button
:setup_for_company
,
false
,
class:
'js-setup-for-me'
,
required:
true
...
...
qa/lib/gitlab/page/main/welcome.rb
deleted
100644 → 0
View file @
5dd91446
# frozen_string_literal: true
module
Gitlab
module
Page
module
Main
class
Welcome
<
Chemlab
::
Page
path
'/users/sign_up/welcome'
button
:get_started_button
end
end
end
end
qa/lib/gitlab/page/main/welcome.stub.rb
deleted
100644 → 0
View file @
5dd91446
# frozen_string_literal: true
module
Gitlab
module
Page
module
Main
module
Welcome
# @note Defined as +button :get_started_button+
# Clicks +get_started_button+
def
get_started_button
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Welcome.perform do |welcome|
# expect(welcome.get_started_button_element).to exist
# end
# @return [Watir::Button] The raw +Button+ element
def
get_started_button_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Welcome.perform do |welcome|
# expect(welcome).to be_get_started_button
# end
# @return [Boolean] true if the +get_started_button+ element is present on the page
def
get_started_button?
# This is a stub, used for indexing. The method is dynamically generated.
end
end
end
end
end
qa/qa/ee/page/registration/welcome.rb
View file @
37c593c8
...
...
@@ -7,13 +7,24 @@ module QA
module
Welcome
extend
QA
::
Page
::
PageConcern
def
self
.
inclu
ded
(
base
)
def
self
.
prepen
ded
(
base
)
super
base
.
view
'ee/app/views/registrations/welcome/_button.html.haml'
do
element
:get_started_button
base
.
class_eval
do
view
'ee/app/views/registrations/welcome/_button.html.haml'
do
element
:get_started_button
end
view
'ee/app/views/registrations/welcome/_setup_for_company.html.haml'
do
element
:setup_for_company_radio
end
end
end
# setup_for_company_radio is only shown in development environment and .com
def
choose_setup_for_company_if_available
choose_element
(
:setup_for_company_radio
)
if
QA
::
Runtime
::
Env
.
running_on_dev_or_dot_com?
end
end
end
end
...
...
qa/qa/flow/sign_up.rb
View file @
37c593c8
...
...
@@ -26,9 +26,12 @@ module QA
sign_up
.
click_new_user_register_button
end
Page
::
Registration
::
Welcome
.
perform
(
&
:click_get_started_button_if_available
)
Flow
::
UserOnboarding
.
onboard_user
success
=
if
user
.
expect_fabrication_success
# In development env and .com the user is asked to create a group and a project which can be skipped for
# the purpose of signing up
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Dashboard
::
Welcome
)
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
else
Page
::
Main
::
Menu
.
perform
(
&
:not_signed_in?
)
...
...
qa/qa/flow/user_onboarding.rb
0 → 100644
View file @
37c593c8
# frozen_string_literal: true
module
QA
module
Flow
module
UserOnboarding
module_function
def
onboard_user
Page
::
Registration
::
Welcome
.
perform
do
|
welcome_page
|
if
welcome_page
.
has_get_started_button?
welcome_page
.
select_role
(
'Other'
)
welcome_page
.
choose_setup_for_company_if_available
welcome_page
.
click_get_started_button
end
end
end
end
end
end
qa/qa/page/dashboard/welcome.rb
View file @
37c593c8
...
...
@@ -11,6 +11,10 @@ module QA
def
has_welcome_title?
(
text
)
has_element?
(
:welcome_title_content
,
text:
text
)
end
def
self
.
path
'/'
end
end
end
end
...
...
qa/qa/page/registration/sign_up.rb
View file @
37c593c8
...
...
@@ -16,10 +16,6 @@ module QA
element
:new_user_username_field
end
view
'app/views/registrations/welcome/show.html.haml'
do
element
:get_started_button
end
def
fill_new_user_first_name_field
(
first_name
)
fill_element
:new_user_first_name_field
,
first_name
end
...
...
qa/qa/page/registration/welcome.rb
View file @
37c593c8
...
...
@@ -6,14 +6,25 @@ module QA
class
Welcome
<
Page
::
Base
view
'app/views/registrations/welcome/show.html.haml'
do
element
:get_started_button
element
:role_dropdown
end
def
click_get_started_button_if_available
if
has_element?
(
:get_started_button
)
Support
::
Retrier
.
retry_until
do
click_element
:get_started_button
has_no_element?
(
:get_started_button
)
end
def
has_get_started_button?
has_element?
(
:get_started_button
)
end
def
select_role
(
role
)
select_element
(
:role_dropdown
,
role
)
end
def
choose_setup_for_company_if_available
# Only implemented in EE
end
def
click_get_started_button
Support
::
Retrier
.
retry_until
do
click_element
:get_started_button
has_no_element?
(
:get_started_button
)
end
end
end
...
...
qa/qa/runtime/env.rb
View file @
37c593c8
...
...
@@ -90,6 +90,20 @@ module QA
enabled?
(
ENV
[
'ACCEPT_INSECURE_CERTS'
])
end
def
running_on_dot_com?
uri
=
URI
.
parse
(
Runtime
::
Scenario
.
gitlab_address
)
uri
.
host
.
include?
(
'.com'
)
end
def
running_on_dev?
uri
=
URI
.
parse
(
Runtime
::
Scenario
.
gitlab_address
)
uri
.
port
!=
80
&&
uri
.
port
!=
443
end
def
running_on_dev_or_dot_com?
running_on_dev?
||
running_on_dot_com?
end
def
running_in_ci?
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
]
end
...
...
qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
View file @
37c593c8
...
...
@@ -118,11 +118,12 @@ module QA
Flow
::
Login
.
sign_in
(
as:
@user
,
skip_page_validation:
true
)
Page
::
Registration
::
Welcome
.
perform
(
&
:click_get_started_button_if_available
)
Flow
::
UserOnboarding
.
onboard_user
Page
::
Main
::
Menu
.
perform
do
|
menu
|
expect
(
menu
).
to
have_personal_area
end
# In development env and .com the user is asked to create a group and a project which can be skipped for
# the purpose of this test
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Dashboard
::
Welcome
)
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
end
after
do
...
...
qa/qa/specs/features/ee/browser_ui/11_fulfillment/purchase/user_registration_billing_spec.rb
View file @
37c593c8
...
...
@@ -20,6 +20,7 @@ module QA
before
do
# Enable sign-ups
Runtime
::
ApplicationSettings
.
set_application_settings
(
signup_enabled:
true
)
Runtime
::
ApplicationSettings
.
set_application_settings
(
require_admin_approval_after_user_signup:
true
)
# Register the new user through the registration page
Gitlab
::
Page
::
Main
::
SignUp
.
perform
do
|
sign_up
|
...
...
@@ -27,10 +28,7 @@ module QA
sign_up
.
register_user
(
user
)
end
# Click the Get Started button on the welcome page if it presents itself
Gitlab
::
Page
::
Main
::
Welcome
.
perform
do
|
welcome
|
welcome
.
get_started_button
if
welcome
.
get_started_button?
end
Flow
::
UserOnboarding
.
onboard_user
end
after
do
...
...
qa/spec/runtime/env_spec.rb
View file @
37c593c8
...
...
@@ -83,6 +83,46 @@ RSpec.describe QA::Runtime::Env do
end
end
describe
'.running_on_dot_com?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:url
,
:result
)
do
'https://www.gitlab.com'
|
true
'https://staging.gitlab.com'
|
true
'http://www.gitlab.com'
|
true
'http://localhost:3000'
|
false
'http://localhost'
|
false
'http://gdk.test:3000'
|
false
end
with_them
do
before
do
QA
::
Runtime
::
Scenario
.
define
(
:gitlab_address
,
url
)
end
it
{
expect
(
described_class
.
running_on_dot_com?
).
to
eq
result
}
end
end
describe
'.running_on_dev?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:url
,
:result
)
do
'https://www.gitlab.com'
|
false
'http://localhost:3000'
|
true
'http://localhost'
|
false
'http://gdk.test:3000'
|
true
end
with_them
do
before
do
QA
::
Runtime
::
Scenario
.
define
(
:gitlab_address
,
url
)
end
it
{
expect
(
described_class
.
running_on_dev?
).
to
eq
result
}
end
end
describe
'.personal_access_token'
do
around
do
|
example
|
described_class
.
instance_variable_set
(
:@personal_access_token
,
nil
)
...
...
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