# frozen_string_literal: true ::RSpec.configure do |config| # rubocop:disable Metrics/BlockLength config.before(:each, js: true) do config.rspeckled_logger.debug("Before Each - Start - #{__FILE__}") page.driver.reset! config.rspeckled_logger.debug("Before Each - End - #{__FILE__}") end # Focus The Browser on Activation config.around(:each, js: true, autofocus: true) do |example| config.rspeckled_logger.debug("Around Each - Start - #{__FILE__}") browser_name = example.metadata[:driver].to_s.capitalize ::Thread.new do sleep 1.5 ` osascript -e ' tell the application named "#{browser_name}" activate set theWindow to the first item of windows if index of theWindow is not 1 then set index to 1 set visible to false set visible to true end if end tell ' > /dev/null ` end example.run sleep example.metadata[:delay] config.rspeckled_logger.debug("Around Each - End - #{__FILE__}") end end