From 015dcafdbdd56bc0ead82019169a8a8369c93885 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 30 Mar 2022 12:32:29 +0200 Subject: [PATCH] Remove empty chrome prefs from the capabilities --- .../ServiceContainer/Driver/Selenium2Factory.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php index c651085..0da0564 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php @@ -152,6 +152,15 @@ class Selenium2Factory implements DriverFactory ->prototype('variable')->end() ->end() ->end() + ->validate() + ->ifTrue(function ($v) { + return empty($v['prefs']); + }) + ->then(function ($v) { + unset($v['prefs']); + return $v; + }) + ->end() ->end() ->arrayNode('extra_capabilities') ->info('Custom capabilities merged with the known ones')