@testdriverai/agent 7.11.246-test → 7.11.248-test
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.
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs qBittorrent (a Qt desktop app) on Linux, turns on its Web UI on port 9090,
|
|
3
|
+
* and reopens Preferences to check the setting was saved.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
7
|
+
|
|
8
|
+
describe("qBittorrent (Qt)", () => {
|
|
9
|
+
it("saves a new Web UI port in Preferences", async (context) => {
|
|
10
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP });
|
|
11
|
+
|
|
12
|
+
// Install qBittorrent from the Ubuntu archive.
|
|
13
|
+
await testdriver.exec(
|
|
14
|
+
"sh",
|
|
15
|
+
"sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq qbittorrent",
|
|
16
|
+
300000,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
// Start the replay recording, then launch the app.
|
|
20
|
+
await testdriver.provision.dashcam({ title: "qBittorrent (Qt) Web UI port", webLogs: false });
|
|
21
|
+
await testdriver.exec("sh", "nohup qbittorrent >/tmp/qbittorrent.log 2>&1 &", 10000);
|
|
22
|
+
|
|
23
|
+
// The first launch shows a legal notice. Wait for it and accept.
|
|
24
|
+
await testdriver.find("the I Agree button in the qBittorrent Legal Notice dialog", { timeout: 60000 }).click();
|
|
25
|
+
|
|
26
|
+
// Open Tools > Preferences and go to the Web UI page.
|
|
27
|
+
await testdriver.find("the Tools menu in the qBittorrent menu bar").click();
|
|
28
|
+
await testdriver.find("the Preferences item in the open Tools menu").click();
|
|
29
|
+
await testdriver.find("the Web UI section in the left sidebar of the Preferences dialog").click();
|
|
30
|
+
|
|
31
|
+
// Turn on the Web UI and change its port from 8080 to 9090.
|
|
32
|
+
await testdriver.find("the Web User Interface (Remote control) checkbox at the top of the Web UI page").click();
|
|
33
|
+
await testdriver.find("the Port field showing 8080 next to the IP address field on the Web UI page").click();
|
|
34
|
+
await testdriver.pressKeys(["ctrl", "a"]);
|
|
35
|
+
await testdriver.type("9090");
|
|
36
|
+
|
|
37
|
+
// Save and close.
|
|
38
|
+
await testdriver.find("the OK button with a green checkmark at the bottom right of the Preferences dialog").click();
|
|
39
|
+
|
|
40
|
+
// Reopen Preferences on the Web UI page.
|
|
41
|
+
await testdriver.find("the Tools menu in the qBittorrent menu bar").click();
|
|
42
|
+
await testdriver.find("the Preferences item in the open Tools menu").click();
|
|
43
|
+
await testdriver.find("the Web UI section in the left sidebar of the Preferences dialog").click();
|
|
44
|
+
|
|
45
|
+
// Wait for the saved port, then check both settings stuck.
|
|
46
|
+
await testdriver.find("the Port field showing 9090 on the Web UI page", { timeout: 15000 });
|
|
47
|
+
const saved = await testdriver.assert(
|
|
48
|
+
"the qBittorrent Preferences dialog shows the Web UI page with the Web User Interface (Remote control) checkbox checked and the Port field set to 9090",
|
|
49
|
+
);
|
|
50
|
+
expect(saved).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
});
|