Commit 33493f0b authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-shl-assert-on-license' into 'master'

E2E: Raise error on failure to add license key

See merge request gitlab-org/gitlab!81446
parents a6dff66b a034feb1
...@@ -25,11 +25,11 @@ module QA ...@@ -25,11 +25,11 @@ module QA
end end
def add_new_license(key) def add_new_license(key)
raise 'License key empty!' if key.to_s.empty? raise 'License key empty!' if key.to_s.strip.empty?
click_element(:license_upload_link) click_element(:license_upload_link)
choose_element(:license_type_key_radio) choose_element(:license_type_key_radio)
fill_element(:license_key_field, key) fill_element(:license_key_field, key.strip)
check_element(:accept_eula_checkbox) check_element(:accept_eula_checkbox)
click_element(:license_upload_button) click_element(:license_upload_button)
end end
......
# frozen_string_literal: true
module QA
module EE
module Page
module Admin
class Subscription < QA::Page::Base
view 'ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_details_table.vue' do
element :plan, ':data-qa-selector="qaSelectorValue(item)"' # rubocop:disable QA/ElementWithPattern
end
def has_ultimate_subscription_plan?
has_element?(:plan, text: 'Ultimate')
end
end
end
end
end
end
...@@ -17,6 +17,13 @@ module QA ...@@ -17,6 +17,13 @@ module QA
end end
end end
unless EE::Page::Admin::Subscription.perform(&:has_ultimate_subscription_plan?)
license_length = license.to_s.strip.length
license_info = "License key length: #{license_length}. " + (license_length > 5 ? "Last five characters: #{license.to_s.strip[-5..]}" : "")
raise "Adding license key was unsuccessful. #{license_info}"
end
QA::Page::Main::Menu.perform(&:sign_out_if_signed_in) QA::Page::Main::Menu.perform(&:sign_out_if_signed_in)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment