describe('Should be able to Test Command line arguments',function(){(process.platform==='darwin'?it:it.skip)('headless',asyncfunction(){letdriver=awaitenv.builder().setSafariOptions(options)
constsafari=require('selenium-webdriver/safari');const{Browser}=require("selenium-webdriver");const{suite}=require('selenium-webdriver/testing')constoptions=newsafari.Options();constprocess=require('node:process');suite(function(env){describe('Should be able to Test Command line arguments',function(){(process.platform==='darwin'?it:it.skip)('headless',asyncfunction(){letdriver=awaitenv.builder().setSafariOptions(options).build();awaitdriver.get('https://www.google.com');awaitdriver.quit();});});},{browsers:[Browser.SAFARI]});
# frozen_string_literal: truerequire'spec_helper'RSpec.describe'Safari',exclusive:{platform::macosx}dodescribe'Options'doit'basic options'dooptions=Selenium::WebDriver::Options.safari@driver=Selenium::WebDriver.for:safari,options:optionsendenddescribe'Service'dolet(:directory){"#{Dir.home}/Library/Logs/com.apple.WebDriver/*"}it'enable logs'dooriginal_count=Dir[directory].lengthservice=Selenium::WebDriver::Service.safariservice.args<<'--diagnose'@driver=Selenium::WebDriver.for:safari,service:serviceexpect(Dir[directory].length-original_count).toeq1endit'does not set log output'doservice=Selenium::WebDriver::Service.safariexpect{service.log=$stdout}.toraise_error(Selenium::WebDriver::Error::WebDriverError,/Safari Service does not support setting log output/)endendend
# frozen_string_literal: truerequire'spec_helper'RSpec.describe'Safari',exclusive:{platform::macosx}dodescribe'Options'doit'basic options'dooptions=Selenium::WebDriver::Options.safari@driver=Selenium::WebDriver.for:safari,options:optionsendenddescribe'Service'dolet(:directory){"#{Dir.home}/Library/Logs/com.apple.WebDriver/*"}it'enable logs'dooriginal_count=Dir[directory].lengthservice=Selenium::WebDriver::Service.safariservice.args<<'--diagnose'@driver=Selenium::WebDriver.for:safari,service:serviceexpect(Dir[directory].length-original_count).toeq1endit'does not set log output'doservice=Selenium::WebDriver::Service.safariexpect{service.log=$stdout}.toraise_error(Selenium::WebDriver::Error::WebDriverError,/Safari Service does not support setting log output/)endendend