@xera-ai/web 0.2.0 → 0.2.1

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.
@@ -6,6 +6,7 @@ export interface RunPlaywrightInput {
6
6
  specPath: string;
7
7
  configPath: string;
8
8
  outputDir: string;
9
+ grep?: string;
9
10
  env?: NodeJS.ProcessEnv;
10
11
  spawn?: SpawnFn;
11
12
  }
@@ -2,5 +2,6 @@ export interface PlaywrightArgsInput {
2
2
  specPath: string;
3
3
  outputDir: string;
4
4
  configPath: string;
5
+ grep?: string;
5
6
  }
6
7
  export declare function buildPlaywrightArgs(input: PlaywrightArgsInput): string[];
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { join } from "path";
9
9
 
10
10
  // src/executor/playwright-args.ts
11
11
  function buildPlaywrightArgs(input) {
12
- return [
12
+ const args = [
13
13
  "test",
14
14
  input.specPath,
15
15
  `--config=${input.configPath}`,
@@ -17,6 +17,10 @@ function buildPlaywrightArgs(input) {
17
17
  `--output=${input.outputDir}`,
18
18
  "--trace=on"
19
19
  ];
20
+ if (input.grep) {
21
+ args.push("--grep", input.grep);
22
+ }
23
+ return args;
20
24
  }
21
25
 
22
26
  // src/executor/index.ts
@@ -29,7 +33,8 @@ async function runPlaywright(input) {
29
33
  const args = buildPlaywrightArgs({
30
34
  specPath: input.specPath,
31
35
  configPath: input.configPath,
32
- outputDir: input.outputDir
36
+ outputDir: input.outputDir,
37
+ ...input.grep && { grep: input.grep }
33
38
  });
34
39
  const spawn = input.spawn ?? defaultSpawn;
35
40
  const { exitCode } = await spawn("npx", ["playwright", ...args], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xera-ai/web",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,6 +10,7 @@ export interface RunPlaywrightInput {
10
10
  specPath: string;
11
11
  configPath: string;
12
12
  outputDir: string;
13
+ grep?: string;
13
14
  env?: NodeJS.ProcessEnv;
14
15
  spawn?: SpawnFn;
15
16
  }
@@ -31,6 +32,7 @@ export async function runPlaywright(input: RunPlaywrightInput): Promise<RunPlayw
31
32
  specPath: input.specPath,
32
33
  configPath: input.configPath,
33
34
  outputDir: input.outputDir,
35
+ ...(input.grep && { grep: input.grep }),
34
36
  });
35
37
  const spawn = input.spawn ?? defaultSpawn;
36
38
  const { exitCode } = await spawn('npx', ['playwright', ...args], {
@@ -2,10 +2,11 @@ export interface PlaywrightArgsInput {
2
2
  specPath: string;
3
3
  outputDir: string;
4
4
  configPath: string;
5
+ grep?: string;
5
6
  }
6
7
 
7
8
  export function buildPlaywrightArgs(input: PlaywrightArgsInput): string[] {
8
- return [
9
+ const args = [
9
10
  'test',
10
11
  input.specPath,
11
12
  `--config=${input.configPath}`,
@@ -13,4 +14,8 @@ export function buildPlaywrightArgs(input: PlaywrightArgsInput): string[] {
13
14
  `--output=${input.outputDir}`,
14
15
  '--trace=on',
15
16
  ];
17
+ if (input.grep) {
18
+ args.push('--grep', input.grep);
19
+ }
20
+ return args;
16
21
  }