docs: fix typos (#9476)

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
This commit is contained in:
Kian-Meng Ang 2023-01-14 01:03:21 +08:00 committed by Randolf
parent 31ff55cc03
commit 4437bceb6e
13 changed files with 25 additions and 25 deletions

View File

@ -21,10 +21,10 @@ class BrowserContext {
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt; | A function to be run for every target | | predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt; | A function to be run for every target |
| options | { timeout?: number; } | <i>(Optional)</i> An object of options. Accepts a timout, which is the maximum wait time in milliseconds. Pass <code>0</code> to disable the timeout. Defaults to 30 seconds. | | options | { timeout?: number; } | <i>(Optional)</i> An object of options. Accepts a timeout, which is the maximum wait time in milliseconds. Pass <code>0</code> to disable the timeout. Defaults to 30 seconds. |
**Returns:** **Returns:**

View File

@ -29,10 +29,10 @@ class Frame {
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | --------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| xpath | string | the XPath expression to wait for. | | xpath | string | the XPath expression to wait for. |
| options | [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | <i>(Optional)</i> options to configure the visiblity of the element and how long to wait before timing out. | | options | [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | <i>(Optional)</i> options to configure the visibility of the element and how long to wait before timing out. |
**Returns:** **Returns:**

View File

@ -4,14 +4,14 @@ Adds Puppeteer-based e2e tests to your Angular project.
## Usage ## Usage
Run the command bellow in an Angular CLI app directory and follow the prompts. Run the command below in an Angular CLI app directory and follow the prompts.
_Note this will add the schematic as a dependency to your project._ _Note this will add the schematic as a dependency to your project._
```bash ```bash
ng add @puppeteer/ng-schematics ng add @puppeteer/ng-schematics
``` ```
Or you can use the same command followed by the [options](#options) bellow. Or you can use the same command followed by the [options](#options) below.
Currently, this schematic supports the following test frameworks: Currently, this schematic supports the following test frameworks:

View File

@ -83,7 +83,7 @@ export class BrowserContext extends EventEmitter {
* ``` * ```
* *
* @param predicate - A function to be run for every target * @param predicate - A function to be run for every target
* @param options - An object of options. Accepts a timout, * @param options - An object of options. Accepts a timeout,
* which is the maximum wait time in milliseconds. * which is the maximum wait time in milliseconds.
* Pass `0` to disable the timeout. Defaults to 30 seconds. * Pass `0` to disable the timeout. Defaults to 30 seconds.
* @returns Promise which resolves to the first target found * @returns Promise which resolves to the first target found

View File

@ -263,7 +263,7 @@ export const enum PageEmittedEvents {
* Contains an object with two properties: * Contains an object with two properties:
* *
* - `title`: the title passed to `console.timeStamp` * - `title`: the title passed to `console.timeStamp`
* - `metrics`: objec containing metrics as key/value pairs. The values will * - `metrics`: object containing metrics as key/value pairs. The values will
* be `number`s. * be `number`s.
*/ */
Metrics = 'metrics', Metrics = 'metrics',

View File

@ -623,7 +623,7 @@ export class CDPBrowserContext extends BrowserContext {
* ``` * ```
* *
* @param predicate - A function to be run for every target * @param predicate - A function to be run for every target
* @param options - An object of options. Accepts a timout, * @param options - An object of options. Accepts a timeout,
* which is the maximum wait time in milliseconds. * which is the maximum wait time in milliseconds.
* Pass `0` to disable the timeout. Defaults to 30 seconds. * Pass `0` to disable the timeout. Defaults to 30 seconds.
* @returns Promise which resolves to the first target found * @returns Promise which resolves to the first target found

View File

@ -629,7 +629,7 @@ export class Frame {
* an XPath. * an XPath.
* *
* @param xpath - the XPath expression to wait for. * @param xpath - the XPath expression to wait for.
* @param options - options to configure the visiblity of the element and how * @param options - options to configure the visibility of the element and how
* long to wait before timing out. * long to wait before timing out.
*/ */
async waitForXPath( async waitForXPath(

View File

@ -474,7 +474,7 @@ export class IsolatedWorld {
); );
} catch (error) { } catch (error) {
// The WaitTask may already have been resolved by timing out, or the // The WaitTask may already have been resolved by timing out, or the
// exection context may have been destroyed. // execution context may have been destroyed.
// In both caes, the promises above are rejected with a protocol error. // In both caes, the promises above are rejected with a protocol error.
// We can safely ignores these, as the WaitTask is re-installed in // We can safely ignores these, as the WaitTask is re-installed in
// the next execution context if needed. // the next execution context if needed.

View File

@ -26,7 +26,7 @@ export async function connectBidiOverCDP(
cdpConnectionAdapter.close(); cdpConnectionAdapter.close();
}, },
onmessage(_message: string): void { onmessage(_message: string): void {
// The method is overriden by the Connection. // The method is overridden by the Connection.
}, },
}; };
transportBiDi.on('bidiResponse', (message: object) => { transportBiDi.on('bidiResponse', (message: object) => {
@ -63,7 +63,7 @@ class CDPConnectionAdapter {
getCdpClient(id: string) { getCdpClient(id: string) {
const session = this.#cdp.session(id); const session = this.#cdp.session(id);
if (!session) { if (!session) {
throw new Error('Unknonw CDP session with id' + id); throw new Error('Unknown CDP session with id' + id);
} }
if (!this.#adapters.has(session)) { if (!this.#adapters.has(session)) {
const adapter = new CDPClientAdapter(session); const adapter = new CDPClientAdapter(session);
@ -82,7 +82,7 @@ class CDPConnectionAdapter {
} }
/** /**
* Wrapper on top of CDPSession/CDPConnection to satisify CDP interface that * Wrapper on top of CDPSession/CDPConnection to satisfy CDP interface that
* BidiServer needs. * BidiServer needs.
* *
* @internal * @internal

View File

@ -174,8 +174,8 @@ type FlatmapSplitWithDelemiters<
type Split< type Split<
Input extends string, Input extends string,
Delemiter extends string, Delimiter extends string,
Acc extends string[] = [] Acc extends string[] = []
> = Input extends `${infer Prefix}${Delemiter}${infer Suffix}` > = Input extends `${infer Prefix}${Delimiter}${infer Suffix}`
? Split<Suffix, Delemiter, [...Acc, Prefix]> ? Split<Suffix, Delimiter, [...Acc, Prefix]>
: [...Acc, Input]; : [...Acc, Input];

View File

@ -377,7 +377,7 @@ describe('Cookie specs', () => {
const [cookie] = await page.cookies(SECURE_URL); const [cookie] = await page.cookies(SECURE_URL);
expect(cookie!.secure).toBe(true); expect(cookie!.secure).toBe(true);
}); });
it('should be able to set unsecure cookie for HTTP website', async () => { it('should be able to set insecure cookie for HTTP website', async () => {
const {page, server} = getTestState(); const {page, server} = getTestState();
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View File

@ -233,7 +233,7 @@ describeWithDebugLogs('OOPIF', function () {
if (!isHeadless || headless === 'new') { if (!isHeadless || headless === 'new') {
// TODO: this test is partially blocked on crbug.com/1334119. Enable test once // TODO: this test is partially blocked on crbug.com/1334119. Enable test once
// the upstream is fixed. // the upstream is fixed.
// TLDR: when we dispatch events ot the frame the compositor might // TLDR: when we dispatch events to the frame the compositor might
// not be up-to-date yet resulting in a misclick (the iframe element // not be up-to-date yet resulting in a misclick (the iframe element
// becomes the event target instead of the content inside the iframe). // becomes the event target instead of the content inside the iframe).
// The solution is to use InsertVisualCallback on the backend but that causes // The solution is to use InsertVisualCallback on the backend but that causes

View File

@ -33,14 +33,14 @@ function shouldSkipTest(test: Mocha.Test): boolean {
const testIdForFileName = getTestId(test.file!); const testIdForFileName = getTestId(test.file!);
const testIdForTestName = getTestId(test.file!, test.fullTitle()); const testIdForTestName = getTestId(test.file!, test.fullTitle());
// TODO: more efficient lookup. // TODO: more efficient lookup.
const defintion = skippedTests.find(skippedTest => { const definition = skippedTests.find(skippedTest => {
return ( return (
'' === skippedTest.testIdPattern || '' === skippedTest.testIdPattern ||
testIdForFileName === skippedTest.testIdPattern || testIdForFileName === skippedTest.testIdPattern ||
testIdForTestName === skippedTest.testIdPattern testIdForTestName === skippedTest.testIdPattern
); );
}); });
if (defintion && defintion.skip) { if (definition && definition.skip) {
return true; return true;
} }
return false; return false;