testdriverai 7.2.21 → 7.2.22

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.
@@ -142,11 +142,9 @@ export default defineConfig({
142
142
 
143
143
  ### Test Helpers
144
144
 
145
- - ✅ **Updated**: `testdriver/acceptance-sdk/setup/testHelpers.mjs`
146
- - Removed temp file writing
147
- - Removed `__testdriverRegistry` initialization
148
- - Removed `__testdriverMeta` initialization
149
- - Uses `globalThis.__testdriverPlugin.registerDashcamUrl()` instead
145
+ - ✅ **Removed**: `test/testdriver/setup/` folder (legacy helpers)
146
+ - Code moved to `lib/vitest/hooks.mjs` framework
147
+ - Tests now use `TestDriver(context, options)` pattern directly
150
148
 
151
149
  ### Documentation
152
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "7.2.21",
3
+ "version": "7.2.22",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "sdk.js",
6
6
  "exports": {
@@ -5,7 +5,25 @@
5
5
 
6
6
  import { describe, expect, it } from "vitest";
7
7
  import { TestDriver } from "../../lib/vitest/hooks.mjs";
8
- import { performLogin } from "./setup/testHelpers.mjs";
8
+
9
+ /**
10
+ * Perform login flow for SauceLabs demo app
11
+ * @param {TestDriver} client - TestDriver client
12
+ * @param {string} username - Username (default: 'standard_user')
13
+ */
14
+ async function performLogin(client, username = "standard_user") {
15
+ await client.focusApplication("Google Chrome");
16
+ const password = await client.extract("the password");
17
+ const usernameField = await client.find(
18
+ "Username, label above the username input field on the login form",
19
+ );
20
+ await usernameField.click();
21
+ await client.type(username);
22
+ await client.pressKeys(["tab"]);
23
+ await client.type(password, { secret: true });
24
+ await client.pressKeys(["tab"]);
25
+ await client.pressKeys(["enter"]);
26
+ }
9
27
 
10
28
  describe("Hover Image Test", () => {
11
29
  it("should click on shopping cart icon and verify empty cart", async (context) => {
@@ -5,7 +5,25 @@
5
5
 
6
6
  import { describe, expect, it } from "vitest";
7
7
  import { TestDriver } from "../../lib/vitest/hooks.mjs";
8
- import { performLogin } from "./setup/testHelpers.mjs";
8
+
9
+ /**
10
+ * Perform login flow for SauceLabs demo app
11
+ * @param {TestDriver} client - TestDriver client
12
+ * @param {string} username - Username (default: 'standard_user')
13
+ */
14
+ async function performLogin(client, username = "standard_user") {
15
+ await client.focusApplication("Google Chrome");
16
+ const password = await client.extract("the password");
17
+ const usernameField = await client.find(
18
+ "Username, label above the username input field on the login form",
19
+ );
20
+ await usernameField.click();
21
+ await client.type(username);
22
+ await client.pressKeys(["tab"]);
23
+ await client.type(password, { secret: true });
24
+ await client.pressKeys(["tab"]);
25
+ await client.pressKeys(["enter"]);
26
+ }
9
27
 
10
28
  describe("Hover Text With Description Test", () => {
11
29
  it("should add TestDriver Hat to cart and verify", async (context) => {
@@ -7,7 +7,25 @@ import path, { dirname } from "path";
7
7
  import { fileURLToPath } from "url";
8
8
  import { describe, expect, it } from "vitest";
9
9
  import { TestDriver } from "../../lib/vitest/hooks.mjs";
10
- import { performLogin } from "./setup/testHelpers.mjs";
10
+
11
+ /**
12
+ * Perform login flow for SauceLabs demo app
13
+ * @param {TestDriver} client - TestDriver client
14
+ * @param {string} username - Username (default: 'standard_user')
15
+ */
16
+ async function performLogin(client, username = "standard_user") {
17
+ await client.focusApplication("Google Chrome");
18
+ const password = await client.extract("the password");
19
+ const usernameField = await client.find(
20
+ "Username, label above the username input field on the login form",
21
+ );
22
+ await usernameField.click();
23
+ await client.type(username);
24
+ await client.pressKeys(["tab"]);
25
+ await client.type(password, { secret: true });
26
+ await client.pressKeys(["tab"]);
27
+ await client.pressKeys(["enter"]);
28
+ }
11
29
 
12
30
  // Get the directory of the current module
13
31
  const __filename = fileURLToPath(import.meta.url);
@@ -5,7 +5,25 @@
5
5
 
6
6
  import { describe, expect, it } from "vitest";
7
7
  import { TestDriver } from "../../lib/vitest/hooks.mjs";
8
- import { performLogin } from "./setup/testHelpers.mjs";
8
+
9
+ /**
10
+ * Perform login flow for SauceLabs demo app
11
+ * @param {TestDriver} client - TestDriver client
12
+ * @param {string} username - Username (default: 'standard_user')
13
+ */
14
+ async function performLogin(client, username = "standard_user") {
15
+ await client.focusApplication("Google Chrome");
16
+ const password = await client.extract("the password");
17
+ const usernameField = await client.find(
18
+ "Username, label above the username input field on the login form",
19
+ );
20
+ await usernameField.click();
21
+ await client.type(username);
22
+ await client.pressKeys(["tab"]);
23
+ await client.type(password, { secret: true });
24
+ await client.pressKeys(["tab"]);
25
+ await client.pressKeys(["enter"]);
26
+ }
9
27
 
10
28
  describe("Scroll Until Text Test", () => {
11
29
  it('should scroll until "testdriver socks" appears', async (context) => {