Commit 245e5ded authored by Rémy Coutable's avatar Rémy Coutable

Various improvements to the QA framework

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a06a5e38
......@@ -13,7 +13,7 @@ module QA
license_page.add_new_license(license) unless license_page.license?
end
QA::Page::Main::Menu.perform(&:sign_out)
QA::Page::Main::Menu.perform(&:sign_out_if_signed_in)
end
end
end
......
......@@ -18,7 +18,11 @@ module QA
return unless ENV['EE_LICENSE']
EE::Resource::License.fabricate!(ENV['EE_LICENSE'])
QA::Support::Retrier.retry_on_exception do
QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login) do
EE::Resource::License.fabricate!(ENV['EE_LICENSE'])
end
end
end
end
end
......
......@@ -14,11 +14,9 @@ module QA
attr_writer :logger
def logger
return @logger if @logger
@logger = ::Logger.new Runtime::Env.log_destination
@logger.level = Runtime::Env.debug? ? ::Logger::DEBUG : ::Logger::ERROR
@logger
@logger ||= ::Logger.new(Runtime::Env.log_destination).tap do |logger|
logger.level = Runtime::Env.debug? ? ::Logger::DEBUG : ::Logger::ERROR
end
end
end
end
......
......@@ -16,7 +16,7 @@ module QA
super
end
def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true)
def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: false)
log("next wait uses reload: #{reload}")
# Logging of wait start/end/duration is handled by QA::Support::Waiter
......
......@@ -62,7 +62,7 @@ describe QA::Page::Base do
end
end
describe '#wait' do
describe '#wait_until' do
subject { Class.new(described_class).new }
context 'when the condition is true' do
......
......@@ -12,9 +12,9 @@ QA::Runtime::Browser.configure!
QA::Runtime::Scenario.from_env(QA::Runtime::Env.runtime_scenario_attributes) if QA::Runtime::Env.runtime_scenario_attributes
%w[helpers shared_examples].each do |d|
Dir[::File.join(__dir__, d, '**', '*.rb')].each { |f| require f }
end
Dir[::File.join(__dir__, "support/helpers/*.rb")].each { |f| require f }
Dir[::File.join(__dir__, "support/shared_contexts/*.rb")].each { |f| require f }
Dir[::File.join(__dir__, "support/shared_examples/*.rb")].each { |f| require f }
RSpec.configure do |config|
QA::Specs::Helpers::Quarantine.configure_rspec
......
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