From 59f828d54ffa6e8a06620bdb894009d35b500279 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 4 Oct 2023 15:14:01 -0700 Subject: [PATCH] chore: highlight legacy page.click on hover (#382) --- src/babelHighlightUtil.ts | 2 +- src/debugHighlight.ts | 4 +++- src/methodNames.ts | 12 ++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/babelHighlightUtil.ts b/src/babelHighlightUtil.ts index e0cf4f082..97266695c 100644 --- a/src/babelHighlightUtil.ts +++ b/src/babelHighlightUtil.ts @@ -83,7 +83,7 @@ export function locatorForSourcePosition(text: string, vars: { pages: string[], expressionNode = path.node.object.arguments[0]; - // *.locator(), *.getBy*(), call + // *.locator(), *.getBy*(), *.click(), *.fill(), *.type() call if (t.isCallExpression(path.node) && t.isMemberExpression(path.node.callee) && t.isIdentifier(path.node.callee.property) && diff --git a/src/debugHighlight.ts b/src/debugHighlight.ts index 5552b47c2..52ec94f5c 100644 --- a/src/debugHighlight.ts +++ b/src/debugHighlight.ts @@ -16,7 +16,7 @@ import { locatorForSourcePosition, pruneAstCaches } from './babelHighlightUtil'; import { debugSessionName } from './debugSessionName'; -import { locatorMethodRegex } from './methodNames'; +import { replaceActionWithLocator, locatorMethodRegex } from './methodNames'; import type { Location } from './reporter'; import { ReusedBrowser } from './reusedBrowser'; import * as vscodeTypes from './vscodeTypes'; @@ -148,6 +148,8 @@ async function locatorToHighlight(debugSessions: Map