Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use std::{
path::{Path, PathBuf, MAIN_SEPARATOR}
};

const DRIVER_VERSION: &str = "1.11.0-1620331022000";
const DRIVER_VERSION: &str = "1.13.0";

fn main() {
let out_dir: PathBuf = env::var_os("OUT_DIR").unwrap().into();
let dest = out_dir.join("driver.zip");
let platform = PlaywrightPlatform::default();
fs::write(out_dir.join("platform"), platform.to_string()).unwrap();
download(&url(platform), &dest);
println!("cargo:rerun-if-changed=src/build.rs");
println!("cargo:rustc-env=SEP={}", MAIN_SEPARATOR);
println!("cargo::rerun-if-changed=src/build.rs");
println!("cargo::rustc-env=SEP={}", MAIN_SEPARATOR);
}

#[cfg(all(not(feature = "only-for-docs-rs"), not(unix)))]
Expand Down Expand Up @@ -75,14 +75,9 @@ fn check_size(p: &Path) {
fn download(_url: &str, dest: &Path) { File::create(dest).unwrap(); }

fn url(platform: PlaywrightPlatform) -> String {
// let next = DRIVER_VERSION
// .contains("next")
// .then(|| "/next")
// .unwrap_or_default();
let next = "/next";
format!(
"https://playwright.azureedge.net/builds/driver{}/playwright-{}-{}.zip",
next, DRIVER_VERSION, platform
"https://playwright.azureedge.net/builds/driver/playwright-{}-{}.zip",
DRIVER_VERSION, platform
)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/devices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async fn has_touch(page: &Page) -> bool {
}

async fn check_user_agent(page: &Page, port: u16) {
let user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1";
let user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.2 Mobile/15E148 Safari/604.1";
assert_eq!(
page.eval::<String>("() => navigator.userAgent")
.await
Expand Down