revert unneeded

This commit is contained in:
Simon Knott 2025-01-24 13:22:50 +01:00
parent 7c598a705a
commit 4d6a453c52
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
10 changed files with 5 additions and 33 deletions

View file

@ -243,10 +243,6 @@ Selectors can be used to install custom selector engines. See
This object can be used to launch or connect to WebKit, returning instances of [Browser].
## property: Playwright.mockingProxy
* since: v1.51
- type: <[MockingProxyFactory]>
## method: Playwright.close
* since: v1.9
* langs: java

View file

@ -112,9 +112,3 @@ test('basic test', async ({ request }) => {
// ...
});
```
## property: Fixtures.server
* since: v1.51
- type: <[MockingProxy]>
Instance of [MockingProxy] that can be used to intercept network requests from your application server.

View file

@ -94,11 +94,4 @@ export const Events = {
Console: 'console',
Window: 'window',
},
MockingProxy: {
Request: 'request',
RequestFailed: 'requestfailed',
Response: 'response',
RequestFinished: 'requestfinished',
}
};

View file

@ -855,7 +855,7 @@ export class BindingCall extends ChannelOwner<channels.BindingCallChannel> {
}
}
export function trimUrl(param: any): string | undefined {
function trimUrl(param: any): string | undefined {
if (isRegExp(param))
return `/${trimStringWithEllipsis(param.source, 50)}/${param.flags}`;
if (isString(param))

View file

@ -22,7 +22,6 @@ import { ChannelOwner } from './channelOwner';
import { Electron } from './electron';
import { APIRequest } from './fetch';
import { Selectors, SelectorsOwner } from './selectors';
import { MockingProxyFactory } from './mockingProxy';
export class Playwright extends ChannelOwner<channels.PlaywrightChannel> {
readonly _android: Android;
@ -35,13 +34,11 @@ export class Playwright extends ChannelOwner<channels.PlaywrightChannel> {
readonly devices: any;
selectors: Selectors;
readonly request: APIRequest;
readonly mockingProxy: MockingProxyFactory;
readonly errors: { TimeoutError: typeof TimeoutError };
constructor(parent: ChannelOwner, type: string, guid: string, initializer: channels.PlaywrightInitializer) {
super(parent, type, guid, initializer);
this.request = new APIRequest(this);
this.mockingProxy = new MockingProxyFactory(this._connection.localUtils());
this.chromium = BrowserType.from(initializer.chromium);
this.chromium._playwright = this;
this.firefox = BrowserType.from(initializer.firefox);

View file

@ -20172,8 +20172,6 @@ export const chromium: BrowserType;
*/
export const firefox: BrowserType;
export const mockingProxy: MockingProxyFactory;
/**
* Exposes API that can be used for the Web API testing.
*/

View file

@ -238,7 +238,7 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
if (serviceWorkers !== undefined)
options.serviceWorkers = serviceWorkers;
if (_mockingProxy)
options.extraHTTPHeaders = { ...options.extraHTTPHeaders, 'x-pw-proxy-port': String(_mockingProxy.port()) };
options.extraHTTPHeaders = { ...options.extraHTTPHeaders, 'x-playwright-proxy-port': String(_mockingProxy.port()) };
await use({
...contextOptions,
...options,

View file

@ -19,9 +19,8 @@ import type { StackFrame } from '@protocol/channels';
import util from 'util';
import path from 'path';
import url from 'url';
import net, { AddressInfo } from 'net';
import { debug, mime, minimatch, parseStackTraceLine } from 'playwright-core/lib/utilsBundle';
import { formatCallLog, ManualPromise } from 'playwright-core/lib/utils';
import { formatCallLog } from 'playwright-core/lib/utils';
import type { Location } from './../types/testReporter';
import { calculateSha1, isRegExp, isString, sanitizeForFilePath, stringifyStackFrames } from 'playwright-core/lib/utils';
import type { RawStack } from 'playwright-core/lib/utils';

View file

@ -15,7 +15,7 @@
* limitations under the License.
*/
import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions, MockingProxy } from 'playwright-core';
import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core';
export * from 'playwright-core';
export type ReporterDescription = Readonly<
@ -6913,10 +6913,6 @@ export interface PlaywrightTestArgs {
*
*/
request: APIRequestContext;
/**
* Instance of [MockingProxy] that can be used to intercept network requests from your application server.
*/
server: MockingProxy;
}
type ExcludeProps<A, B> = {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions, MockingProxy } from 'playwright-core';
import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core';
export * from 'playwright-core';
export type ReporterDescription = Readonly<
@ -288,7 +288,6 @@ export interface PlaywrightTestArgs {
context: BrowserContext;
page: Page;
request: APIRequestContext;
server: MockingProxy;
}
type ExcludeProps<A, B> = {