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
3f7bbbc6
Commit
3f7bbbc6
authored
Jan 12, 2022
by
Chloe Liu
Committed by
Dan Davison
Jan 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e tests for upgrade group subscription with existing add-on purchase
parent
6eb47ae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
26 deletions
+43
-26
qa/qa/specs/features/ee/browser_ui/11_fulfillment/purchase/upgrade_group_spec.rb
.../browser_ui/11_fulfillment/purchase/upgrade_group_spec.rb
+43
-26
No files found.
qa/qa/specs/features/ee/browser_ui/11_fulfillment/purchase/upgrade_group_spec.rb
View file @
3f7bbbc6
# frozen_string_literal: true
module
QA
include
QA
::
Support
::
Helpers
::
Plan
RSpec
.
describe
'Fulfillment'
,
:requires_admin
,
only:
{
subdomain: :staging
}
do
describe
'Purchase'
do
describe
'group plan'
do
...
...
@@ -35,32 +37,7 @@ module QA
end
it
'upgrades from free to ultimate'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347667'
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
Flow
::
Purchase
.
upgrade_subscription
(
plan:
ULTIMATE
)
Page
::
Group
::
Menu
.
perform
(
&
:go_to_billing
)
...
...
@@ -70,6 +47,46 @@ module QA
end
.
to
eventually_include
(
"
#{
group
.
path
}
is currently using the Ultimate SaaS Plan"
).
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
end
end
context
'with existing CI minutes pack'
do
let
(
:ci_minutes_quantity
)
{
5
}
before
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'ci-minutes'
project
.
group
=
group
project
.
initialize_with_readme
=
true
project
.
api_client
=
Runtime
::
API
::
Client
.
as_admin
end
Flow
::
Purchase
.
purchase_ci_minutes
(
quantity:
ci_minutes_quantity
)
end
it
'upgrades from free to premium with correct CI minutes'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349085'
do
Flow
::
Purchase
.
upgrade_subscription
(
plan:
PREMIUM
)
expected_minutes
=
CI_MINUTES
[
:ci_minutes
]
*
ci_minutes_quantity
plan_limits
=
PREMIUM
[
:ci_minutes
]
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
.
path
}
is currently using the Premium SaaS Plan"
).
within
(
max_duration:
120
,
max_attempts:
60
,
sleep_interval:
2
,
reload_page:
page
)
end
Page
::
Group
::
Menu
.
perform
(
&
:go_to_usage_quotas
)
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
usage_quota
.
pipeline_tab
expect
{
usage_quota
.
additional_ci_minutes?
}.
to
eventually_be_truthy
.
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
aggregate_failures
do
expect
(
usage_quota
.
additional_ci_limits
).
to
eq
(
expected_minutes
.
to_s
)
expect
(
usage_quota
.
plan_ci_limits
).
to
eq
(
plan_limits
.
to_s
)
end
end
end
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