@nsxbet/playwright-orchestrator 0.4.0 → 0.4.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.
|
@@ -17,10 +17,20 @@ export declare function escapeRegex(str: string): string;
|
|
|
17
17
|
* @returns The test title
|
|
18
18
|
*/
|
|
19
19
|
export declare function extractTitleFromTestId(testId: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Extract the full title path from a test ID
|
|
22
|
+
* The full title path includes all describe blocks and test title,
|
|
23
|
+
* joined with ' › ' as Playwright does internally.
|
|
24
|
+
*
|
|
25
|
+
* @param testId - Test ID in format file::describe::testTitle
|
|
26
|
+
* @returns The full title path (e.g., "BetSlip v2 › should show message")
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractFullTitleFromTestId(testId: string): string;
|
|
20
29
|
/**
|
|
21
30
|
* Generate a grep pattern from a list of test IDs
|
|
22
31
|
*
|
|
23
|
-
* Uses the
|
|
32
|
+
* Uses the full title path (describe blocks + test title) for matching.
|
|
33
|
+
* This ensures exact matching even for tests with the same name in different describe blocks.
|
|
24
34
|
* Escapes regex special characters to ensure exact matching.
|
|
25
35
|
*
|
|
26
36
|
* @param testIds - List of test IDs to include in pattern
|
|
@@ -45,7 +55,7 @@ export declare function isPatternTooLong(pattern: string): boolean;
|
|
|
45
55
|
* Generate content for a grep-file (one pattern per line)
|
|
46
56
|
*
|
|
47
57
|
* @param testIds - List of test IDs
|
|
48
|
-
* @returns File content with one escaped title per line
|
|
58
|
+
* @returns File content with one escaped full title per line
|
|
49
59
|
*/
|
|
50
60
|
export declare function generateGrepFileContent(testIds: string[]): string;
|
|
51
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grep-pattern.d.ts","sourceRoot":"","sources":["../../src/core/grep-pattern.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED
|
|
1
|
+
{"version":3,"file":"grep-pattern.d.ts","sourceRoot":"","sources":["../../src/core/grep-pattern.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAY7D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAOjE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IACxD,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAeA"}
|
|
@@ -27,10 +27,23 @@ export function extractTitleFromTestId(testId) {
|
|
|
27
27
|
const { titlePath } = parseTestId(testId);
|
|
28
28
|
return titlePath[titlePath.length - 1] || testId;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Extract the full title path from a test ID
|
|
32
|
+
* The full title path includes all describe blocks and test title,
|
|
33
|
+
* joined with ' › ' as Playwright does internally.
|
|
34
|
+
*
|
|
35
|
+
* @param testId - Test ID in format file::describe::testTitle
|
|
36
|
+
* @returns The full title path (e.g., "BetSlip v2 › should show message")
|
|
37
|
+
*/
|
|
38
|
+
export function extractFullTitleFromTestId(testId) {
|
|
39
|
+
const { titlePath } = parseTestId(testId);
|
|
40
|
+
return titlePath.join(' › ') || testId;
|
|
41
|
+
}
|
|
30
42
|
/**
|
|
31
43
|
* Generate a grep pattern from a list of test IDs
|
|
32
44
|
*
|
|
33
|
-
* Uses the
|
|
45
|
+
* Uses the full title path (describe blocks + test title) for matching.
|
|
46
|
+
* This ensures exact matching even for tests with the same name in different describe blocks.
|
|
34
47
|
* Escapes regex special characters to ensure exact matching.
|
|
35
48
|
*
|
|
36
49
|
* @param testIds - List of test IDs to include in pattern
|
|
@@ -41,8 +54,8 @@ export function generateGrepPattern(testIds) {
|
|
|
41
54
|
return '';
|
|
42
55
|
}
|
|
43
56
|
const titles = testIds.map((id) => {
|
|
44
|
-
const
|
|
45
|
-
return escapeRegex(
|
|
57
|
+
const fullTitle = extractFullTitleFromTestId(id);
|
|
58
|
+
return escapeRegex(fullTitle);
|
|
46
59
|
});
|
|
47
60
|
// Use OR operator to match any of the titles
|
|
48
61
|
return titles.join('|');
|
|
@@ -73,12 +86,12 @@ export function isPatternTooLong(pattern) {
|
|
|
73
86
|
* Generate content for a grep-file (one pattern per line)
|
|
74
87
|
*
|
|
75
88
|
* @param testIds - List of test IDs
|
|
76
|
-
* @returns File content with one escaped title per line
|
|
89
|
+
* @returns File content with one escaped full title per line
|
|
77
90
|
*/
|
|
78
91
|
export function generateGrepFileContent(testIds) {
|
|
79
92
|
const titles = testIds.map((id) => {
|
|
80
|
-
const
|
|
81
|
-
return escapeRegex(
|
|
93
|
+
const fullTitle = extractFullTitleFromTestId(id);
|
|
94
|
+
return escapeRegex(fullTitle);
|
|
82
95
|
});
|
|
83
96
|
return titles.join('\n');
|
|
84
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grep-pattern.js","sourceRoot":"","sources":["../../src/core/grep-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC;AACnD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"grep-pattern.js","sourceRoot":"","sources":["../../src/core/grep-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,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