// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the5// "License"); you may not use this file except in compliance6// with the License. You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing,11// software distributed under the License is distributed on an12// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13// KIND, either express or implied. See the License for the14// specific language governing permissions and limitations15// under the License.1617use crate::common::{get_driver_path, get_selenium_manager};1819use rstest::rstest;20use std::fs;21use std::path::Path;2223mod common;2425#[rstest]26#[case("../tmp")]27#[case("../áèîö")]28#[case("../テスト")]29fn cache_path_test(#[case] tmp_cache_folder_name: String) {30let mut cmd = get_selenium_manager();31cmd.args([32"--browser",33"chrome",34"--cache-path",35&tmp_cache_folder_name,36"--output",37"json",38])39.assert()40.success()41.code(0);4243let driver_path = get_driver_path(&mut cmd);44println!("*** Custom cache path: {}", driver_path);45assert!(!driver_path.contains(r"cache\selenium"));4647let tmp_cache_path = Path::new(&tmp_cache_folder_name);48fs::remove_dir_all(tmp_cache_path).unwrap();49assert!(!tmp_cache_path.exists());50}515253