From d8788dc7a6240997d4547dc2d181b02c79bc6aec Mon Sep 17 00:00:00 2001 From: Erdogan Yoksul Date: Sat, 4 May 2024 17:17:47 +0300 Subject: [PATCH] feat: update playwright version to 1.13.0 --- src/build.rs | 15 +++++---------- tests/devices/mod.rs | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/build.rs b/src/build.rs index a1a0790..28ef993 100644 --- a/src/build.rs +++ b/src/build.rs @@ -4,7 +4,7 @@ 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(); @@ -12,8 +12,8 @@ fn main() { 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)))] @@ -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 ) } diff --git a/tests/devices/mod.rs b/tests/devices/mod.rs index 5ae5b8a..0c5107d 100644 --- a/tests/devices/mod.rs +++ b/tests/devices/mod.rs @@ -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::("() => navigator.userAgent") .await