testdriverai 7.2.34 → 7.2.35
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/package.json
CHANGED
|
@@ -30,9 +30,8 @@ describe("Scroll Keyboard Test", () => {
|
|
|
30
30
|
await testdriver.scroll("down", { amount: 1000 });
|
|
31
31
|
|
|
32
32
|
// Assert the page is scrolled down
|
|
33
|
-
const result = await testdriver.assert(
|
|
34
|
-
|
|
35
|
-
);
|
|
33
|
+
const result = await testdriver.assert("the page is scrolled down, the hamster dance h1 text heading is not visible on the webpage");
|
|
34
|
+
|
|
36
35
|
expect(result).toBeTruthy();
|
|
37
36
|
});
|
|
38
37
|
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Example test demonstrating GitHub comment integration
|
|
3
|
-
*
|
|
4
|
-
* When run in CI with proper environment variables set, this will:
|
|
5
|
-
* 1. Run the tests
|
|
6
|
-
* 2. Record dashcam replays
|
|
7
|
-
* 3. Post a beautiful GitHub comment with results
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { describe, expect, it } from "vitest";
|
|
11
|
-
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
12
|
-
|
|
13
|
-
describe("GitHub Comment Demo", () => {
|
|
14
|
-
it("should pass with dashcam replay", async (context) => {
|
|
15
|
-
const testdriver = TestDriver(context, { headless: true });
|
|
16
|
-
|
|
17
|
-
await testdriver.provision.chrome({
|
|
18
|
-
url: 'https://www.example.com',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const heading = await testdriver.find("heading with Example Domain");
|
|
22
|
-
const result = await testdriver.assert("I can see 'Example Domain' heading");
|
|
23
|
-
expect(result).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("should demonstrate failure handling", async (context) => {
|
|
27
|
-
const testdriver = TestDriver(context, { headless: true });
|
|
28
|
-
|
|
29
|
-
await testdriver.provision.chrome({
|
|
30
|
-
url: 'https://www.example.com',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// This will fail intentionally to show error reporting
|
|
34
|
-
const result = await testdriver.assert("I can see a navigation menu with 20 items");
|
|
35
|
-
expect(result).toBeTruthy(); // This will fail
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should skip when needed", async (context) => {
|
|
39
|
-
// Skipped tests show in the summary
|
|
40
|
-
context.skip();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TestDriver SDK - Reconnect Test Part 2: Sign In
|
|
3
|
-
*
|
|
4
|
-
* This test reconnects to the sandbox provisioned by reconnect-provision.test.mjs
|
|
5
|
-
* and clicks the Sign In button.
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: Run this within 2 minutes of reconnect-provision.test.mjs completing.
|
|
8
|
-
* The sandbox auto-terminates after the keepAlive TTL (default 2 minutes).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* 1. npm test -- test/testdriver/reconnect-provision.test.mjs
|
|
12
|
-
* 2. (within 2 minutes) npm test -- test/testdriver/reconnect-signin.test.mjs
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { describe, expect, it } from "vitest";
|
|
16
|
-
import { TestDriver } from "../../lib/vitest/hooks.mjs";
|
|
17
|
-
|
|
18
|
-
describe("Reconnect Test - Part 2: Sign In", () => {
|
|
19
|
-
|
|
20
|
-
it("should reconnect to existing sandbox and click Sign In", async (context) => {
|
|
21
|
-
|
|
22
|
-
const testdriver = TestDriver(context, { newSandbox: true, headless: false, reconnect: true });
|
|
23
|
-
|
|
24
|
-
// Provision Chrome and navigate to login page
|
|
25
|
-
await testdriver.provision.chrome({
|
|
26
|
-
url: 'http://testdriver-sandbox.vercel.app/login',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Click on Sign In button - the page should already be loaded from provision test
|
|
30
|
-
const signInButton = await testdriver.find(
|
|
31
|
-
"Sign In, black button below the password field",
|
|
32
|
-
);
|
|
33
|
-
await signInButton.click();
|
|
34
|
-
|
|
35
|
-
// Assert that an error shows that fields are required
|
|
36
|
-
const result = await testdriver.assert(
|
|
37
|
-
"an error shows that fields are required",
|
|
38
|
-
);
|
|
39
|
-
expect(result).toBeTruthy();
|
|
40
|
-
});
|
|
41
|
-
});
|