Skip to content

Commit 2688478

Browse files
Copilotkobenguyent
andcommitted
Remove debug logging from custom locator registration
Co-authored-by: kobenguyent <[email protected]>
1 parent 0359794 commit 2688478

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

lib/helper/Playwright.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,8 @@ class Playwright extends Helper {
895895

896896
async _registerCustomLocatorStrategies() {
897897
if (this._isCustomLocatorStrategyDefined()) {
898-
console.log('[DEBUG] Registering custom locator strategies:', Object.keys(this.customLocatorStrategies))
899898
for (const [strategyName, strategyFunction] of Object.entries(this.customLocatorStrategies)) {
900899
try {
901-
console.log(`[DEBUG] Registering custom locator strategy: ${strategyName}`)
902900
this.debugSection('Playwright', `registering custom locator strategy: ${strategyName}`)
903901

904902
// Create a selector engine object similar to the default engines
@@ -925,18 +923,14 @@ class Playwright extends Helper {
925923
}
926924

927925
await playwright.selectors.register(strategyName, selectorEngine)
928-
console.log(`[DEBUG] Successfully registered custom locator strategy: ${strategyName}`)
929926
registeredCustomLocatorStrategies.add(strategyName)
930927
} catch (error) {
931-
console.log(`[DEBUG] Error registering custom locator strategy '${strategyName}':`, error)
932928
// Ignore "already registered" errors, warn about others
933929
if (!error.message.includes('already registered')) {
934930
console.warn(`Failed to register custom locator strategy '${strategyName}':`, error)
935931
}
936932
}
937933
}
938-
} else {
939-
console.log('[DEBUG] No custom locator strategies defined')
940934
}
941935
}
942936

@@ -1337,31 +1331,21 @@ class Playwright extends Helper {
13371331
}
13381332

13391333
async _ensureCustomLocatorsRegistered() {
1340-
console.log('[DEBUG] _ensureCustomLocatorsRegistered called')
1341-
console.log('[DEBUG] _customLocatorsRegistered:', this._customLocatorsRegistered)
1342-
console.log('[DEBUG] _isCustomLocatorStrategyDefined:', this._isCustomLocatorStrategyDefined())
1343-
13441334
// Only register once, and only if we have strategies defined
13451335
if (this._customLocatorsRegistered || !this._isCustomLocatorStrategyDefined()) {
1346-
console.log('[DEBUG] Skipping custom locator registration - already registered or no strategies defined')
13471336
return
13481337
}
13491338

1350-
console.log('[DEBUG] Proceeding with custom locator registration')
13511339
try {
13521340
// If browser isn't running yet, start it to register selectors
13531341
if (!this.isRunning && !this.options.manualStart) {
1354-
console.log('[DEBUG] Starting browser to register selectors')
13551342
await this._startBrowser()
13561343
} else {
1357-
console.log('[DEBUG] Browser running, registering selectors now')
13581344
// If browser is running but custom locators not registered, register them now
13591345
await this._registerCustomLocatorStrategies()
13601346
}
13611347
this._customLocatorsRegistered = true
1362-
console.log('[DEBUG] Custom locator registration completed')
13631348
} catch (error) {
1364-
console.log('[DEBUG] Failed to register custom locators:', error)
13651349
console.warn('Failed to register custom locators:', error.message)
13661350
// Continue execution - the error will surface when the locator is actually used
13671351
}

0 commit comments

Comments
 (0)