tauri-plugin-debug-tools 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +346 -0
- package/LICENSE +21 -0
- package/README.md +303 -0
- package/dist-js/consoleLogger.d.ts +92 -0
- package/dist-js/consoleLogger.d.ts.map +1 -0
- package/dist-js/consoleLogger.js +317 -0
- package/dist-js/debugBridge.d.ts +50 -0
- package/dist-js/debugBridge.d.ts.map +1 -0
- package/dist-js/debugBridge.js +66 -0
- package/dist-js/index.d.ts +3 -0
- package/dist-js/index.d.ts.map +1 -0
- package/dist-js/index.js +2 -0
- package/dist-js/logAdapter.d.ts +36 -0
- package/dist-js/logAdapter.d.ts.map +1 -0
- package/dist-js/logAdapter.js +42 -0
- package/dist-js/screenshotHelper.d.ts +60 -0
- package/dist-js/screenshotHelper.d.ts.map +1 -0
- package/dist-js/screenshotHelper.js +100 -0
- package/examples/.vscode/extensions.json +3 -0
- package/examples/README.md +51 -0
- package/examples/bun.lock +265 -0
- package/examples/package.json +19 -0
- package/examples/src/assets/javascript.svg +1 -0
- package/examples/src/assets/tauri.svg +6 -0
- package/examples/src/index.html +56 -0
- package/examples/src/main.js +91 -0
- package/examples/src/styles.css +112 -0
- package/examples/src-tauri/Cargo.lock +5674 -0
- package/examples/src-tauri/Cargo.toml +25 -0
- package/examples/src-tauri/build.rs +3 -0
- package/examples/src-tauri/capabilities/default.json +7 -0
- package/examples/src-tauri/icons/128x128.png +0 -0
- package/examples/src-tauri/icons/128x128@2x.png +0 -0
- package/examples/src-tauri/icons/32x32.png +0 -0
- package/examples/src-tauri/icons/Square107x107Logo.png +0 -0
- package/examples/src-tauri/icons/Square142x142Logo.png +0 -0
- package/examples/src-tauri/icons/Square150x150Logo.png +0 -0
- package/examples/src-tauri/icons/Square284x284Logo.png +0 -0
- package/examples/src-tauri/icons/Square30x30Logo.png +0 -0
- package/examples/src-tauri/icons/Square310x310Logo.png +0 -0
- package/examples/src-tauri/icons/Square44x44Logo.png +0 -0
- package/examples/src-tauri/icons/Square71x71Logo.png +0 -0
- package/examples/src-tauri/icons/Square89x89Logo.png +0 -0
- package/examples/src-tauri/icons/StoreLogo.png +0 -0
- package/examples/src-tauri/icons/icon.icns +0 -0
- package/examples/src-tauri/icons/icon.ico +0 -0
- package/examples/src-tauri/icons/icon.png +0 -0
- package/examples/src-tauri/src/lib.rs +15 -0
- package/examples/src-tauri/src/main.rs +6 -0
- package/examples/src-tauri/tauri.conf.json +33 -0
- package/examples/tests/e2e.mac.test.ts +203 -0
- package/examples/tests/e2e.test.ts +131 -0
- package/examples/vitest.config.ts +10 -0
- package/guest-js/consoleLogger.ts +369 -0
- package/guest-js/debugBridge.ts +93 -0
- package/guest-js/index.ts +2 -0
- package/guest-js/logAdapter.ts +62 -0
- package/guest-js/screenshotHelper.ts +122 -0
- package/package.json +84 -0
- package/permissions/autogenerated/commands/append_debug_logs.toml +13 -0
- package/permissions/autogenerated/commands/capture_webview_state.toml +13 -0
- package/permissions/autogenerated/commands/get_console_logs.toml +13 -0
- package/permissions/autogenerated/commands/reset_debug_logs.toml +13 -0
- package/permissions/autogenerated/commands/send_debug_command.toml +13 -0
- package/permissions/autogenerated/commands/write_debug_snapshot.toml +13 -0
- package/permissions/autogenerated/reference.md +201 -0
- package/permissions/debug-with-logging.toml +26 -0
- package/permissions/default.toml +26 -0
- package/permissions/schemas/schema.json +384 -0
- package/skills/debug-tauri/SKILL.md +114 -0
- package/skills/debug-tauri/references/IPC_COMMANDS.md +196 -0
- package/skills/debug-tauri/references/LOGGING.md +195 -0
- package/skills/debug-tauri/references/MIGRATION.md +487 -0
- package/skills/debug-tauri/references/REFERENCE.md +206 -0
- package/skills/debug-tauri/references/REPORT_TEMPLATE.md +166 -0
- package/skills/debug-tauri/references/SCREENSHOTS.md +193 -0
- package/skills/debug-tauri/references/TROUBLESHOOTING.md +144 -0
- package/skills/debug-tauri/scripts/analyze_logs.sh +127 -0
- package/skills/debug-tauri/scripts/capture.sh +89 -0
- package/skills/debug-tauri/scripts/validate_setup.sh +181 -0
- package/src/commands.rs +147 -0
- package/src/lib.rs +41 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "examples-demo-app"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A Tauri App"
|
|
5
|
+
authors = ["you"]
|
|
6
|
+
edition = "2021"
|
|
7
|
+
|
|
8
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
9
|
+
|
|
10
|
+
[lib]
|
|
11
|
+
# The `_lib` suffix may seem redundant but it is necessary
|
|
12
|
+
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
13
|
+
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
14
|
+
name = "examples_demo_app_lib"
|
|
15
|
+
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
16
|
+
|
|
17
|
+
[build-dependencies]
|
|
18
|
+
tauri-build = { version = "2", features = [] }
|
|
19
|
+
|
|
20
|
+
[dependencies]
|
|
21
|
+
tauri = { version = "2", features = [] }
|
|
22
|
+
tauri-plugin-debug-tools = { path = "../.." }
|
|
23
|
+
tauri-plugin-opener = "2"
|
|
24
|
+
serde = { version = "1", features = ["derive"] }
|
|
25
|
+
serde_json = "1"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
|
2
|
+
#[tauri::command]
|
|
3
|
+
fn greet(name: &str) -> String {
|
|
4
|
+
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
8
|
+
pub fn run() {
|
|
9
|
+
tauri::Builder::default()
|
|
10
|
+
.plugin(tauri_plugin_debug_tools::init())
|
|
11
|
+
.plugin(tauri_plugin_opener::init())
|
|
12
|
+
.invoke_handler(tauri::generate_handler![greet])
|
|
13
|
+
.run(tauri::generate_context!())
|
|
14
|
+
.expect("error while running tauri application");
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "examples-demo-app",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"identifier": "com.komakisadao.examples-demo-app",
|
|
6
|
+
"build": {
|
|
7
|
+
"frontendDist": "../src"
|
|
8
|
+
},
|
|
9
|
+
"app": {
|
|
10
|
+
"withGlobalTauri": true,
|
|
11
|
+
"windows": [
|
|
12
|
+
{
|
|
13
|
+
"title": "examples-demo-app",
|
|
14
|
+
"width": 800,
|
|
15
|
+
"height": 600
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"security": {
|
|
19
|
+
"csp": null
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"bundle": {
|
|
23
|
+
"active": true,
|
|
24
|
+
"targets": "all",
|
|
25
|
+
"icon": [
|
|
26
|
+
"icons/32x32.png",
|
|
27
|
+
"icons/128x128.png",
|
|
28
|
+
"icons/128x128@2x.png",
|
|
29
|
+
"icons/icon.icns",
|
|
30
|
+
"icons/icon.ico"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
import { Builder, By } from "selenium-webdriver";
|
|
7
|
+
import { describe, it } from "vitest";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const projectRoot = path.resolve(__dirname, "..");
|
|
12
|
+
const appName = "examples-demo-app";
|
|
13
|
+
const appBundlePath = path.join(
|
|
14
|
+
projectRoot,
|
|
15
|
+
"src-tauri",
|
|
16
|
+
"target",
|
|
17
|
+
"debug",
|
|
18
|
+
"bundle",
|
|
19
|
+
"macos",
|
|
20
|
+
`${appName}.app`,
|
|
21
|
+
);
|
|
22
|
+
const appBundleId =
|
|
23
|
+
process.env.APP_BUNDLE_ID ?? "com.komakisadao.examples-demo-app";
|
|
24
|
+
|
|
25
|
+
const isMac = process.platform === "darwin";
|
|
26
|
+
const serverUrl = process.env.APPIUM_SERVER_URL ?? "http://127.0.0.1:4723";
|
|
27
|
+
const dumpSourceEnabled = process.env.MAC2_DUMP_SOURCE === "1";
|
|
28
|
+
|
|
29
|
+
const suite = isMac ? describe : describe.skip;
|
|
30
|
+
|
|
31
|
+
suite("Tauri E2E (Appium Mac2)", () => {
|
|
32
|
+
it("launches the app and can access the window", async () => {
|
|
33
|
+
if (!existsSync(appBundlePath)) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`App bundle not found: ${appBundlePath}\n` +
|
|
36
|
+
"Run `bun run build` first.",
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const driver = await new Builder()
|
|
41
|
+
.usingServer(serverUrl)
|
|
42
|
+
.forBrowser("safari")
|
|
43
|
+
.withCapabilities({
|
|
44
|
+
browserName: "safari",
|
|
45
|
+
platformName: "mac",
|
|
46
|
+
"appium:automationName": "mac2",
|
|
47
|
+
"appium:app": appBundlePath,
|
|
48
|
+
"appium:bundleId": appBundleId,
|
|
49
|
+
"appium:newCommandTimeout": 120,
|
|
50
|
+
})
|
|
51
|
+
.build();
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
const queryAppState = async () => {
|
|
55
|
+
try {
|
|
56
|
+
const state = await driver.executeScript("macos: queryAppState", {
|
|
57
|
+
bundleId: appBundleId,
|
|
58
|
+
});
|
|
59
|
+
return typeof state === "number" ? state : state ? 1 : 0;
|
|
60
|
+
} catch {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const openApp = () => {
|
|
66
|
+
spawn("open", ["-n", appBundlePath], { stdio: "ignore" });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const state = await queryAppState();
|
|
70
|
+
if (state === 0) {
|
|
71
|
+
openApp();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
await driver.wait(async () => (await queryAppState()) > 0, 20_000);
|
|
75
|
+
await driver.executeScript("macos: activateApp", {
|
|
76
|
+
bundleId: appBundleId,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const dumpSource = async (label: string) => {
|
|
80
|
+
if (!dumpSourceEnabled) return;
|
|
81
|
+
try {
|
|
82
|
+
const source = await driver.executeScript("macos: source");
|
|
83
|
+
console.error(`[mac2] ${label} source:\n${source}`);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error(`[mac2] ${label} source failed`, error);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const waitForLocator = async (
|
|
90
|
+
label: string,
|
|
91
|
+
locator: By,
|
|
92
|
+
timeoutMs = 10_000,
|
|
93
|
+
) => {
|
|
94
|
+
try {
|
|
95
|
+
return await driver.wait(async () => {
|
|
96
|
+
try {
|
|
97
|
+
return await driver.findElement(locator);
|
|
98
|
+
} catch {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}, timeoutMs);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
await dumpSource(`${label} not found`);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const waitForSourceIncludes = async (text: string, timeoutMs = 15_000) =>
|
|
109
|
+
await driver.wait(async () => {
|
|
110
|
+
try {
|
|
111
|
+
const source = await driver.executeScript("macos: source");
|
|
112
|
+
return typeof source === "string" && source.includes(text);
|
|
113
|
+
} catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}, timeoutMs);
|
|
117
|
+
|
|
118
|
+
const byA11y = (value: string) => new By("accessibility id", value);
|
|
119
|
+
|
|
120
|
+
await waitForSourceIncludes("Welcome to Tauri");
|
|
121
|
+
await waitForSourceIncludes("greet-input");
|
|
122
|
+
|
|
123
|
+
const input = await waitForLocator("input", byA11y("greet-input"));
|
|
124
|
+
if (!input) {
|
|
125
|
+
throw new Error("greet-input not found");
|
|
126
|
+
}
|
|
127
|
+
await input.click();
|
|
128
|
+
await input.sendKeys("Tauri");
|
|
129
|
+
|
|
130
|
+
const button = await waitForLocator("button", byA11y("greet-button"));
|
|
131
|
+
if (!button) {
|
|
132
|
+
throw new Error("greet-button not found");
|
|
133
|
+
}
|
|
134
|
+
await button.click();
|
|
135
|
+
|
|
136
|
+
await waitForSourceIncludes("Hello, Tauri!", 20_000);
|
|
137
|
+
|
|
138
|
+
const capture = await waitForLocator(
|
|
139
|
+
"debug-capture",
|
|
140
|
+
byA11y("debug-capture"),
|
|
141
|
+
);
|
|
142
|
+
if (!capture) {
|
|
143
|
+
throw new Error("debug-capture not found");
|
|
144
|
+
}
|
|
145
|
+
await capture.click();
|
|
146
|
+
await waitForSourceIncludes("debug-webview-output", 20_000);
|
|
147
|
+
await waitForSourceIncludes("Tauri App", 20_000);
|
|
148
|
+
|
|
149
|
+
const getLogs = await waitForLocator(
|
|
150
|
+
"debug-get-logs",
|
|
151
|
+
byA11y("debug-get-logs"),
|
|
152
|
+
);
|
|
153
|
+
if (!getLogs) {
|
|
154
|
+
throw new Error("debug-get-logs not found");
|
|
155
|
+
}
|
|
156
|
+
await getLogs.click();
|
|
157
|
+
await waitForSourceIncludes("debug-logs-output", 20_000);
|
|
158
|
+
|
|
159
|
+
const sendCommand = await waitForLocator(
|
|
160
|
+
"debug-send-command",
|
|
161
|
+
byA11y("debug-send-command"),
|
|
162
|
+
);
|
|
163
|
+
if (!sendCommand) {
|
|
164
|
+
throw new Error("debug-send-command not found");
|
|
165
|
+
}
|
|
166
|
+
await sendCommand.click();
|
|
167
|
+
await waitForSourceIncludes("debug-command-output", 20_000);
|
|
168
|
+
await waitForSourceIncludes("ping", 20_000);
|
|
169
|
+
|
|
170
|
+
const resetLogs = await waitForLocator(
|
|
171
|
+
"debug-reset-logs",
|
|
172
|
+
byA11y("debug-reset-logs"),
|
|
173
|
+
);
|
|
174
|
+
if (!resetLogs) {
|
|
175
|
+
throw new Error("debug-reset-logs not found");
|
|
176
|
+
}
|
|
177
|
+
await resetLogs.click();
|
|
178
|
+
await waitForSourceIncludes("tauri_console_logs.jsonl", 20_000);
|
|
179
|
+
|
|
180
|
+
const appendLogs = await waitForLocator(
|
|
181
|
+
"debug-append-logs",
|
|
182
|
+
byA11y("debug-append-logs"),
|
|
183
|
+
);
|
|
184
|
+
if (!appendLogs) {
|
|
185
|
+
throw new Error("debug-append-logs not found");
|
|
186
|
+
}
|
|
187
|
+
await appendLogs.click();
|
|
188
|
+
await waitForSourceIncludes("tauri_console_logs.jsonl", 20_000);
|
|
189
|
+
|
|
190
|
+
const snapshot = await waitForLocator(
|
|
191
|
+
"debug-write-snapshot",
|
|
192
|
+
byA11y("debug-write-snapshot"),
|
|
193
|
+
);
|
|
194
|
+
if (!snapshot) {
|
|
195
|
+
throw new Error("debug-write-snapshot not found");
|
|
196
|
+
}
|
|
197
|
+
await snapshot.click();
|
|
198
|
+
await waitForSourceIncludes("tauri_debug_snapshot_", 20_000);
|
|
199
|
+
} finally {
|
|
200
|
+
await driver.quit();
|
|
201
|
+
}
|
|
202
|
+
}, 120_000);
|
|
203
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
import { Builder, By, until, type WebDriver } from "selenium-webdriver";
|
|
8
|
+
import { afterAll, beforeAll, describe, it } from "vitest";
|
|
9
|
+
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
const projectRoot = path.resolve(__dirname, "..");
|
|
13
|
+
const appDir = path.join(projectRoot, "src-tauri");
|
|
14
|
+
const appName = "examples-demo-app";
|
|
15
|
+
const binaryName = process.platform === "win32" ? `${appName}.exe` : appName;
|
|
16
|
+
const appPath = path.join(appDir, "target", "debug", binaryName);
|
|
17
|
+
const isMac = process.platform === "darwin";
|
|
18
|
+
|
|
19
|
+
const suite = isMac ? describe.skip : describe;
|
|
20
|
+
|
|
21
|
+
suite("Tauri E2E (tauri-driver)", () => {
|
|
22
|
+
let driver: WebDriver;
|
|
23
|
+
let tauriDriver: ReturnType<typeof spawn> | undefined;
|
|
24
|
+
|
|
25
|
+
beforeAll(async () => {
|
|
26
|
+
if (!existsSync(appPath)) {
|
|
27
|
+
throw new Error(`App binary not found: ${appPath}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
tauriDriver = spawn(
|
|
31
|
+
"tauri-driver",
|
|
32
|
+
["--port", "4444", "--native-port", "4445"],
|
|
33
|
+
{
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const capabilities = {
|
|
39
|
+
// Linux: requires webkitgtk runtime; Windows: uses WebView2 runtime.
|
|
40
|
+
browserName: process.platform === "linux" ? "webkitgtk" : "webview2",
|
|
41
|
+
"tauri:options": {
|
|
42
|
+
application: appPath,
|
|
43
|
+
args: [],
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
driver = await new Builder()
|
|
48
|
+
.usingServer("http://127.0.0.1:4444")
|
|
49
|
+
.withCapabilities(capabilities)
|
|
50
|
+
.build();
|
|
51
|
+
}, 60_000);
|
|
52
|
+
|
|
53
|
+
afterAll(async () => {
|
|
54
|
+
if (driver) {
|
|
55
|
+
await driver.quit();
|
|
56
|
+
}
|
|
57
|
+
if (tauriDriver && !tauriDriver.killed) {
|
|
58
|
+
tauriDriver.kill("SIGTERM");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("shows greet UI", async () => {
|
|
63
|
+
await driver.wait(until.elementLocated(By.css("body")), 10_000);
|
|
64
|
+
const title = await driver.getTitle();
|
|
65
|
+
assert.equal(title, "Tauri App");
|
|
66
|
+
|
|
67
|
+
const input = await driver.findElement(By.id("greet-input"));
|
|
68
|
+
await input.clear();
|
|
69
|
+
await input.sendKeys("Tauri");
|
|
70
|
+
|
|
71
|
+
const button = await driver.findElement(By.css("button[type='submit']"));
|
|
72
|
+
await button.click();
|
|
73
|
+
|
|
74
|
+
const message = await driver.wait(
|
|
75
|
+
until.elementLocated(By.id("greet-msg")),
|
|
76
|
+
5_000,
|
|
77
|
+
);
|
|
78
|
+
await driver.wait(
|
|
79
|
+
until.elementTextContains(message, "Hello, Tauri!"),
|
|
80
|
+
5_000,
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("debug tools work", async () => {
|
|
85
|
+
const capture = await driver.findElement(By.id("debug-capture"));
|
|
86
|
+
await capture.click();
|
|
87
|
+
const webviewOutput = await driver.findElement(
|
|
88
|
+
By.id("debug-webview-output"),
|
|
89
|
+
);
|
|
90
|
+
await driver.wait(
|
|
91
|
+
until.elementTextContains(webviewOutput, "Tauri App"),
|
|
92
|
+
10_000,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const getLogs = await driver.findElement(By.id("debug-get-logs"));
|
|
96
|
+
await getLogs.click();
|
|
97
|
+
const logsOutput = await driver.findElement(By.id("debug-logs-output"));
|
|
98
|
+
await driver.wait(until.elementTextContains(logsOutput, "[]"), 10_000);
|
|
99
|
+
|
|
100
|
+
const sendCommand = await driver.findElement(By.id("debug-send-command"));
|
|
101
|
+
await sendCommand.click();
|
|
102
|
+
const commandOutput = await driver.findElement(
|
|
103
|
+
By.id("debug-command-output"),
|
|
104
|
+
);
|
|
105
|
+
await driver.wait(until.elementTextContains(commandOutput, "ping"), 10_000);
|
|
106
|
+
|
|
107
|
+
const resetLogs = await driver.findElement(By.id("debug-reset-logs"));
|
|
108
|
+
await resetLogs.click();
|
|
109
|
+
await driver.wait(
|
|
110
|
+
until.elementTextContains(logsOutput, "tauri_console_logs.jsonl"),
|
|
111
|
+
10_000,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const appendLogs = await driver.findElement(By.id("debug-append-logs"));
|
|
115
|
+
await appendLogs.click();
|
|
116
|
+
await driver.wait(
|
|
117
|
+
until.elementTextContains(logsOutput, "tauri_console_logs.jsonl"),
|
|
118
|
+
10_000,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const snapshot = await driver.findElement(By.id("debug-write-snapshot"));
|
|
122
|
+
await snapshot.click();
|
|
123
|
+
const snapshotOutput = await driver.findElement(
|
|
124
|
+
By.id("debug-snapshot-output"),
|
|
125
|
+
);
|
|
126
|
+
await driver.wait(
|
|
127
|
+
until.elementTextContains(snapshotOutput, "tauri_debug_snapshot_"),
|
|
128
|
+
10_000,
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
});
|