@nsxbet/playwright-orchestrator 0.4.1 → 0.5.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.
- package/README.md +54 -7
- package/dist/commands/assign.d.ts.map +1 -1
- package/dist/commands/assign.js +7 -48
- package/dist/commands/assign.js.map +1 -1
- package/dist/commands/extract-timing.d.ts +1 -12
- package/dist/commands/extract-timing.d.ts.map +1 -1
- package/dist/commands/extract-timing.js +15 -84
- package/dist/commands/extract-timing.js.map +1 -1
- package/dist/commands/merge-timing.d.ts +1 -4
- package/dist/commands/merge-timing.d.ts.map +1 -1
- package/dist/commands/merge-timing.js +11 -106
- package/dist/commands/merge-timing.js.map +1 -1
- package/dist/core/estimate.d.ts +9 -9
- package/dist/core/estimate.d.ts.map +1 -1
- package/dist/core/estimate.js +4 -4
- package/dist/core/estimate.js.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/test-discovery.d.ts.map +1 -1
- package/dist/core/test-discovery.js +7 -4
- package/dist/core/test-discovery.js.map +1 -1
- package/dist/core/timing-store.d.ts +16 -36
- package/dist/core/timing-store.d.ts.map +1 -1
- package/dist/core/timing-store.js +21 -140
- package/dist/core/timing-store.js.map +1 -1
- package/dist/core/types.d.ts +7 -67
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -32
- package/dist/core/types.js.map +1 -1
- package/dist/reporter.d.ts +40 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/reporter.js +73 -0
- package/dist/reporter.js.map +1 -0
- package/package.json +22 -1
- package/dist/core/grep-pattern.d.ts +0 -71
- package/dist/core/grep-pattern.d.ts.map +0 -1
- package/dist/core/grep-pattern.js +0 -117
- package/dist/core/grep-pattern.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maximum length for a grep pattern before switching to grep-file
|
|
3
|
-
*/
|
|
4
|
-
export declare const MAX_GREP_PATTERN_LENGTH = 4000;
|
|
5
|
-
/**
|
|
6
|
-
* Escape regex special characters in a string
|
|
7
|
-
*
|
|
8
|
-
* @param str - String to escape
|
|
9
|
-
* @returns Escaped string safe for use in regex
|
|
10
|
-
*/
|
|
11
|
-
export declare function escapeRegex(str: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Extract the test title from a test ID
|
|
14
|
-
* The title is the last part of the titlePath
|
|
15
|
-
*
|
|
16
|
-
* @param testId - Test ID in format file::describe::testTitle
|
|
17
|
-
* @returns The test title
|
|
18
|
-
*/
|
|
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;
|
|
29
|
-
/**
|
|
30
|
-
* Generate a grep pattern from a list of test IDs
|
|
31
|
-
*
|
|
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.
|
|
34
|
-
* Escapes regex special characters to ensure exact matching.
|
|
35
|
-
*
|
|
36
|
-
* @param testIds - List of test IDs to include in pattern
|
|
37
|
-
* @returns Grep pattern string that matches any of the tests
|
|
38
|
-
*/
|
|
39
|
-
export declare function generateGrepPattern(testIds: string[]): string;
|
|
40
|
-
/**
|
|
41
|
-
* Generate grep patterns for multiple shards
|
|
42
|
-
*
|
|
43
|
-
* @param shardTests - Map of shard index to list of test IDs
|
|
44
|
-
* @returns Map of shard index to grep pattern
|
|
45
|
-
*/
|
|
46
|
-
export declare function generateGrepPatterns(shardTests: Record<number, string[]>): Record<number, string>;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a grep pattern is too long and should use --grep-file instead
|
|
49
|
-
*
|
|
50
|
-
* @param pattern - Grep pattern to check
|
|
51
|
-
* @returns True if pattern exceeds maximum length
|
|
52
|
-
*/
|
|
53
|
-
export declare function isPatternTooLong(pattern: string): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Generate content for a grep-file (one pattern per line)
|
|
56
|
-
*
|
|
57
|
-
* @param testIds - List of test IDs
|
|
58
|
-
* @returns File content with one escaped full title per line
|
|
59
|
-
*/
|
|
60
|
-
export declare function generateGrepFileContent(testIds: string[]): string;
|
|
61
|
-
/**
|
|
62
|
-
* Determine the best grep strategy for a list of tests
|
|
63
|
-
*
|
|
64
|
-
* @param testIds - List of test IDs
|
|
65
|
-
* @returns Object with strategy ('pattern' or 'file') and content
|
|
66
|
-
*/
|
|
67
|
-
export declare function determineGrepStrategy(testIds: string[]): {
|
|
68
|
-
strategy: 'pattern' | 'file';
|
|
69
|
-
content: string;
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=grep-pattern.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { parseTestId } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Regex special characters that need escaping in grep patterns
|
|
4
|
-
*/
|
|
5
|
-
const REGEX_SPECIAL_CHARS = /[.*+?^${}()|[\]\\]/g;
|
|
6
|
-
/**
|
|
7
|
-
* Maximum length for a grep pattern before switching to grep-file
|
|
8
|
-
*/
|
|
9
|
-
export const MAX_GREP_PATTERN_LENGTH = 4000;
|
|
10
|
-
/**
|
|
11
|
-
* Escape regex special characters in a string
|
|
12
|
-
*
|
|
13
|
-
* @param str - String to escape
|
|
14
|
-
* @returns Escaped string safe for use in regex
|
|
15
|
-
*/
|
|
16
|
-
export function escapeRegex(str) {
|
|
17
|
-
return str.replace(REGEX_SPECIAL_CHARS, '\\$&');
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extract the test title from a test ID
|
|
21
|
-
* The title is the last part of the titlePath
|
|
22
|
-
*
|
|
23
|
-
* @param testId - Test ID in format file::describe::testTitle
|
|
24
|
-
* @returns The test title
|
|
25
|
-
*/
|
|
26
|
-
export function extractTitleFromTestId(testId) {
|
|
27
|
-
const { titlePath } = parseTestId(testId);
|
|
28
|
-
return titlePath[titlePath.length - 1] || testId;
|
|
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
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Generate a grep pattern from a list of test IDs
|
|
44
|
-
*
|
|
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.
|
|
47
|
-
* Escapes regex special characters to ensure exact matching.
|
|
48
|
-
*
|
|
49
|
-
* @param testIds - List of test IDs to include in pattern
|
|
50
|
-
* @returns Grep pattern string that matches any of the tests
|
|
51
|
-
*/
|
|
52
|
-
export function generateGrepPattern(testIds) {
|
|
53
|
-
if (testIds.length === 0) {
|
|
54
|
-
return '';
|
|
55
|
-
}
|
|
56
|
-
const titles = testIds.map((id) => {
|
|
57
|
-
const fullTitle = extractFullTitleFromTestId(id);
|
|
58
|
-
return escapeRegex(fullTitle);
|
|
59
|
-
});
|
|
60
|
-
// Use OR operator to match any of the titles
|
|
61
|
-
return titles.join('|');
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Generate grep patterns for multiple shards
|
|
65
|
-
*
|
|
66
|
-
* @param shardTests - Map of shard index to list of test IDs
|
|
67
|
-
* @returns Map of shard index to grep pattern
|
|
68
|
-
*/
|
|
69
|
-
export function generateGrepPatterns(shardTests) {
|
|
70
|
-
const patterns = {};
|
|
71
|
-
for (const [shardIndex, testIds] of Object.entries(shardTests)) {
|
|
72
|
-
patterns[Number(shardIndex)] = generateGrepPattern(testIds);
|
|
73
|
-
}
|
|
74
|
-
return patterns;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Check if a grep pattern is too long and should use --grep-file instead
|
|
78
|
-
*
|
|
79
|
-
* @param pattern - Grep pattern to check
|
|
80
|
-
* @returns True if pattern exceeds maximum length
|
|
81
|
-
*/
|
|
82
|
-
export function isPatternTooLong(pattern) {
|
|
83
|
-
return pattern.length > MAX_GREP_PATTERN_LENGTH;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Generate content for a grep-file (one pattern per line)
|
|
87
|
-
*
|
|
88
|
-
* @param testIds - List of test IDs
|
|
89
|
-
* @returns File content with one escaped full title per line
|
|
90
|
-
*/
|
|
91
|
-
export function generateGrepFileContent(testIds) {
|
|
92
|
-
const titles = testIds.map((id) => {
|
|
93
|
-
const fullTitle = extractFullTitleFromTestId(id);
|
|
94
|
-
return escapeRegex(fullTitle);
|
|
95
|
-
});
|
|
96
|
-
return titles.join('\n');
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Determine the best grep strategy for a list of tests
|
|
100
|
-
*
|
|
101
|
-
* @param testIds - List of test IDs
|
|
102
|
-
* @returns Object with strategy ('pattern' or 'file') and content
|
|
103
|
-
*/
|
|
104
|
-
export function determineGrepStrategy(testIds) {
|
|
105
|
-
if (testIds.length === 0) {
|
|
106
|
-
return { strategy: 'pattern', content: '' };
|
|
107
|
-
}
|
|
108
|
-
const pattern = generateGrepPattern(testIds);
|
|
109
|
-
if (isPatternTooLong(pattern)) {
|
|
110
|
-
return {
|
|
111
|
-
strategy: 'file',
|
|
112
|
-
content: generateGrepFileContent(testIds),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return { strategy: 'pattern', content: pattern };
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=grep-pattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep-pattern.js","sourceRoot":"","sources":["../../src/core/grep-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM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