1- export const PAGE_TRANSITION_COMMANDS = [
2- 'url' ,
3- 'navigateTo' ,
4- 'click' ,
5- 'submitForm'
6- ] as const
7-
81/**
92 * Internal Nightwatch commands to exclude from capture
10- * These are helper/platform detection commands not relevant to users
113 */
124export const INTERNAL_COMMANDS_TO_IGNORE = [
135 'isAppiumClient' ,
@@ -36,14 +28,8 @@ export const INTERNAL_COMMANDS_TO_IGNORE = [
3628 'executeScript'
3729] as const
3830
39- /**
40- * Console method types for log capturing
41- */
4231export const CONSOLE_METHODS = [ 'log' , 'info' , 'warn' , 'error' ] as const
4332
44- /**
45- * Log level detection patterns
46- */
4733export const LOG_LEVEL_PATTERNS : ReadonlyArray < {
4834 level : 'trace' | 'debug' | 'info' | 'warn' | 'error'
4935 pattern : RegExp
@@ -55,28 +41,14 @@ export const LOG_LEVEL_PATTERNS: ReadonlyArray<{
5541 { level : 'error' , pattern : / \b e r r o r \b / i }
5642] as const
5743
58- /**
59- * Console log source types
60- */
6144export const LOG_SOURCES = {
6245 BROWSER : 'browser' ,
6346 TEST : 'test' ,
6447 TERMINAL : 'terminal'
6548} as const
6649
67- /**
68- * ANSI escape code regex - matches all ANSI escape sequences including:
69- * - Color codes: \x1b[36m, \x1b[39m
70- * - Cursor control: \x1b[2K, \x1b[1G, \x1b[1A
71- * - Cursor visibility: \x1b[?25l, \x1b[?25h
72- * - SGR parameters: \x1b[1m, \x1b[22m
73- * Pattern: ESC [ (optional ?)(digits/semicolons)(letter)
74- */
7550export const ANSI_REGEX = / \x1b \[ [ ? ] ? [ 0 - 9 ; ] * [ A - Z a - z ] / g
7651
77- /**
78- * Default values
79- */
8052export const DEFAULTS = {
8153 CID : '0-0' ,
8254 TEST_NAME : 'unknown' ,
@@ -85,9 +57,7 @@ export const DEFAULTS = {
8557 DURATION : 0
8658} as const
8759
88- /**
89- * Timing constants (in milliseconds)
90- */
60+ /** Timing constants (in milliseconds) */
9161export const TIMING = {
9262 UI_RENDER_DELAY : 150 ,
9363 TEST_START_DELAY : 100 ,
@@ -98,9 +68,6 @@ export const TIMING = {
9868 BROWSER_POLL_INTERVAL : 1000
9969} as const
10070
101- /**
102- * Test states
103- */
10471export const TEST_STATE = {
10572 PENDING : 'pending' ,
10673 RUNNING : 'running' ,
@@ -109,9 +76,13 @@ export const TEST_STATE = {
10976 SKIPPED : 'skipped'
11077} as const
11178
112- export type TestState = ( typeof TEST_STATE ) [ keyof typeof TEST_STATE ]
113-
11479/**
115- * Temporary UID generation pattern
80+ * Generic pattern matching Nightwatch commands whose result is a boolean.
11681 */
117- export const TEMP_UID_PREFIX = 'temp'
82+ export const BOOLEAN_COMMAND_PATTERN =
83+ / ^ w a i t F o r | ^ i s [ A - Z ] | ^ h a s [ A - Z ] | ( V i s i b l e | P r e s e n t | E n a b l e d | S e l e c t e d | N o t V i s i b l e | N o t P r e s e n t ) $ /
84+
85+ export const NAVIGATION_COMMANDS = [ 'url' , 'navigate' , 'navigateTo' ] as const
86+
87+ /** Spinner progress frames — suppress from UI Console output. */
88+ export const SPINNER_RE = / ^ [ ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ] / u
0 commit comments