diff options
Diffstat (limited to 'qa/lib/gitlab/page/admin/subscription.rb')
-rw-r--r-- | qa/lib/gitlab/page/admin/subscription.rb | 31 |
1 files changed, 31 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 |