@probolabs/playwright 1.5.0-rc.3 → 1.5.0-rc.5
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/dist/.tsbuildinfo +1 -1
- package/dist/cli.js +80 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +506 -388
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +506 -388
- package/dist/index.js.map +1 -1
- package/dist/types/replay-utils.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Locator, Page } from 'playwright';
|
|
2
2
|
import { SmartSelector, ElementTag, ProboLogLevel, PlaywrightTimeoutConfig, PlaywrightAction, TotpConfig, RecorderSettings, AIModel, InitialPageState, FindCandidateInput, ServerResponse } from '@probolabs/probo-shared';
|
|
3
3
|
export { AIModel, CodeGeneratorOptions, ElementInfo, ElementTag, PlaywrightAction, ProboLogLevel, createUrlSlug, extractRequiredEnvVars, generateCode, getRequiredEnvVars } from '@probolabs/probo-shared';
|
|
4
|
-
import { Page as Page$1 } from '@playwright/test';
|
|
4
|
+
import { Page as Page$1, BrowserContext } from '@playwright/test';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Traverses up the DOM from the given locator to find the closest visible ancestor.
|
|
@@ -112,6 +112,8 @@ interface RunStepParams extends Partial<PlaywrightTimeoutConfig> {
|
|
|
112
112
|
onScreenshots?: (urls: ScreenshotUrls) => void;
|
|
113
113
|
takeScreenshot?: (page: Page$1, type?: 'base' | 'candidates' | 'actual') => Promise<string>;
|
|
114
114
|
isApplyAIContext?: boolean;
|
|
115
|
+
tabIndex?: number;
|
|
116
|
+
opensNewTab?: boolean;
|
|
115
117
|
}
|
|
116
118
|
interface ProboPlaywrightConfig {
|
|
117
119
|
timeoutConfig?: Partial<PlaywrightTimeoutConfig>;
|
|
@@ -123,10 +125,13 @@ declare class ProboPlaywright {
|
|
|
123
125
|
private readonly enableSmartSelectors;
|
|
124
126
|
private readonly timeoutConfig;
|
|
125
127
|
private page;
|
|
128
|
+
private context;
|
|
129
|
+
private pagesByTabIndex;
|
|
130
|
+
private nextTabIndex;
|
|
126
131
|
private params;
|
|
127
132
|
private isCanceled;
|
|
128
133
|
private highlighter;
|
|
129
|
-
constructor({ enableSmartSelectors, timeoutConfig, debugLevel, isCanceled }: ProboPlaywrightConfig, page?: Page$1 | null);
|
|
134
|
+
constructor({ enableSmartSelectors, timeoutConfig, debugLevel, isCanceled }: ProboPlaywrightConfig, page?: Page$1 | null, context?: BrowserContext | null);
|
|
130
135
|
/**
|
|
131
136
|
* Sets the Playwright page instance for this ProboPlaywright instance.
|
|
132
137
|
* Also applies the configured default navigation and action timeouts to the page.
|
|
@@ -134,6 +139,19 @@ declare class ProboPlaywright {
|
|
|
134
139
|
* @param page - The Playwright Page instance to use, or null to unset.
|
|
135
140
|
*/
|
|
136
141
|
setPage(page: Page$1 | null): void;
|
|
142
|
+
/**
|
|
143
|
+
* Sets the BrowserContext for multi-tab replay. Required for opensNewTab support.
|
|
144
|
+
*/
|
|
145
|
+
setContext(context: BrowserContext | null): void;
|
|
146
|
+
/**
|
|
147
|
+
* Resets multi-tab state for a new replay. Clears captured tabs (keeps tab 0) and resets nextTabIndex.
|
|
148
|
+
* Call at the start of replay before running interactions.
|
|
149
|
+
*/
|
|
150
|
+
resetMultiTabState(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Gets the page for the given tab index. Tab 0 = initial page; higher indices = new tabs.
|
|
153
|
+
*/
|
|
154
|
+
private getPageForTabIndex;
|
|
137
155
|
/**
|
|
138
156
|
* Sets the parameters object for template literal interpolation
|
|
139
157
|
* Stores a reference to the params object so mutations are automatically reflected
|