tests(e2e): improve coverage

This commit is contained in:
Lucas Nogueira
2026-09-22 21:54:21 -03:00
parent 684feb2510
commit c8c373b48b
50 changed files with 1893 additions and 183 deletions
+11 -1
View File
@@ -39,12 +39,18 @@ tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.5" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.6" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.5" }
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
tauri-plugin-deep-link = { path = "../../../plugins/deep-link", version = "2.4.10" }
tauri-plugin-sql = { path = "../../../plugins/sql", version = "2.4.1", features = [
"sqlite",
] }
tauri-plugin-stronghold = { path = "../../../plugins/stronghold", version = "2.3.2" }
tauri-plugin-websocket = { path = "../../../plugins/websocket", version = "2.4.3" }
# WebDriver automation bridge, used by the plugins e2e suite (packages/api-e2e).
# Desktop-only and behind the off-by-default `automation` feature so it never ships in a
# regular build.
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-automation = { version = "0.1.4", optional = true }
tauri-plugin-automation = { version = "0.2.0", optional = true }
[dependencies.tauri]
workspace = true
@@ -61,8 +67,12 @@ features = [
]
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-autostart = { path = "../../../plugins/autostart", version = "2.5.1" }
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.2" }
tauri-plugin-positioner = { path = "../../../plugins/positioner", version = "2.3.4", features = [
"tray-icon",
] }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.12.0" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
+12 -1
View File
@@ -132,6 +132,17 @@
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
},
"upload:default"
"upload:default",
"deep-link:default",
"deep-link:allow-register",
"deep-link:allow-unregister",
"deep-link:allow-is-registered",
"sql:default",
"sql:allow-execute",
"stronghold:default",
"stronghold:allow-destroy",
"stronghold:allow-remove-secret",
"stronghold:allow-remove-store-record",
"websocket:default"
]
}
@@ -5,7 +5,9 @@
"windows": ["main"],
"platforms": ["linux", "macOS", "windows"],
"permissions": [
"autostart:default",
"cli:default",
"positioner:default",
"updater:default",
"global-shortcut:allow-unregister",
"global-shortcut:allow-register",
+30 -1
View File
@@ -9,7 +9,7 @@ mod tray;
use serde::Serialize;
use tauri::{
webview::{PageLoadEvent, WebviewWindowBuilder},
App, AppHandle, Emitter, Listener, RunEvent, WebviewUrl,
App, AppHandle, Emitter, Listener, Manager, RunEvent, WebviewUrl,
};
#[derive(Clone, Serialize)]
@@ -55,11 +55,40 @@ pub fn run() {
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_upload::init())
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_websocket::init())
.plugin(
tauri_plugin_sql::Builder::new()
.add_migrations(
"sqlite:api.db",
vec![tauri_plugin_sql::Migration {
version: 1,
description: "create_todos_table",
sql: "CREATE TABLE todos (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT NOT NULL, done INTEGER NOT NULL DEFAULT 0);",
kind: tauri_plugin_sql::MigrationKind::Up,
}],
)
.build(),
)
.setup(move |app| {
// the argon2 salt lives next to the snapshots the frontend creates
let local_data_dir = app.path().app_local_data_dir()?;
std::fs::create_dir_all(&local_data_dir)?;
app.handle().plugin(
tauri_plugin_stronghold::Builder::with_argon2(&local_data_dir.join("salt.txt"))
.build(),
)?;
#[cfg(desktop)]
{
// registered before the tray, whose events it tracks
app.handle().plugin(tauri_plugin_positioner::init())?;
tray::create_tray(app.handle())?;
app.handle().plugin(tauri_plugin_cli::init())?;
app.handle().plugin(tauri_plugin_autostart::init(
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
None,
))?;
app.handle()
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?;
app.handle()
+2
View File
@@ -107,6 +107,8 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
_ => {}
})
.on_tray_icon_event(|tray, event| {
// lets the positioner plugin place windows relative to the tray icon
tauri_plugin_positioner::on_tray_event(tray.app_handle(), &event);
if let TrayIconEvent::Click {
button_state: MouseButtonState::Down,
button: MouseButton::Left,