Commit a034feb1 authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Ramya Authappan

E2E: Raise error on failure to add license key

parent 3c419ef1
......@@ -25,11 +25,11 @@ module QA
end
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)
choose_element(:license_type_key_radio)
fill_element(:license_key_field, key)
fill_element(:license_key_field, key.strip)
check_element(:accept_eula_checkbox)
click_element(:license_upload_button)
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
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)
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