[ad_1]
We’re running a number of Laravel Dusk Browser tests with Selenium / ChromeDriver on an Ubuntu linux system. ChromeDriver saves the LocalStorage and Cache files in a temporary directory names like /tmp/.com.google.Chrome.tcgPrq
. Unfortunately, these temporary directories do not get deleted after running the testsuite, so the disk fills up pretty quick.
Is there any way to define the location of these temporary files? Or to make sure that they get cleaned up after running the testsuite?
I’ve already tried to run ChromeDriver with the --user-data-dir
option, but this doesn’t affect theses files:
$options = (new ChromeOptions())->addArguments([
'--disable-gpu',
'--headless',
'--window-size=1920,1080',
'--ignore-certificate-errors',
'--whitelisted-ips=""',
'--user-data-dir="' . storage_path('tmp') . '"'
]);
$browser = DesiredCapabilities::chrome();
$browser->setCapability(ChromeOptions::CAPABILITY, $options);
[ad_2]