Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/create_test_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ jobs:
retention-days: 30

# The triggering workflow ran on a pull_request event, but workflow_run.pull_requests is
# empty for PRs from forks, so resolve the number from the head repo + branch instead.
# empty for PRs from forks, so resolve the number from the head ref instead. gh's head
# filter wants "owner:branch" for forks but a bare branch for same-repo PRs.
- name: Resolve PR number
if: ${{ github.event.workflow_run.event == 'pull_request' }}
id: pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch || format('{0}:{1}', github.event.workflow_run.head_repository.owner.login, github.event.workflow_run.head_branch) }}
run: |
NUMBER=$(gh pr view --repo "${{ github.repository }}" \
"${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}" \
--json number --jq '.number' 2>/dev/null || true)
NUMBER=$(gh pr view --repo "${{ github.repository }}" "$HEAD_REF" --json number --jq '.number' 2>/dev/null || true)
echo "number=$NUMBER" >> "$GITHUB_OUTPUT"

- name: Post report comment to PR
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on:
description: "Issue number to triage"
required: true

# One triage at a time across the whole repo; let an in-flight run finish.
concurrency:
group: triage
cancel-in-progress: false

permissions: {}

jobs:
Expand Down Expand Up @@ -45,7 +40,7 @@ jobs:
- name: Triage issue with Copilot CLI
id: triage
env:
GH_TOKEN: ${{ github.token }}
COPILOT_GITHUB_TOKEN: ${{ github.token }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
mkdir -p output
Expand All @@ -60,34 +55,33 @@ jobs:
--allow-all-tools \
--allow-all-paths \
--no-ask-user \
--enable-all-github-mcp-tools \
--share=output/copilot-session.md \
--model claude-opus-4.8 \
--max-ai-credits 500 \
-p "$PROMPT" \
2>&1 | tee "output/copilot.log"
-p "$PROMPT"

if [ -s output/triage.md ]; then
echo "has_draft=true" >> "$GITHUB_OUTPUT"
else
echo "has_draft=false" >> "$GITHUB_OUTPUT"
fi

- name: Add log to job summary
- name: Add session transcript to job summary
if: always()
run: |
{
echo "## Triage run log (issue $ISSUE)"
echo "## Triage session transcript (issue $ISSUE)"
echo ''
echo '```'
cat "output/copilot.log" 2>/dev/null || echo "(no log)"
echo '```'
cat "output/copilot-session.md" 2>/dev/null || echo "(no transcript)"
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload output
if: always()
uses: actions/upload-artifact@v4
with:
name: triage-${{ github.event.issue.number || inputs.issue }}
path: output/**
path: output/triage.md
if-no-files-found: warn

post:
Expand Down
14 changes: 14 additions & 0 deletions docs/src/api/class-apirequestcontext.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ context cookies from the response. The method will automatically follow redirect
### option: APIRequestContext.delete.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.delete.signal = %%-input-signal-%%

### option: APIRequestContext.delete.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -361,6 +363,8 @@ If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/
### option: APIRequestContext.fetch.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.fetch.signal = %%-input-signal-%%

### option: APIRequestContext.fetch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -474,6 +478,8 @@ await request.GetAsync("https://example.com/api/getText", new() { Params = query
### option: APIRequestContext.get.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.get.signal = %%-input-signal-%%

### option: APIRequestContext.get.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -539,6 +545,8 @@ context cookies from the response. The method will automatically follow redirect
### option: APIRequestContext.head.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.head.signal = %%-input-signal-%%

### option: APIRequestContext.head.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -604,6 +612,8 @@ context cookies from the response. The method will automatically follow redirect
### option: APIRequestContext.patch.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.patch.signal = %%-input-signal-%%

### option: APIRequestContext.patch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -790,6 +800,8 @@ await request.PostAsync("https://example.com/api/uploadScript", new() { Multipar
### option: APIRequestContext.post.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.post.signal = %%-input-signal-%%

### option: APIRequestContext.post.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down Expand Up @@ -855,6 +867,8 @@ context cookies from the response. The method will automatically follow redirect
### option: APIRequestContext.put.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16

### option: APIRequestContext.put.signal = %%-input-signal-%%

### option: APIRequestContext.put.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16

Expand Down
4 changes: 4 additions & 0 deletions docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,8 @@ Maximum time in milliseconds to wait for the locator before evaluating. Note tha

Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `0` - no timeout.

### option: Locator.evaluate.signal = %%-input-signal-%%

## async method: Locator.evaluateAll
* since: v1.14
- returns: <[Serializable]>
Expand Down Expand Up @@ -1234,6 +1236,8 @@ Maximum time in milliseconds to wait for the locator before evaluating. Note tha

Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `0` - no timeout.

### option: Locator.evaluateHandle.signal = %%-input-signal-%%

## async method: Locator.fill
* since: v1.14

Expand Down
2 changes: 2 additions & 0 deletions docs/src/api/class-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ Maximum number of times network errors should be retried. Currently only `ECONNR

Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.

### option: Route.fetch.signal = %%-input-signal-%%

### option: Route.fetch.method
* since: v1.29
- `method` <[string]>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -1001,15 +1001,15 @@ The default value can be changed by using the [`method: BrowserContext.setDefaul

## wait-for-event-signal
* langs: js
* since: v1.61
* since: v1.62
- `signal` <[AbortSignal]>

Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error.
Note that providing a signal does not disable the default timeout, which can be changed using [`method: BrowserContext.setDefaultTimeout`]; pass `timeout: 0` to disable the timeout entirely.

## input-signal
* langs: js
* since: v1.61
* since: v1.62
- `signal` <[AbortSignal]>

Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and throw an error.
Expand Down
2 changes: 1 addition & 1 deletion packages/injected/src/recorder/pollingRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Recorder } from './recorder';

import type { InjectedScript } from '../injectedScript';
import type { RecorderDelegate } from './recorder';
import type * as actions from '@recorder/actions';
import type * as actions from '@isomorphic/codegen/actions';
import type { ElementInfo, Mode, OverlayState, UIState } from '@recorder/recorderTypes';

interface Embedder {
Expand Down
2 changes: 1 addition & 1 deletion packages/injected/src/recorder/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type { AriaSnapshot } from '../ariaSnapshot';
import type { Highlight, HighlightEntry } from '../highlight';
import type { InjectedScript } from '../injectedScript';
import type { ElementText } from '../selectorUtils';
import type * as actions from '@recorder/actions';
import type * as actions from '@isomorphic/codegen/actions';
import type { ElementInfo, Mode, OverlayState, UIState } from '@recorder/recorderTypes';
import type { Language } from '@isomorphic/locatorGenerators';

Expand Down
1 change: 1 addition & 0 deletions packages/isomorphic/codegen/DEPS.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[*]
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

import { asLocator } from '@isomorphic/locatorGenerators';
import { escapeWithQuotes } from '@isomorphic/stringUtils';
import { asLocator } from '../locatorGenerators';
import { escapeWithQuotes } from '../stringUtils';
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
import { deviceDescriptors } from '../deviceDescriptors';

import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
import type { BrowserContextOptions } from '../../..';
import type * as actions from '@recorder/actions';
import type { BrowserContextOptions } from 'playwright-core';
import type * as actions from './actions';

type CSharpLanguageMode = 'library' | 'mstest' | 'nunit' | 'xunit';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

import { asLocator } from '@isomorphic/locatorGenerators';
import { escapeWithQuotes } from '@isomorphic/stringUtils';
import { asLocator } from '../locatorGenerators';
import { escapeWithQuotes } from '../stringUtils';
import { toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
import { deviceDescriptors } from '../deviceDescriptors';
import { JavaScriptFormatter } from './javascript';

import type { BrowserContextOptions } from '../../..';
import type * as types from '../types';
import type { BrowserContextOptions } from 'playwright-core';
import type * as types from './types';
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
import type * as actions from '@recorder/actions';
import type * as actions from './actions';

type JavaLanguageMode = 'library' | 'junit';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

import { asLocator } from '@isomorphic/locatorGenerators';
import { escapeWithQuotes, formatObject, formatObjectOrVoid } from '@isomorphic/stringUtils';
import { asLocator } from '../locatorGenerators';
import { escapeWithQuotes, formatObject, formatObjectOrVoid } from '../stringUtils';
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
import { deviceDescriptors } from '../deviceDescriptors';

import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
import type { BrowserContextOptions } from '../../..';
import type * as actions from '@recorder/actions';
import type { BrowserContextOptions } from 'playwright-core';
import type * as actions from './actions';

export class JavaScriptLanguageGenerator implements LanguageGenerator {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { asLocator } from '@isomorphic/locatorGenerators';
import { asLocator } from '../locatorGenerators';

import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
import type * as actions from '@recorder/actions';
import type * as actions from './actions';

export class JsonlLanguageGenerator implements LanguageGenerator {
id = 'jsonl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import type { BrowserContextOptions } from '../../..';
import type * as types from '../types';
import type { BrowserContextOptions } from 'playwright-core';
import type * as types from './types';
import type { LanguageGenerator, LanguageGeneratorOptions } from './types';
import type * as actions from '@recorder/actions';
import type * as actions from './actions';

export function generateCode(actions: actions.ActionInContext[], languageGenerator: LanguageGenerator, options: LanguageGeneratorOptions) {
const header = languageGenerator.generateHeader(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

import { asLocator } from '@isomorphic/locatorGenerators';
import { escapeWithQuotes, toSnakeCase } from '@isomorphic/stringUtils';
import { asLocator } from '../locatorGenerators';
import { escapeWithQuotes, toSnakeCase } from '../stringUtils';
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
import { deviceDescriptors } from '../deviceDescriptors';

import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
import type { BrowserContextOptions } from '../../..';
import type * as actions from '@recorder/actions';
import type { BrowserContextOptions } from 'playwright-core';
import type * as actions from './actions';

export class PythonLanguageGenerator implements LanguageGenerator {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@
* limitations under the License.
*/

import type { BrowserContextOptions, LaunchOptions } from '../../..';
import type * as actions from '@recorder/actions';
import type { Language } from '@isomorphic/locatorGenerators';
import type { BrowserContextOptions, LaunchOptions } from 'playwright-core';
import type * as actions from './actions';
import type { Language } from '../locatorGenerators';
import type { Point } from '../types';
export type { Language };

export type SmartKeyboardModifier = 'Alt' | 'Control' | 'Meta' | 'Shift' | 'ControlOrMeta';

export type MouseClickOptions = {
modifiers?: SmartKeyboardModifier[];
position?: Point;
delay?: number;
button?: 'left' | 'right' | 'middle';
clickCount?: number;
};

export type LanguageGeneratorOptions = {
browserName: string;
launchOptions: LaunchOptions;
Expand Down
1 change: 0 additions & 1 deletion packages/isomorphic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export * from './protocolFormatter';
export * from './protocolMetainfo';
export * from './rtti';
export * from './semaphore';
export * from './stackTrace';
export * from './stringUtils';
export * from './formatUtils';
export * from './time';
Expand Down
4 changes: 1 addition & 3 deletions packages/isomorphic/manualPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import { captureRawStack } from './stackTrace';

export class ManualPromise<T = void> extends Promise<T> {
private _resolve!: (t: T) => void;
private _reject!: (e: Error) => void;
Expand Down Expand Up @@ -96,7 +94,7 @@ export class LongStandingScope {

private async _race(promises: Promise<any>[], safe: boolean, defaultValue?: any): Promise<any> {
const terminatePromise = new ManualPromise<Error>();
const frames = captureRawStack();
const frames = (new Error().stack || '').split('\n');
if (this._terminateError)
terminatePromise.resolve(this._terminateError);
if (this._closeError)
Expand Down
3 changes: 1 addition & 2 deletions packages/isomorphic/trace/traceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import { getActionGroup, renderTitleForCall } from '../protocolFormatter';

import type { StackFrame } from '../stackTrace';
import type { Language } from '../locatorGenerators';
import type { ResourceSnapshot } from '@trace/snapshot';
import type * as trace from '@trace/trace';
Expand Down Expand Up @@ -57,7 +56,7 @@ export type ActionTreeItem = {

export type ErrorDescription = {
action?: ActionTraceEventInContext;
stack?: StackFrame[];
stack?: trace.StackFrame[];
message: string;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/isomorphic/trace/traceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { StackFrame } from '../stackTrace';
import type { StackFrame } from '@trace/trace';
import type { ClientSideCallMetadata } from '@protocol/structs';

export type SerializedStackFrame = [number, number, number, string];
Expand Down
Loading
Loading