@testdriverai/agent 7.11.232-test → 7.11.234-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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs draw.io (an open-source Electron diagram editor) on Linux, adds a
|
|
3
|
+
* rectangle to a blank diagram, labels it, and checks the result on the canvas.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
7
|
+
|
|
8
|
+
const DRAWIO_DEB =
|
|
9
|
+
"https://github.com/jgraph/drawio-desktop/releases/download/v32.5.5/drawio-amd64-32.5.5.deb";
|
|
10
|
+
|
|
11
|
+
describe("draw.io (Electron)", () => {
|
|
12
|
+
it("adds a labeled rectangle to a new diagram", async (context) => {
|
|
13
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP });
|
|
14
|
+
|
|
15
|
+
// Download and install the .deb. We start the app ourselves below.
|
|
16
|
+
await testdriver.provision.installer({ url: DRAWIO_DEB, launch: false });
|
|
17
|
+
|
|
18
|
+
// Pull in any missing runtime dependencies, then start draw.io.
|
|
19
|
+
await testdriver.exec(
|
|
20
|
+
"sh",
|
|
21
|
+
"sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -f -y -qq",
|
|
22
|
+
240000,
|
|
23
|
+
);
|
|
24
|
+
await testdriver.exec("sh", "nohup drawio >/tmp/drawio.log 2>&1 &", 10000);
|
|
25
|
+
|
|
26
|
+
// draw.io opens straight into a blank diagram. Wait for the window to appear.
|
|
27
|
+
await testdriver.find('"Untitled Diagram" title at the top left of the draw.io window', {
|
|
28
|
+
timeout: 60000,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Add a rectangle from the shape panel. It lands in the middle of the canvas.
|
|
32
|
+
await testdriver.find("plain rectangle shape, the first shape in the General section of the left shape panel").click();
|
|
33
|
+
|
|
34
|
+
// Double-click the rectangle to edit its label, type, then click away to commit.
|
|
35
|
+
await testdriver.find("the selected white rectangle in the middle of the canvas").doubleClick();
|
|
36
|
+
await testdriver.type("Checkout Service");
|
|
37
|
+
await testdriver.find("empty white grid area of the canvas below the rectangle").click();
|
|
38
|
+
|
|
39
|
+
// Wait for the labeled shape, then check what the app rendered.
|
|
40
|
+
await testdriver.find('rectangle on the canvas labeled "Checkout Service"', { timeout: 15000 });
|
|
41
|
+
const labeled = await testdriver.assert(
|
|
42
|
+
'the draw.io canvas shows a rectangle with the label "Checkout Service" and the label is not in edit mode',
|
|
43
|
+
);
|
|
44
|
+
expect(labeled).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
});
|