Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-29 21:12:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-29 21:12:42 +0300
commitfef5449973e2097fbedd92980d78dc4baf54afd6 (patch)
treefae2e4b1e9eb45e0e9b1da569721c5f8c1cea4ef /qa/lib
parentcee701c9641a4dfa508f9a1d913863a52ae67167 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/lib')
-rw-r--r--qa/lib/gitlab.rb1
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quota.stub.rb227
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.rb32
-rw-r--r--qa/lib/gitlab/page/subscriptions/new.rb7
4 files changed, 266 insertions, 1 deletions
diff --git a/qa/lib/gitlab.rb b/qa/lib/gitlab.rb
index 5b5c8805868..eecc6dce392 100644
--- a/qa/lib/gitlab.rb
+++ b/qa/lib/gitlab.rb
@@ -18,6 +18,7 @@ module Gitlab
module Group
module Settings
autoload :Billing, 'gitlab/page/group/settings/billing'
+ autoload :UsageQuotas, 'gitlab/page/group/settings/usage_quotas'
end
end
end
diff --git a/qa/lib/gitlab/page/group/settings/usage_quota.stub.rb b/qa/lib/gitlab/page/group/settings/usage_quota.stub.rb
new file mode 100644
index 00000000000..192e71e6c90
--- /dev/null
+++ b/qa/lib/gitlab/page/group/settings/usage_quota.stub.rb
@@ -0,0 +1,227 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Page
+ module Group
+ module Settings
+ module UsageQuota
+ # @note Defined as +link :pipeline_tab+
+ # Clicks +pipeline_tab+
+ def pipeline_tab
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.pipeline_tab_element).to exist
+ # end
+ # @return [Watir::Link] The raw +Link+ element
+ def pipeline_tab_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_pipeline_tab
+ # end
+ # @return [Boolean] true if the +pipeline_tab+ element is present on the page
+ def pipeline_tab?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +link :storage_tab+
+ # Clicks +storage_tab+
+ def storage_tab
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.storage_tab_element).to exist
+ # end
+ # @return [Watir::Link] The raw +Link+ element
+ def storage_tab_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_storage_tab
+ # end
+ # @return [Boolean] true if the +storage_tab+ element is present on the page
+ def storage_tab?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +link :buy_ci_minutes+
+ # Clicks +buy_ci_minutes+
+ def buy_ci_minutes
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.buy_ci_minutes_element).to exist
+ # end
+ # @return [Watir::Link] The raw +Link+ element
+ def buy_ci_minutes_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_buy_ci_minutes
+ # end
+ # @return [Boolean] true if the +buy_ci_minutes+ element is present on the page
+ def buy_ci_minutes?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +link :buy_storage+
+ # Clicks +buy_storage+
+ def buy_storage
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.buy_storage_element).to exist
+ # end
+ # @return [Watir::Link] The raw +Link+ element
+ def buy_storage_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_buy_storage
+ # end
+ # @return [Boolean] true if the +buy_storage+ element is present on the page
+ def buy_storage?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +strong :additional_minutes+
+ # @return [String] The text content or value of +additional_minutes+
+ def additional_minutes
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.additional_minutes_element).to exist
+ # end
+ # @return [Watir::Strong] The raw +Strong+ element
+ def additional_minutes_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_additional_minutes
+ # end
+ # @return [Boolean] true if the +additional_minutes+ element is present on the page
+ def additional_minutes?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +div :additional_minutes_usage+
+ # @return [String] The text content or value of +additional_minutes_usage+
+ def additional_minutes_usage
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.additional_minutes_usage_element).to exist
+ # end
+ # @return [Watir::Div] The raw +Div+ element
+ def additional_minutes_usage_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_additional_minutes_usage
+ # end
+ # @return [Boolean] true if the +additional_minutes_usage+ element is present on the page
+ def additional_minutes_usage?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +strong :plan_minutes+
+ # @return [String] The text content or value of +plan_minutes+
+ def plan_minutes
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.plan_minutes_element).to exist
+ # end
+ # @return [Watir::Strong] The raw +Strong+ element
+ def plan_minutes_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_plan_minutes
+ # end
+ # @return [Boolean] true if the +plan_minutes+ element is present on the page
+ def plan_minutes?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +div :plan_minutes_usage+
+ # @return [String] The text content or value of +plan_minutes_usage+
+ def plan_minutes_usage
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.plan_minutes_usage_element).to exist
+ # end
+ # @return [Watir::Div] The raw +Div+ element
+ def plan_minutes_usage_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_plan_minutes_usage
+ # end
+ # @return [Boolean] true if the +plan_minutes_usage+ element is present on the page
+ def plan_minutes_usage?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +div :purchase_successful_alert+
+ # @return [String] The text content or value of +purchase_successful_alert+
+ def purchase_successful_alert
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota.purchase_successful_alert_element).to exist
+ # end
+ # @return [Watir::Div] The raw +Div+ element
+ def purchase_successful_alert_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
+ # expect(usage_quota).to be_purchase_successful_alert
+ # end
+ # @return [Boolean] true if the +purchase_successful_alert+ element is present on the page
+ def purchase_successful_alert?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
new file mode 100644
index 00000000000..9686c9c021c
--- /dev/null
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Page
+ module Group
+ module Settings
+ class UsageQuotas < Chemlab::Page
+ link :pipeline_tab, id: 'pipelines-quota'
+ link :storage_tab, id: 'storage-quota'
+ link :buy_ci_minutes, text: 'Buy additional minutes'
+ link :buy_storage, text: /Purchase more storage/
+ strong :additional_minutes, text: 'Additional minutes'
+ div(:additional_minutes_usage) { additional_minutes_element.following_sibling.span }
+ div :purchase_successful_alert, text: /You have successfully purchased CI minutes/
+
+ def plan_minutes_limits
+ plan_minutes_usage[%r{([^/ ]+)$}]
+ end
+
+ def additional_limits
+ additional_minutes_usage[%r{([^/ ]+)$}]
+ end
+
+ # TODO: Refactor/Remove this method once https://gitlab.com/gitlab-org/quality/chemlab/-/merge_requests/28 is merged
+ def additional_minutes_exist?
+ has_element?(:strong, :additional_minutes, text: 'Additional minutes')
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/lib/gitlab/page/subscriptions/new.rb b/qa/lib/gitlab/page/subscriptions/new.rb
index 4c0e5446444..6e3cb45fd29 100644
--- a/qa/lib/gitlab/page/subscriptions/new.rb
+++ b/qa/lib/gitlab/page/subscriptions/new.rb
@@ -6,10 +6,11 @@ module Gitlab
class New < Chemlab::Page
path '/subscriptions/new'
- # Subscription Details
+ # Purchase Details
select :plan_name
select :group_name
text_field :number_of_users
+ text_field :quantity
button :continue_to_billing, text: /Continue to billing/
# Billing address
@@ -35,6 +36,10 @@ module Gitlab
# Confirmation
button :confirm_purchase, text: /Confirm purchase/
+
+ # Order Summary
+ div :selected_plan, 'data-testid': 'selected-plan'
+ div :order_total, 'data-testid': 'total-amount'
end
end
end