Skip to content

Function: createPage()

ts
function createPage(
   ctx: Context, 
   url?: string, 
options?: GoToOptions): Promise<Context>;

Defined in: src/pages/index.ts:128

Create a new browser tab and return its scoped Context.

Parameters

ParameterTypeDescription
ctxContextThe current Context.
url?stringURL to open in the new tab.
options?GoToOptionsOptional Puppeteer GoToOptions.

Returns

Promise<Context>

A new Context scoped to the created tab.

Remarks

The tab opens in the same browser as the given ctx.

Example

ts
const supplierCtx = await createPage(ctx, 'https://suppliers.megacorp.com/portal');
await click(supplierCtx, 'button#view-orders');

Matterway Assistant SDK Documentation