This reverts commit 617dfdef9e.
It turns out this might conflict with our bright testrunner future.
This commit is contained in:
parent
617dfdef9e
commit
f52290d4ea
|
|
@ -469,11 +469,6 @@ contexts override the proxy, global proxy will be never used and can be any stri
|
||||||
`launch({ proxy: { server: 'http://per-context' } })`.
|
`launch({ proxy: { server: 'http://per-context' } })`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## context-option-defaulttimeout
|
|
||||||
- `defaultTimeout` <[float]>
|
|
||||||
|
|
||||||
Set the default browser context timeout for the new context. Equivalent to calling [`method: BrowserContext.setDefaultTimeout`].
|
|
||||||
|
|
||||||
## select-options-values
|
## select-options-values
|
||||||
* langs: java, js, csharp
|
* langs: java, js, csharp
|
||||||
- `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>>
|
- `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>>
|
||||||
|
|
@ -599,7 +594,6 @@ using the [`method: AndroidDevice.setDefaultTimeout`] method.
|
||||||
- %%-context-option-recordvideo-%%
|
- %%-context-option-recordvideo-%%
|
||||||
- %%-context-option-recordvideo-dir-%%
|
- %%-context-option-recordvideo-dir-%%
|
||||||
- %%-context-option-recordvideo-size-%%
|
- %%-context-option-recordvideo-size-%%
|
||||||
- %%-context-option-defaulttimeout-%%
|
|
||||||
|
|
||||||
## browser-option-args
|
## browser-option-args
|
||||||
- `args` <[Array]<[string]>>
|
- `args` <[Array]<[string]>>
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,6 @@ export type BrowserTypeLaunchPersistentContextParams = {
|
||||||
omitContent?: boolean,
|
omitContent?: boolean,
|
||||||
path: string,
|
path: string,
|
||||||
},
|
},
|
||||||
defaultTimeout?: number,
|
|
||||||
userDataDir: string,
|
userDataDir: string,
|
||||||
slowMo?: number,
|
slowMo?: number,
|
||||||
};
|
};
|
||||||
|
|
@ -410,7 +409,6 @@ export type BrowserTypeLaunchPersistentContextOptions = {
|
||||||
omitContent?: boolean,
|
omitContent?: boolean,
|
||||||
path: string,
|
path: string,
|
||||||
},
|
},
|
||||||
defaultTimeout?: number,
|
|
||||||
slowMo?: number,
|
slowMo?: number,
|
||||||
};
|
};
|
||||||
export type BrowserTypeLaunchPersistentContextResult = {
|
export type BrowserTypeLaunchPersistentContextResult = {
|
||||||
|
|
@ -501,7 +499,6 @@ export type BrowserNewContextParams = {
|
||||||
omitContent?: boolean,
|
omitContent?: boolean,
|
||||||
path: string,
|
path: string,
|
||||||
},
|
},
|
||||||
defaultTimeout?: number,
|
|
||||||
proxy?: {
|
proxy?: {
|
||||||
server: string,
|
server: string,
|
||||||
bypass?: string,
|
bypass?: string,
|
||||||
|
|
@ -559,7 +556,6 @@ export type BrowserNewContextOptions = {
|
||||||
omitContent?: boolean,
|
omitContent?: boolean,
|
||||||
path: string,
|
path: string,
|
||||||
},
|
},
|
||||||
defaultTimeout?: number,
|
|
||||||
proxy?: {
|
proxy?: {
|
||||||
server: string,
|
server: string,
|
||||||
bypass?: string,
|
bypass?: string,
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,6 @@ ContextOptions:
|
||||||
properties:
|
properties:
|
||||||
omitContent: boolean?
|
omitContent: boolean?
|
||||||
path: string
|
path: string
|
||||||
defaultTimeout: number?
|
|
||||||
|
|
||||||
|
|
||||||
Playwright:
|
Playwright:
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,6 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
|
||||||
omitContent: tOptional(tBoolean),
|
omitContent: tOptional(tBoolean),
|
||||||
path: tString,
|
path: tString,
|
||||||
})),
|
})),
|
||||||
defaultTimeout: tOptional(tNumber),
|
|
||||||
userDataDir: tString,
|
userDataDir: tString,
|
||||||
slowMo: tOptional(tNumber),
|
slowMo: tOptional(tNumber),
|
||||||
});
|
});
|
||||||
|
|
@ -308,7 +307,6 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
|
||||||
omitContent: tOptional(tBoolean),
|
omitContent: tOptional(tBoolean),
|
||||||
path: tString,
|
path: tString,
|
||||||
})),
|
})),
|
||||||
defaultTimeout: tOptional(tNumber),
|
|
||||||
proxy: tOptional(tObject({
|
proxy: tOptional(tObject({
|
||||||
server: tString,
|
server: tString,
|
||||||
bypass: tOptional(tString),
|
bypass: tOptional(tString),
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,6 @@ export abstract class BrowserContext extends SdkObject {
|
||||||
if (this._options.recordHar)
|
if (this._options.recordHar)
|
||||||
this._harTracer = new HarTracer(this, this._options.recordHar);
|
this._harTracer = new HarTracer(this, this._options.recordHar);
|
||||||
this.tracing = new Tracing(this);
|
this.tracing = new Tracing(this);
|
||||||
|
|
||||||
if (typeof this._options.defaultTimeout === 'number' && !debugMode())
|
|
||||||
this._timeoutSettings.setDefaultTimeout(this._options.defaultTimeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_setSelectors(selectors: Selectors) {
|
_setSelectors(selectors: Selectors) {
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,6 @@ export type BrowserContextOptions = {
|
||||||
},
|
},
|
||||||
proxy?: ProxySettings,
|
proxy?: ProxySettings,
|
||||||
_debugName?: string,
|
_debugName?: string,
|
||||||
defaultTimeout?: number,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type EnvArray = { name: string, value: string }[];
|
export type EnvArray = { name: string, value: string }[];
|
||||||
|
|
|
||||||
|
|
@ -218,16 +218,6 @@ it('should be able to navigate after disabling javascript', async ({browser, ser
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should respect default timeout when configured', async ({browser, playwright}) => {
|
|
||||||
const context = await browser.newContext({ defaultTimeout: 5 });
|
|
||||||
const page = await context.newPage();
|
|
||||||
let error = null;
|
|
||||||
await page.waitForFunction('false').catch(e => error = e);
|
|
||||||
expect(error).toBeInstanceOf(playwright.errors.TimeoutError);
|
|
||||||
expect(error.message).toContain('page.waitForFunction: Timeout 5ms exceeded');
|
|
||||||
await context.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should work with offline option', async ({browser, server}) => {
|
it('should work with offline option', async ({browser, server}) => {
|
||||||
const context = await browser.newContext({offline: true});
|
const context = await browser.newContext({offline: true});
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
|
|
|
||||||
24
types/types.d.ts
vendored
24
types/types.d.ts
vendored
|
|
@ -6985,12 +6985,6 @@ export interface BrowserType<Unused = {}> {
|
||||||
*/
|
*/
|
||||||
colorScheme?: "light"|"dark"|"no-preference";
|
colorScheme?: "light"|"dark"|"no-preference";
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the default browser context timeout for the new context. Equivalent to calling
|
|
||||||
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browsercontextsetdefaulttimeouttimeout).
|
|
||||||
*/
|
|
||||||
defaultTimeout?: number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
||||||
*/
|
*/
|
||||||
|
|
@ -8102,12 +8096,6 @@ export interface AndroidDevice {
|
||||||
*/
|
*/
|
||||||
command?: string;
|
command?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the default browser context timeout for the new context. Equivalent to calling
|
|
||||||
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browsercontextsetdefaulttimeouttimeout).
|
|
||||||
*/
|
|
||||||
defaultTimeout?: number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
||||||
*/
|
*/
|
||||||
|
|
@ -8862,12 +8850,6 @@ export interface Browser extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
colorScheme?: "light"|"dark"|"no-preference";
|
colorScheme?: "light"|"dark"|"no-preference";
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the default browser context timeout for the new context. Equivalent to calling
|
|
||||||
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browsercontextsetdefaulttimeouttimeout).
|
|
||||||
*/
|
|
||||||
defaultTimeout?: number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
||||||
*/
|
*/
|
||||||
|
|
@ -10937,12 +10919,6 @@ export interface BrowserContextOptions {
|
||||||
*/
|
*/
|
||||||
colorScheme?: "light"|"dark"|"no-preference";
|
colorScheme?: "light"|"dark"|"no-preference";
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the default browser context timeout for the new context. Equivalent to calling
|
|
||||||
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browsercontextsetdefaulttimeouttimeout).
|
|
||||||
*/
|
|
||||||
defaultTimeout?: number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
* Specify device scale factor (can be thought of as dpr). Defaults to `1`.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue