45860bc807
Override page object methods to log the actions taken by the methods before or after the action, as appropriate. Allow page object action logging to be turned on via a QA_DEBUG env var. Unlike CHROME_HEADLESS (and the soon to arrive VERBOSE), QA_DEBUG is false by default. QA_DEBUG is used instead of just DEBUG because that enables Selenium debug logging. Mask passwords entered into fields with a QA selector with 'password' in the name. Doesn't mask sensitive data entered into any other field.
27 lines
836 B
Ruby
27 lines
836 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe QA::Runtime::Logger do
|
|
it 'logs debug' do
|
|
expect { described_class.debug('test') }.to output(/DEBUG -- : test/).to_stdout_from_any_process
|
|
end
|
|
|
|
it 'logs info' do
|
|
expect { described_class.info('test') }.to output(/INFO -- : test/).to_stdout_from_any_process
|
|
end
|
|
|
|
it 'logs warn' do
|
|
expect { described_class.warn('test') }.to output(/WARN -- : test/).to_stdout_from_any_process
|
|
end
|
|
|
|
it 'logs error' do
|
|
expect { described_class.error('test') }.to output(/ERROR -- : test/).to_stdout_from_any_process
|
|
end
|
|
|
|
it 'logs fatal' do
|
|
expect { described_class.fatal('test') }.to output(/FATAL -- : test/).to_stdout_from_any_process
|
|
end
|
|
|
|
it 'logs unknown' do
|
|
expect { described_class.unknown('test') }.to output(/ANY -- : test/).to_stdout_from_any_process
|
|
end
|
|
end
|