From c487a5152e5257f98f152b97a00ea372cb2abe6d Mon Sep 17 00:00:00 2001 From: Amos Jun-yeung Ng Date: Tue, 6 Aug 2024 16:34:24 +0700 Subject: [PATCH] Make webdriver screenshot size consistent with default Tauri app size --- ...dividual-800x600.png => api-call-individual.png} | Bin ...opulated-800x600.png => api-calls-populated.png} | Bin .../{api-calls-800x600.png => api-calls.png} | Bin .../{chat-screen-800x600.png => chat-screen.png} | Bin ...redits-screen-800x600.png => credits-screen.png} | Bin .../{new-api-call-800x600.png => new-api-call.png} | Bin ...tings-screen-800x600.png => settings-screen.png} | Bin ...elcome-screen-800x600.png => welcome-screen.png} | Bin webdriver/wdio.conf.ts | 10 +++++++++- 9 files changed, 9 insertions(+), 1 deletion(-) rename webdriver/screenshots/baseline/desktop_wry/{api-call-individual-800x600.png => api-call-individual.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{api-calls-populated-800x600.png => api-calls-populated.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{api-calls-800x600.png => api-calls.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{chat-screen-800x600.png => chat-screen.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{credits-screen-800x600.png => credits-screen.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{new-api-call-800x600.png => new-api-call.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{settings-screen-800x600.png => settings-screen.png} (100%) rename webdriver/screenshots/baseline/desktop_wry/{welcome-screen-800x600.png => welcome-screen.png} (100%) diff --git a/webdriver/screenshots/baseline/desktop_wry/api-call-individual-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/api-call-individual-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/api-call-individual.png diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls-populated-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/api-calls-populated-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png diff --git a/webdriver/screenshots/baseline/desktop_wry/api-calls-800x600.png b/webdriver/screenshots/baseline/desktop_wry/api-calls.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/api-calls-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/api-calls.png diff --git a/webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/chat-screen.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/chat-screen.png diff --git a/webdriver/screenshots/baseline/desktop_wry/credits-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/credits-screen.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/credits-screen-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/credits-screen.png diff --git a/webdriver/screenshots/baseline/desktop_wry/new-api-call-800x600.png b/webdriver/screenshots/baseline/desktop_wry/new-api-call.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/new-api-call-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/new-api-call.png diff --git a/webdriver/screenshots/baseline/desktop_wry/settings-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/settings-screen.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/settings-screen-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/settings-screen.png diff --git a/webdriver/screenshots/baseline/desktop_wry/welcome-screen-800x600.png b/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png similarity index 100% rename from webdriver/screenshots/baseline/desktop_wry/welcome-screen-800x600.png rename to webdriver/screenshots/baseline/desktop_wry/welcome-screen.png 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,