diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 278585a7..6d28cd65 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -25,7 +25,6 @@ use tauri_specta::ts; use tokio::sync::Mutex; use cli::{Cli, Commands}; -#[cfg(target_os = "macos")] use commands::preferences::get_preferences_file_contents; use commands::{ chat, export_db, get_api_call, get_api_calls, get_api_keys, get_preferences, @@ -79,19 +78,25 @@ fn main() { }); }); + let prefs = get_preferences_file_contents(&config_dir)?; #[cfg(target_os = "macos")] - { - let prefs = get_preferences_file_contents(&config_dir)?; - if prefs.high_dpi_adjust.is_none() - || prefs.high_dpi_adjust.unwrap() - { - app.get_window("main") - .ok_or(anyhow::anyhow!("No main window"))? - .set_size(tauri::Size::Logical(tauri::LogicalSize { - width: 666.6, // 800 * 0.8333... - height: 500.0, // 600 * 0.8333... - }))?; - } + let high_dpi_adjust_on = prefs.high_dpi_adjust.unwrap_or(true); + #[cfg(not(target_os = "macos"))] + let high_dpi_adjust_on = prefs.high_dpi_adjust.unwrap_or(false); + if high_dpi_adjust_on { + app.get_window("main") + .ok_or(anyhow::anyhow!("No main window"))? + .set_size(tauri::Size::Logical(tauri::LogicalSize { + width: 708.0, // 850 * 0.8333... + height: 541.0, // 650 * 0.8333... + }))?; + } else { + app.get_window("main") + .ok_or(anyhow::anyhow!("No main window"))? + .set_size(tauri::Size::Logical(tauri::LogicalSize { + width: 850.0, + height: 650.0, + }))?; } Ok(()) diff --git a/webdriver/screenshots/baseline/desktop_wry/api-call-individual-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-call-individual-800x600.png deleted file mode 100644 index 19c50c6a..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/api-call-individual-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png b/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png new file mode 100644 index 00000000..101a113d Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-calls-800x600.png deleted file mode 100644 index df1cf475..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/api-calls-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls-populated-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-calls-populated-800x600.png deleted file mode 100644 index 21e8bd38..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/api-calls-populated-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png b/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png new file mode 100644 index 00000000..d032dfa1 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls.png b/webdriver/screenshots/baseline/desktop_wry/api-calls.png new file mode 100644 index 00000000..9ceb6128 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/api-calls.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png deleted file mode 100644 index a2bb2421..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/chat-screen.png b/webdriver/screenshots/baseline/desktop_wry/chat-screen.png new file mode 100644 index 00000000..8bd08b48 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/chat-screen.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/credits-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/credits-screen-800x600.png deleted file mode 100644 index d1a05799..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/credits-screen-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/credits-screen.png b/webdriver/screenshots/baseline/desktop_wry/credits-screen.png new file mode 100644 index 00000000..bc621dd3 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/credits-screen.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/new-api-call-800x600.png b/webdriver/screenshots/baseline/desktop_wry/new-api-call-800x600.png deleted file mode 100644 index 508d8638..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/new-api-call-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/new-api-call.png b/webdriver/screenshots/baseline/desktop_wry/new-api-call.png new file mode 100644 index 00000000..1d049b16 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/new-api-call.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/settings-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/settings-screen-800x600.png deleted file mode 100644 index aebbbc33..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/settings-screen-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/settings-screen.png b/webdriver/screenshots/baseline/desktop_wry/settings-screen.png new file mode 100644 index 00000000..a5b911a5 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/settings-screen.png differ diff --git a/webdriver/screenshots/baseline/desktop_wry/welcome-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/welcome-screen-800x600.png deleted file mode 100644 index 612cead3..00000000 Binary files a/webdriver/screenshots/baseline/desktop_wry/welcome-screen-800x600.png and /dev/null differ diff --git a/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png b/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png new file mode 100644 index 00000000..cf9668a6 Binary files /dev/null and b/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png differ diff --git a/webdriver/tsconfig.json b/webdriver/tsconfig.json new file mode 100644 index 00000000..b230abcb --- /dev/null +++ b/webdriver/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "types": ["node", "@wdio/globals/types"] + } +} diff --git a/webdriver/wdio.conf.ts b/webdriver/wdio.conf.ts index 929c8ef2..599955a2 100644 --- a/webdriver/wdio.conf.ts +++ b/webdriver/wdio.conf.ts @@ -36,6 +36,14 @@ exports.config = { stdio: [null, process.stdout, process.stderr], })), + before: ( + _capabilities: Record[], + _specs: string[], + browser: WebdriverIO.Browser, + ) => { + browser.setWindowSize(850, 650); + }, + // clean up the `tauri-driver` process we spawned at the start of the session afterSession: () => tauriDriver.kill(), @@ -44,7 +52,7 @@ exports.config = { "image-comparison", { baselineFolder: join(process.cwd(), "./screenshots/baseline/"), - formatImageName: "{tag}-{width}x{height}", + formatImageName: "{tag}", screenshotPath: join(process.cwd(), "./screenshots/testing/"), savePerInstance: true, autoSaveBaseline: true,