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
0fea04b8
Commit
0fea04b8
authored
Nov 30, 2021
by
Chloe Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e tests for CI minutes purchase
parent
f3915fd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
24 deletions
+100
-24
qa/lib/gitlab/page/group/settings/usage_quotas.rb
qa/lib/gitlab/page/group/settings/usage_quotas.rb
+2
-0
qa/qa/specs/features/ee/browser_ui/fulfillment/purchase/purchase_ci_spec.rb
...es/ee/browser_ui/fulfillment/purchase/purchase_ci_spec.rb
+98
-24
No files found.
qa/lib/gitlab/page/group/settings/usage_quotas.rb
View file @
0fea04b8
...
...
@@ -10,7 +10,9 @@ module Gitlab
link
:buy_ci_minutes
,
text:
'Buy additional minutes'
link
:buy_storage
,
text:
/Purchase more storage/
strong
:additional_minutes
,
text:
'Additional minutes'
strong
:plan_minutes
,
text:
'Current period usage'
div
:purchased_usage
,
'data-testid'
:
'purchased-usage'
div
(
:plan_minutes_usage
)
{
plan_minutes_element
.
following_sibling
.
span
}
div
(
:additional_minutes_usage
)
{
additional_minutes_element
.
following_sibling
.
span
}
div
:ci_purchase_successful_alert
,
text:
/You have successfully purchased CI minutes/
div
:storage_purchase_successful_alert
,
text:
/You have successfully purchased a storage/
...
...
qa/qa/specs/features/ee/browser_ui/fulfillment/purchase/purchase_ci_spec.rb
View file @
0fea04b8
...
...
@@ -38,12 +38,85 @@ module QA
group
.
visit!
end
after
do
|
example
|
after
do
user
.
remove_via_api!
group
.
remove_via_api!
unless
example
.
exception
end
it
'adds additional minutes to group namespace'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2260'
do
context
'without active subscription'
do
after
do
group
.
remove_via_api!
end
it
'adds additional minutes to group namespace'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2260'
do
purchase_ci_minutes
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
expected_minutes
=
CI_MINUTES
[
:ci_minutes
]
*
purchase_quantity
expect
{
usage_quota
.
ci_purchase_successful_alert?
}.
to
eventually_be_truthy
.
within
(
max_duration:
60
,
max_attempts:
30
)
expect
{
usage_quota
.
additional_minutes?
}.
to
eventually_be_truthy
.
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
expect
(
usage_quota
.
additional_limits
).
to
eq
(
expected_minutes
.
to_s
)
end
end
end
context
'with an active subscription'
do
before
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
|
new_subscription
.
continue_to_billing
fill_in_customer_info
fill_in_payment_info
new_subscription
.
confirm_purchase
end
end
it
'adds additional minutes to group namespace'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2430'
do
purchase_ci_minutes
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
expected_minutes
=
CI_MINUTES
[
:ci_minutes
]
*
purchase_quantity
plan_limits
=
ULTIMATE
[
:ci_minutes
]
expect
{
usage_quota
.
ci_purchase_successful_alert?
}.
to
eventually_be_truthy
.
within
(
max_duration:
60
,
max_attempts:
30
)
expect
{
usage_quota
.
additional_minutes?
}.
to
eventually_be_truthy
.
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
aggregate_failures
do
expect
(
usage_quota
.
additional_limits
).
to
eq
(
expected_minutes
.
to_s
)
expect
(
usage_quota
.
plan_minutes_limits
).
to
eq
(
plan_limits
.
to_s
)
end
end
end
end
context
'with existing CI minutes packs'
do
before
do
purchase_ci_minutes
end
after
do
group
.
remove_via_api!
end
it
'adds additional minutes to group namespace'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2431'
do
purchase_ci_minutes
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
expected_minutes
=
CI_MINUTES
[
:ci_minutes
]
*
purchase_quantity
*
2
expect
{
usage_quota
.
ci_purchase_successful_alert?
}.
to
eventually_be_truthy
.
within
(
max_duration:
60
,
max_attempts:
30
)
expect
{
usage_quota
.
additional_minutes?
}.
to
eventually_be_truthy
.
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
expect
(
usage_quota
.
additional_limits
).
to
eq
(
expected_minutes
.
to_s
)
end
end
end
private
def
purchase_ci_minutes
Page
::
Group
::
Menu
.
perform
(
&
:go_to_usage_quotas
)
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
usage_quota
.
pipeline_tab
...
...
@@ -54,34 +127,35 @@ module QA
ci_minutes
.
quantity
=
purchase_quantity
ci_minutes
.
continue_to_billing
ci_minutes
.
country
=
user_billing_info
[
:country
]
ci_minutes
.
street_address_1
=
user_billing_info
[
:address_1
]
ci_minutes
.
street_address_2
=
user_billing_info
[
:address_2
]
ci_minutes
.
city
=
user_billing_info
[
:city
]
ci_minutes
.
state
=
user_billing_info
[
:state
]
ci_minutes
.
zip_code
=
user_billing_info
[
:zip
]
ci_minutes
.
continue_to_payment
ci_minutes
.
name_on_card
=
credit_card_info
[
:name
]
ci_minutes
.
card_number
=
credit_card_info
[
:number
]
ci_minutes
.
expiration_month
=
credit_card_info
[
:month
]
ci_minutes
.
expiration_year
=
credit_card_info
[
:year
]
ci_minutes
.
cvv
=
credit_card_info
[
:cvv
]
ci_minutes
.
review_your_order
fill_in_customer_info
fill_in_payment_info
ci_minutes
.
confirm_purchase
end
end
Gitlab
::
Page
::
Group
::
Settings
::
UsageQuotas
.
perform
do
|
usage_quota
|
expected_minutes
=
CI_MINUTES
[
:ci_minutes
]
*
purchase_quantity
expect
{
usage_quota
.
ci_purchase_successful_alert?
}.
to
eventually_be_truthy
.
within
(
max_duration:
60
,
max_attempts:
30
)
expect
{
usage_quota
.
additional_minutes?
}.
to
eventually_be_truthy
.
within
(
max_duration:
120
,
max_attempts:
60
,
reload_page:
page
)
expect
(
usage_quota
.
additional_limits
).
to
eq
(
expected_minutes
.
to_s
)
def
fill_in_customer_info
Gitlab
::
Page
::
Subscriptions
::
New
.
perform
do
|
subscription
|
subscription
.
country
=
user_billing_info
[
:country
]
subscription
.
street_address_1
=
user_billing_info
[
:address_1
]
subscription
.
street_address_2
=
user_billing_info
[
:address_2
]
subscription
.
city
=
user_billing_info
[
:city
]
subscription
.
state
=
user_billing_info
[
:state
]
subscription
.
zip_code
=
user_billing_info
[
:zip
]
subscription
.
continue_to_payment
end
end
private
def
fill_in_payment_info
Gitlab
::
Page
::
Subscriptions
::
New
.
perform
do
|
subscription
|
subscription
.
name_on_card
=
credit_card_info
[
:name
]
subscription
.
card_number
=
credit_card_info
[
:number
]
subscription
.
expiration_month
=
credit_card_info
[
:month
]
subscription
.
expiration_year
=
credit_card_info
[
:year
]
subscription
.
cvv
=
credit_card_info
[
:cvv
]
subscription
.
review_your_order
end
end
def
credit_card_info
{
...
...
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