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
25fa866d
Commit
25fa866d
authored
Jul 27, 2021
by
ddavison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add upgrade_group_spec.rb and author Chemlab lib
Add Chemlab library for GitLab
parent
e13a197c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
963 additions
and
2 deletions
+963
-2
ee/app/views/shared/billings/_billing_plan.html.haml
ee/app/views/shared/billings/_billing_plan.html.haml
+1
-1
qa/chemlab-library-gitlab.gemspec
qa/chemlab-library-gitlab.gemspec
+22
-0
qa/lib/gitlab.rb
qa/lib/gitlab.rb
+20
-0
qa/lib/gitlab/page/group/settings/billing.rb
qa/lib/gitlab/page/group/settings/billing.rb
+19
-0
qa/lib/gitlab/page/group/settings/billing.stub.rb
qa/lib/gitlab/page/group/settings/billing.stub.rb
+107
-0
qa/lib/gitlab/page/main/login.rb
qa/lib/gitlab/page/main/login.rb
+22
-0
qa/lib/gitlab/page/main/login.stub.rb
qa/lib/gitlab/page/main/login.stub.rb
+101
-0
qa/lib/gitlab/page/subscriptions/new.rb
qa/lib/gitlab/page/subscriptions/new.rb
+41
-0
qa/lib/gitlab/page/subscriptions/new.stub.rb
qa/lib/gitlab/page/subscriptions/new.stub.rb
+545
-0
qa/qa.rb
qa/qa.rb
+2
-0
qa/qa/specs/features/ee/browser_ui/fulfillment/purchase/upgrade_group_spec.rb
.../ee/browser_ui/fulfillment/purchase/upgrade_group_spec.rb
+80
-0
qa/spec/support/matchers/eventually_matcher.rb
qa/spec/support/matchers/eventually_matcher.rb
+3
-1
No files found.
ee/app/views/shared/billings/_billing_plan.html.haml
View file @
25fa866d
...
...
@@ -72,4 +72,4 @@
-
if
show_contact_sales_button
=
link_to
s_
(
'BillingPlan|Contact sales'
),
"
#{
contact_sales_url
}
?test=inappcontactsales
#{
plan
.
code
}
"
,
class:
[
"btn gl-button"
,
show_upgrade_button
?
"btn-success-secondary"
:
"btn-success"
],
data:
{
**
experiment_tracking_data_for_button_click
(
'contact_sales'
)
}
-
if
show_upgrade_button
=
link_to
upgrade_button_text
,
plan_purchase_or_upgrade_url
(
namespace
,
plan
),
class:
"
#{
upgrade_button_classes
}
billing-cta-purchase
#{
cta_class
}
gl-ml-3"
,
data:
{
**
experiment_tracking_data_for_button_click
(
'upgrade'
)
}
=
link_to
upgrade_button_text
,
plan_purchase_or_upgrade_url
(
namespace
,
plan
),
class:
"
#{
upgrade_button_classes
}
billing-cta-purchase
#{
cta_class
}
gl-ml-3"
,
data:
{
**
experiment_tracking_data_for_button_click
(
'upgrade'
)
,
qa_selector:
"upgrade_to_
#{
plan
.
code
}
"
}
qa/chemlab-library-gitlab.gemspec
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
$:
.
unshift
(
File
.
expand_path
(
'lib'
,
__dir__
))
Gem
::
Specification
.
new
do
|
spec
|
spec
.
name
=
'chemlab-library-gitlab'
spec
.
version
=
'0.1.1'
spec
.
authors
=
[
'GitLab Quality'
]
spec
.
email
=
[
'quality@gitlab.com'
]
spec
.
required_ruby_version
=
'>= 2.5'
# rubocop:disable Gemspec/RequiredRubyVersion
spec
.
summary
=
'Chemlab Page Libraries for GitLab'
spec
.
homepage
=
'https://gitlab.com/'
spec
.
license
=
'MIT'
spec
.
files
=
`git ls-files -- lib/*`
.
split
(
"
\n
"
)
spec
.
require_paths
=
[
'lib'
]
spec
.
add_runtime_dependency
'chemlab'
,
'~> 0.7'
end
qa/lib/gitlab.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
# Chemlab Page Libraries for GitLab
module
Gitlab
module
Page
module
Main
autoload
:Login
,
'gitlab/page/main/login'
end
module
Subscriptions
autoload
:New
,
'gitlab/page/subscriptions/new'
end
module
Group
module
Settings
autoload
:Billing
,
'gitlab/page/group/settings/billing'
end
end
end
end
qa/
qa
/page/group/settings/billing.rb
→
qa/
lib/gitlab
/page/group/settings/billing.rb
View file @
25fa866d
# frozen_string_literal: true
module
QA
module
Gitlab
module
Page
module
Group
module
Settings
class
Billing
<
Chemlab
::
Page
# TODO: Supplant with data-qa-selectors
h4
:billing_plan_header
,
css:
'div.billing-plan-header h4'
link
:start_your_free_trial
link
:upgrade_to_premium
,
css:
'[data-testid="plan-card-premium"] a.billing-cta-purchase-new'
link
:upgrade_to_ultimate
,
css:
'[data-testid="plan-card-ultimate"] a.billing-cta-purchase-new'
end
end
end
...
...
qa/lib/gitlab/page/group/settings/billing.stub.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
Gitlab
module
Page
module
Group
module
Settings
module
Billing
# @note Defined as +h4 :billing_plan_header+
# @return [String] The text content or value of +billing_plan_header+
def
billing_plan_header
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing.billing_plan_header_element).to exist
# end
# @return [Watir::H4] The raw +H4+ element
def
billing_plan_header_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing).to be_billing_plan_header
# end
# @return [Boolean] true if the +billing_plan_header+ element is present on the page
def
billing_plan_header?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +link :start_your_free_trial+
# Clicks +start_your_free_trial+
def
start_your_free_trial
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing.start_your_free_trial_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def
start_your_free_trial_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing).to be_start_your_free_trial
# end
# @return [Boolean] true if the +start_your_free_trial+ element is present on the page
def
start_your_free_trial?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +link :upgrade_to_premium+
# Clicks +upgrade_to_premium+
def
upgrade_to_premium
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing.upgrade_to_premium_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def
upgrade_to_premium_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing).to be_upgrade_to_premium
# end
# @return [Boolean] true if the +upgrade_to_premium+ element is present on the page
def
upgrade_to_premium?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +link :upgrade_to_ultimate+
# Clicks +upgrade_to_ultimate+
def
upgrade_to_ultimate
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing.upgrade_to_ultimate_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def
upgrade_to_ultimate_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Group::Settings::Billing.perform do |billing|
# expect(billing).to be_upgrade_to_ultimate
# end
# @return [Boolean] true if the +upgrade_to_ultimate+ element is present on the page
def
upgrade_to_ultimate?
# This is a stub, used for indexing. The method is dynamically generated.
end
end
end
end
end
end
qa/lib/gitlab/page/main/login.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
Gitlab
module
Page
module
Main
class
Login
<
Chemlab
::
Page
path
'/users/sign_in'
text_field
:login_field
text_field
:password_field
button
:sign_in_button
def
sign_in_as
(
username
:,
password
:)
self
.
login_field
=
username
self
.
password_field
=
password
sign_in_button
end
end
end
end
end
qa/lib/gitlab/page/main/login.stub.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
Gitlab
module
Page
module
Main
module
Login
# @note Defined as +text_field :login_field+
# @return [String] The text content or value of +login_field+
def
login_field
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of login_field
# @example
# Gitlab::Page::Main::Login.perform do |login|
# login.login_field = 'value'
# end
# @param value [String] The value to set.
def
login_field
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login.login_field_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
login_field_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login).to be_login_field
# end
# @return [Boolean] true if the +login_field+ element is present on the page
def
login_field?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :password_field+
# @return [String] The text content or value of +password_field+
def
password_field
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of password_field
# @example
# Gitlab::Page::Main::Login.perform do |login|
# login.password_field = 'value'
# end
# @param value [String] The value to set.
def
password_field
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login.password_field_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
password_field_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login).to be_password_field
# end
# @return [Boolean] true if the +password_field+ element is present on the page
def
password_field?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +button :sign_in_button+
# Clicks +sign_in_button+
def
sign_in_button
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login.sign_in_button_element).to exist
# end
# @return [Watir::Button] The raw +Button+ element
def
sign_in_button_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Main::Login.perform do |login|
# expect(login).to be_sign_in_button
# end
# @return [Boolean] true if the +sign_in_button+ element is present on the page
def
sign_in_button?
# This is a stub, used for indexing. The method is dynamically generated.
end
end
end
end
end
qa/lib/gitlab/page/subscriptions/new.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
Gitlab
module
Page
module
Subscriptions
class
New
<
Chemlab
::
Page
path
'/subscriptions/new'
# Subscription Details
select
:plan_name
select
:group_name
text_field
:number_of_users
button
:continue_to_billing
,
text:
/Continue to billing/
# Billing address
select
:country
text_field
:street_address_1
text_field
:street_address_2
text_field
:city
select
:state
text_field
:zip_code
button
:continue_to_payment
,
text:
/Continue to payment/
# Payment method
# TODO: Revisit when https://gitlab.com/gitlab-org/quality/chemlab/-/issues/6 is closed
iframe
:payment_form
,
id:
'z_hppm_iframe'
text_field
(
:name_on_card
)
{
payment_form_element
.
text_field
(
id:
'input-creditCardHolderName'
)
}
text_field
(
:card_number
)
{
payment_form_element
.
text_field
(
id:
'input-creditCardNumber'
)
}
select
(
:expiration_month
)
{
payment_form_element
.
select
(
id:
'input-creditCardExpirationMonth'
)
}
select
(
:expiration_year
)
{
payment_form_element
.
select
(
id:
'input-creditCardExpirationYear'
)
}
text_field
(
:cvv
)
{
payment_form_element
.
text_field
(
id:
'input-cardSecurityCode'
)
}
link
(
:review_your_order
)
{
payment_form_element
.
link
(
text:
/Review your order/
)
}
# ENDTODO
# Confirmation
button
:confirm_purchase
,
text:
/Confirm purchase/
end
end
end
end
qa/lib/gitlab/page/subscriptions/new.stub.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
Gitlab
module
Page
module
Subscriptions
module
New
# @note Defined as +select :plan_name+
# @return [String] The text content or value of +plan_name+
def
plan_name
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.plan_name_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
plan_name_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_plan_name
# end
# @return [Boolean] true if the +plan_name+ element is present on the page
def
plan_name?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +select :group_name+
# @return [String] The text content or value of +group_name+
def
group_name
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.group_name_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
group_name_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_group_name
# end
# @return [Boolean] true if the +group_name+ element is present on the page
def
group_name?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :number_of_users+
# @return [String] The text content or value of +number_of_users+
def
number_of_users
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of number_of_users
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.number_of_users = 'value'
# end
# @param value [String] The value to set.
def
number_of_users
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.number_of_users_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
number_of_users_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_number_of_users
# end
# @return [Boolean] true if the +number_of_users+ element is present on the page
def
number_of_users?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +button :continue_to_billing+
# Clicks +continue_to_billing+
def
continue_to_billing
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.continue_to_billing_element).to exist
# end
# @return [Watir::Button] The raw +Button+ element
def
continue_to_billing_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_continue_to_billing
# end
# @return [Boolean] true if the +continue_to_billing+ element is present on the page
def
continue_to_billing?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +select :country+
# @return [String] The text content or value of +country+
def
country
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.country_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
country_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_country
# end
# @return [Boolean] true if the +country+ element is present on the page
def
country?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :street_address_1+
# @return [String] The text content or value of +street_address_1+
def
street_address_1
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of street_address_1
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.street_address_1 = 'value'
# end
# @param value [String] The value to set.
def
street_address_1
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.street_address_1_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
street_address_1_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_street_address_1
# end
# @return [Boolean] true if the +street_address_1+ element is present on the page
def
street_address_1?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :street_address_2+
# @return [String] The text content or value of +street_address_2+
def
street_address_2
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of street_address_2
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.street_address_2 = 'value'
# end
# @param value [String] The value to set.
def
street_address_2
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.street_address_2_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
street_address_2_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_street_address_2
# end
# @return [Boolean] true if the +street_address_2+ element is present on the page
def
street_address_2?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :city+
# @return [String] The text content or value of +city+
def
city
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of city
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.city = 'value'
# end
# @param value [String] The value to set.
def
city
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.city_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
city_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_city
# end
# @return [Boolean] true if the +city+ element is present on the page
def
city?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +select :state+
# @return [String] The text content or value of +state+
def
state
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.state_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
state_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_state
# end
# @return [Boolean] true if the +state+ element is present on the page
def
state?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :zip_code+
# @return [String] The text content or value of +zip_code+
def
zip_code
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of zip_code
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.zip_code = 'value'
# end
# @param value [String] The value to set.
def
zip_code
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.zip_code_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
zip_code_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_zip_code
# end
# @return [Boolean] true if the +zip_code+ element is present on the page
def
zip_code?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +button :continue_to_payment+
# Clicks +continue_to_payment+
def
continue_to_payment
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.continue_to_payment_element).to exist
# end
# @return [Watir::Button] The raw +Button+ element
def
continue_to_payment_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_continue_to_payment
# end
# @return [Boolean] true if the +continue_to_payment+ element is present on the page
def
continue_to_payment?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +iframe :payment_form+
# @return [String] The text content or value of +payment_form+
def
payment_form
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.payment_form_element).to exist
# end
# @return [Watir::Iframe] The raw +Iframe+ element
def
payment_form_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_payment_form
# end
# @return [Boolean] true if the +payment_form+ element is present on the page
def
payment_form?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :name_on_card+
# @return [String] The text content or value of +name_on_card+
def
name_on_card
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of name_on_card
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.name_on_card = 'value'
# end
# @param value [String] The value to set.
def
name_on_card
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.name_on_card_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
name_on_card_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_name_on_card
# end
# @return [Boolean] true if the +name_on_card+ element is present on the page
def
name_on_card?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :card_number+
# @return [String] The text content or value of +card_number+
def
card_number
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of card_number
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.card_number = 'value'
# end
# @param value [String] The value to set.
def
card_number
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.card_number_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
card_number_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_card_number
# end
# @return [Boolean] true if the +card_number+ element is present on the page
def
card_number?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +select :expiration_month+
# @return [String] The text content or value of +expiration_month+
def
expiration_month
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.expiration_month_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
expiration_month_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_expiration_month
# end
# @return [Boolean] true if the +expiration_month+ element is present on the page
def
expiration_month?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +select :expiration_year+
# @return [String] The text content or value of +expiration_year+
def
expiration_year
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.expiration_year_element).to exist
# end
# @return [Watir::Select] The raw +Select+ element
def
expiration_year_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_expiration_year
# end
# @return [Boolean] true if the +expiration_year+ element is present on the page
def
expiration_year?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +text_field :cvv+
# @return [String] The text content or value of +cvv+
def
cvv
# This is a stub, used for indexing. The method is dynamically generated.
end
# Set the value of cvv
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# new.cvv = 'value'
# end
# @param value [String] The value to set.
def
cvv
=
(
value
)
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.cvv_element).to exist
# end
# @return [Watir::TextField] The raw +TextField+ element
def
cvv_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_cvv
# end
# @return [Boolean] true if the +cvv+ element is present on the page
def
cvv?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +link :review_your_order+
# Clicks +review_your_order+
def
review_your_order
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.review_your_order_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def
review_your_order_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_review_your_order
# end
# @return [Boolean] true if the +review_your_order+ element is present on the page
def
review_your_order?
# This is a stub, used for indexing. The method is dynamically generated.
end
# @note Defined as +button :confirm_purchase+
# Clicks +confirm_purchase+
def
confirm_purchase
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new.confirm_purchase_element).to exist
# end
# @return [Watir::Button] The raw +Button+ element
def
confirm_purchase_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
# Gitlab::Page::Subscriptions::New.perform do |new|
# expect(new).to be_confirm_purchase
# end
# @return [Boolean] true if the +confirm_purchase+ element is present on the page
def
confirm_purchase?
# This is a stub, used for indexing. The method is dynamically generated.
end
end
end
end
end
qa/qa.rb
View file @
25fa866d
...
...
@@ -8,6 +8,8 @@ require_relative '../lib/gitlab'
require_relative
'../lib/gitlab/utils'
require_relative
'../config/initializers/0_inject_enterprise_edition_module'
require_relative
'lib/gitlab'
require
'chemlab'
module
QA
...
...
qa/qa/specs/features/ee/browser_ui/fulfillment/purchase/upgrade_group_spec.rb
0 → 100644
View file @
25fa866d
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Fulfillment'
,
:requires_admin
,
only:
{
subdomain: :staging
}
do
describe
'Purchase'
do
describe
'group plan'
do
let
(
:hash
)
{
SecureRandom
.
hex
(
4
)
}
let
(
:user
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
email
=
"gitlab-qa+
#{
hash
}
@gitlab.com"
user
.
api_client
=
Runtime
::
API
::
Client
.
as_admin
user
.
hard_delete_on_api_removal
=
true
end
end
# Normally we would delete the group, however we cannot remove this group
# after the test runs since GitLab will not allow deletion of a group
# that has a Subscription attached
let
(
:group
)
do
Resource
::
Sandbox
.
fabricate_via_api!
do
|
sandbox
|
sandbox
.
path
=
"gitlab-qa-group-
#{
hash
}
"
sandbox
.
api_client
=
Runtime
::
API
::
Client
.
as_admin
end
end
before
do
Runtime
::
Feature
.
enable
(
:top_level_group_creation_enabled
)
group
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
OWNER
)
Flow
::
Login
.
sign_in
(
as:
user
)
group
.
visit!
end
after
do
user
.
remove_via_api!
Runtime
::
Feature
.
disable
(
:top_level_group_creation_enabled
)
end
it
'upgrades from free to ultimate'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1863'
do
Page
::
Group
::
Menu
.
perform
(
&
:go_to_billing
)
Gitlab
::
Page
::
Group
::
Settings
::
Billing
.
perform
(
&
:upgrade_to_ultimate
)
Gitlab
::
Page
::
Subscriptions
::
New
.
perform
do
|
new_subscription
|
# Subscription details
new_subscription
.
continue_to_billing
# Billing information
new_subscription
.
country
=
'United States of America'
new_subscription
.
street_address_1
=
'QA Test Address 1'
new_subscription
.
city
=
'San Francisco'
new_subscription
.
state
=
'California'
new_subscription
.
zip_code
=
'94102'
new_subscription
.
continue_to_payment
# Payment method
new_subscription
.
name_on_card
=
'QA Test User'
new_subscription
.
card_number
=
'4111 1111 1111 1111'
new_subscription
.
expiration_month
=
'01'
new_subscription
.
expiration_year
=
'2030'
new_subscription
.
cvv
=
'789'
new_subscription
.
review_your_order
# Confirm
new_subscription
.
confirm_purchase
end
Page
::
Group
::
Menu
.
perform
(
&
:go_to_billing
)
Gitlab
::
Page
::
Group
::
Settings
::
Billing
.
perform
do
|
billing
|
expect
do
billing
.
billing_plan_header
end
.
to
eventually_include
(
"
#{
group
.
name
}
is currently using the Ultimate SaaS Plan"
).
within
(
duration:
120
,
attempts:
60
,
reload_page:
page
)
end
end
end
end
end
end
qa/spec/support/matchers/eventually_matcher.rb
View file @
25fa866d
...
...
@@ -25,6 +25,7 @@ module Matchers
@duration
=
options
[
:duration
]
@attempts
=
options
[
:attempts
]
@interval
=
options
[
:interval
]
@reload_page
=
options
[
:reload_page
]
end
def
supports_block_expectations?
...
...
@@ -59,7 +60,8 @@ module Matchers
QA
::
Support
::
Retrier
.
retry_until
(
max_attempts:
@attempts
,
max_duration:
@duration
,
sleep_interval:
@interval
||
0.5
sleep_interval:
@interval
||
0.5
,
reload_page:
@reload_page
)
do
QA
::
Runtime
::
Logger
.
debug
(
"evaluating expectation, attempt:
#{
attempt
+=
1
}
"
)
...
...
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