@empiricalrun/test-gen 0.17.0 → 0.17.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.17.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [1c3fb96]
8
+ - @empiricalrun/reporter@0.11.2
9
+
10
+ ## 0.17.1
11
+
12
+ ### Patch Changes
13
+
14
+ - ac0256e: feat: remove support for update flag in test gen
15
+
3
16
  ## 0.17.0
4
17
 
5
18
  ### Minor Changes
package/README.md CHANGED
@@ -8,61 +8,29 @@ Our agents that generate Playwright tests. There are 2 agents
8
8
  ## Usage
9
9
 
10
10
  ```sh
11
- npx @empiricalrun/test-gen $args
11
+ npx @empiricalrun/test-gen TEST_GEN_TOKEN
12
12
  ```
13
13
 
14
- where `$args` can be one of the following
15
-
16
14
  ### Add new test
17
15
 
18
16
  ```sh
19
- npx @empiricalrun/test-gen base64string
17
+ npx @empiricalrun/test-gen TEST_GEN_TOKEN
20
18
  ```
21
19
 
22
20
  - This will trigger browsing agent to write a new test for this scenario
23
- - See [Base64 payload](#base64-payload)
24
-
25
- ```sh
26
- npx @empiricalrun/test-gen delete.spec.ts
27
- ```
28
-
29
- - This will trigger browsing agent to write a new test in this file
30
- - **Note** that the file must have `createTest(...)` where the scenario is specified
31
-
32
- #### Bulk add
33
-
34
- ```sh
35
- npx @empiricalrun/test-gen scenarios.yml
36
-
37
- # optional: filter for one scenario
38
- npx @empiricalrun/test-gen scenarios.yml $scenario_name
39
- ```
40
-
41
- Using yml or google spreadsheet. **Note** that this only runs the code editing agent
42
-
43
- ```yaml ./tests/scenarios.yaml
44
- dir: ./tests/ # [optional] directory where you want to create tests. Default - ./tests
45
- scenarios: # list of scenarios
46
- - name: user should be able to login successfully # name of the test case to be generated
47
- steps: # steps for the test case
48
- - cLick on "Login" button
49
- - click on input "username"
50
- - fill username as "foo@bar.com"
51
- - fill password as "bar@123"
52
- - click on "Login Button"
53
- assert: "Login successful" text should be visible # assertion
54
- ```
21
+ - See [Test gen token: Base64 payload](#test-gen-token-base64-payload)
55
22
 
56
23
  ### Update existing test
57
24
 
58
25
  ```sh
59
- npx @empiricalrun/test-gen base64string -u
26
+ npx @empiricalrun/test-gen TEST_GEN_TOKEN
60
27
  ```
61
28
 
29
+ - If the test case is already present in the file, the test gen agent will update the existing test as per the steps provided in the payload
62
30
  - This will trigger code editing agent to write a new test for this scenario
63
- - See [Base64 payload](#base64-payload)
31
+ - See [Test gen token: Base64 payload](#test-gen-token-base64-payload)
64
32
 
65
- ### Base64 payload
33
+ ### Test gen token: Base64 payload
66
34
 
67
35
  Convert this object into a base64 payload - for new and update test.
68
36
 
@@ -72,10 +40,10 @@ const scenario = {
72
40
  steps: [
73
41
  "fill in the username as foobar@gmail.com",
74
42
  "fill in the password as bazbaz",
75
- "click on the login button"
43
+ "click on the login button",
76
44
  ],
77
45
  assert: "",
78
- group: "home"
46
+ group: "home",
79
47
  };
80
- btoa(JSON.stringify(scenario))
48
+ btoa(JSON.stringify(scenario));
81
49
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CA+IrB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CA8IrB"}
@@ -35,7 +35,6 @@ async function generateTest(testCase, file, options) {
35
35
  },
36
36
  });
37
37
  trace.update({ input: { testCase } });
38
- logger.log("Generating test for scenario:", testCase?.name);
39
38
  const isUpdate = testFileContent.includes(`test("${testCase?.name}"`);
40
39
  const promptSpan = trace.startSpan(isUpdate ? "update-scenario-prompt" : "add-scenario-prompt");
41
40
  const promptName = isUpdate ? "update-scenario" : "add-scenario";
package/dist/bin/index.js CHANGED
@@ -39,7 +39,7 @@ async function runAgent(sourceFile, testGenConfig) {
39
39
  (async function main() {
40
40
  const logger = new logger_1.CustomLogger({ useReporter: false });
41
41
  if (process.argv.length < 3) {
42
- logger.error("Please provide path to scenarios using command:", "npx @empiricalrun/test-gen <SCENARIOS_FILE_PATH> -u");
42
+ logger.error("Please provide path to scenarios using command:", "npx @empiricalrun/test-gen <TEST_GEN_TOKEN>");
43
43
  process.exit(1);
44
44
  }
45
45
  const { sourceFile, testGenConfig } = await (0, utils_2.parseCliArgs)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -40,7 +40,7 @@
40
40
  "tsx": "^4.16.2",
41
41
  "typescript": "^5.3.3",
42
42
  "@empiricalrun/llm": "^0.2.0",
43
- "@empiricalrun/reporter": "^0.11.1"
43
+ "@empiricalrun/reporter": "^0.11.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/detect-port": "^1.3.5",