diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 21:14:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 21:14:18 +0300 |
commit | 39cb2fdf01699eb5ac000c918f469c58dc75f7e8 (patch) | |
tree | 5de21a06dfe8b97c793f892032be45949aa482db /qa/lib/gitlab | |
parent | c17eb7c97062d25cdf1b44573e4c0241f52aa2fe (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/lib/gitlab')
-rw-r--r-- | qa/lib/gitlab/page/admin/subscription.rb | 31 | ||||
-rw-r--r-- | qa/lib/gitlab/page/admin/subscription.stub.rb | 106 |
2 files changed, 137 insertions, 0 deletions
diff --git a/qa/lib/gitlab/page/admin/subscription.rb b/qa/lib/gitlab/page/admin/subscription.rb index cdd9bb20b42..b90a49abf4b 100644 --- a/qa/lib/gitlab/page/admin/subscription.rb +++ b/qa/lib/gitlab/page/admin/subscription.rb @@ -6,6 +6,10 @@ module Gitlab class Subscription < Chemlab::Page path '/admin/subscription' + div :subscription_details + text_field :activation_code + button :activate + label :terms_of_services, text: /I agree that/ p :plan p :started p :name @@ -16,6 +20,33 @@ module Gitlab h2 :users_in_subscription h2 :users_over_subscription table :subscription_history + + def accept_terms + terms_of_services_element.click # workaround for hidden checkbox + end + + # Checks if a subscription record exists in subscription history table + # + # @param plan [Hash] Name of the plan + # @option plan [Hash] Support::Helpers::FREE + # @option plan [Hash] Support::Helpers::PREMIUM + # @option plan [Hash] Support::Helpers::PREMIUM_SELF_MANAGED + # @option plan [Hash] Support::Helpers::ULTIMATE + # @option plan [Hash] Support::Helpers::ULTIMATE_SELF_MANAGED + # @option plan [Hash] Support::Helpers::CI_MINUTES + # @option plan [Hash] Support::Helpers::STORAGE + # @param users_in_license [Integer] Number of users in license + # @param license_type [Hash] Type of the license + # @option license_type [String] 'license file' + # @option license_type [String] 'cloud license' + # @return [Boolean] True if record exsists, false if not + def has_subscription_record?(plan, users_in_license, license_type) + # find any records that have a matching plan and seats and type + subscription_history_element.hashes.any? do |record| + record['Plan'] == plan[:name].capitalize && record['Seats'] == users_in_license.to_s && \ + record['Type'].strip.downcase == license_type + end + end end end end diff --git a/qa/lib/gitlab/page/admin/subscription.stub.rb b/qa/lib/gitlab/page/admin/subscription.stub.rb index 89d7bfb95d9..56a063e8978 100644 --- a/qa/lib/gitlab/page/admin/subscription.stub.rb +++ b/qa/lib/gitlab/page/admin/subscription.stub.rb @@ -4,6 +4,112 @@ module Gitlab module Page module Admin module Subscription + # @note Defined as +h6 :subscription_details+ + # @return [String] The text content or value of +subscription_details+ + def subscription_details + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription.subscription_details_element).to exist + # end + # @return [Watir::H6] The raw +H6+ element + def subscription_details_element + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription).to be_subscription_details + # end + # @return [Boolean] true if the +subscription_details+ element is present on the page + def subscription_details? + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @note Defined as +text_field :activation_code+ + # @return [String] The text content or value of +activation_code+ + def activation_code + # This is a stub, used for indexing. The method is dynamically generated. + end + + # Set the value of activation_code + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # subscription.activation_code = 'value' + # end + # @param value [String] The value to set. + def activation_code=(value) + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription.activation_code_element).to exist + # end + # @return [Watir::TextField] The raw +TextField+ element + def activation_code_element + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription).to be_activation_code + # end + # @return [Boolean] true if the +activation_code+ element is present on the page + def activation_code? + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @note Defined as +label :terms_of_services+ + # @return [String] The text content or value of +terms_of_services+ + def terms_of_services + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription.terms_of_services_element).to exist + # end + # @return [Watir::Label] The raw +Label+ element + def terms_of_services_element + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription).to be_terms_of_services + # end + # @return [Boolean] true if the +terms_of_services+ element is present on the page + def terms_of_services? + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @note Defined as +button :activate+ + # Clicks +activate+ + def activate + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription.activate_element).to exist + # end + # @return [Watir::Button] The raw +Button+ element + def activate_element + # This is a stub, used for indexing. The method is dynamically generated. + end + + # @example + # Gitlab::Page::Admin::Subscription.perform do |subscription| + # expect(subscription).to be_activate + # end + # @return [Boolean] true if the +activate+ element is present on the page + def activate? + # This is a stub, used for indexing. The method is dynamically generated. + end + # @note Defined as +p :plan+ # @return [String] The text content or value of +plan+ def plan |