Path: blob/trunk/rust/tests/browser_download_tests.rs
2885 views
// 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::{assert_browser, assert_driver, get_selenium_manager};1819use rstest::rstest;20use std::env::consts::OS;2122mod common;2324#[rstest]25#[case("chrome")]26#[case("firefox")]27#[case("edge")]28fn browser_latest_download_test(#[case] browser: String) {29if !browser.eq("edge") || !OS.eq("windows") {30let mut cmd = get_selenium_manager();31cmd.args([32"--browser",33&browser,34"--force-browser-download",35"--output",36"json",37"--debug",38])39.assert()40.success()41.code(0);4243assert_driver(&mut cmd);44assert_browser(&mut cmd);45}46}4748#[rstest]49#[case("chrome", "113")]50#[case("chrome", "131.0.6725.0")]51#[case("chrome", "beta")]52#[case("firefox", "116")]53#[case("firefox", "121.0.1")]54#[case("firefox", "beta")]55#[case("firefox", "esr")]56#[case("edge", "137.0.3296.93")]57#[case("edge", "beta")]58fn browser_version_download_test(#[case] browser: String, #[case] browser_version: String) {59if OS.eq("windows") && browser.eq("edge") {60println!("Skipping Edge download test on Windows since the installation requires admin privileges");61} else {62let mut cmd = get_selenium_manager();63cmd.args([64"--browser",65&browser,66"--browser-version",67&browser_version,68"--output",69"json",70"--debug",71])72.assert()73.success()74.code(0);7576assert_driver(&mut cmd);77assert_browser(&mut cmd);78}79}808182