Playwright Power Platform Toolkit v0.0.4


Playwright Power Platform Toolkit / AppProvider

Class: AppProvider

Defined in: core/app-provider.ts:56

App Provider - High-level API for app testing Provides simplified interface for customers to launch and test their apps

Example

const provider = new AppProvider(page, findAppCallback);
 
// Launch by name
await provider.launch({
  app: { name: 'My Sales App' },
  type: AppType.Canvas,
  mode: AppLaunchMode.Play
});
 
// Launch by ID
await provider.launch({
  app: { id: 'abc-123-def' },
  type: AppType.ModelDriven,
  mode: AppLaunchMode.Edit,
  baseUrl: 'https://make.powerapps.com'
});
 
// Interact with app
await provider.click({ name: 'Submit', type: CanvasControlType.Button });
await provider.fill({ name: 'Email' }, 'test@example.com');

Constructors

Constructor

new AppProvider(page, findAppCallback?): AppProvider

Defined in: core/app-provider.ts:63

Parameters

page

Page

findAppCallback?

(appName) => Promise<Locator>

Returns

AppProvider

Methods

setFindAppCallback()

setFindAppCallback(callback): void

Defined in: core/app-provider.ts:73

Set the callback for finding apps by name Required for launching apps by name

Parameters

callback

(appName) => Promise<Locator>

Function to find app by name

Returns

void


launch()

launch(config): Promise<void>

Defined in: core/app-provider.ts:82

Launch an app Supports launching by name or ID

Parameters

config

LaunchAppConfig

Launch configuration

Returns

Promise<void>


getControl()

getControl(options): Locator

Defined in: core/app-provider.ts:170

Get a control in the current app

Parameters

options

ControlOptions

Control options

Returns

Locator

Locator for the control


click()

click(options): Promise<void>

Defined in: core/app-provider.ts:179

Click a control in the current app

Parameters

options

ControlOptions

Control options

Returns

Promise<void>


fill()

fill(options, value): Promise<void>

Defined in: core/app-provider.ts:189

Fill a text input control in the current app

Parameters

options

ControlOptions

Control options

value

string

Value to fill

Returns

Promise<void>


fillForm()

fillForm(formData): Promise<void>

Defined in: core/app-provider.ts:198

Fill a form in the current app

Parameters

formData

Record<string, string>

Key-value pairs of field names and values

Returns

Promise<void>


assertVisible()

assertVisible(options): Promise<void>

Defined in: core/app-provider.ts:207

Assert control is visible

Parameters

options

ControlOptions

Control options

Returns

Promise<void>


assertText()

assertText(options, expectedText): Promise<void>

Defined in: core/app-provider.ts:217

Assert control text matches

Parameters

options

ControlOptions

Control options

expectedText

string

Expected text

Returns

Promise<void>


close()

close(): Promise<void>

Defined in: core/app-provider.ts:225

Close the current app

Returns

Promise<void>


isReady()

isReady(): boolean

Defined in: core/app-provider.ts:236

Check if an app is currently launched and ready

Returns

boolean

true if app is ready


getCurrentAppType()

getCurrentAppType(): AppType | null

Defined in: core/app-provider.ts:244

Get the current app type

Returns

AppType | null

Current app type or null


getCurrentAppId()

getCurrentAppId(): string | null

Defined in: core/app-provider.ts:252

Get the current app ID

Returns

string | null

Current app ID or null


getCurrentAppUrl()

getCurrentAppUrl(): string | null

Defined in: core/app-provider.ts:260

Get the current app URL

Returns

string | null

Current app URL or null


getLaunchedApps()

getLaunchedApps(): AppMetadata[]

Defined in: core/app-provider.ts:268

Get metadata for all launched apps

Returns

AppMetadata[]

Array of app metadata


reset()

reset(): void

Defined in: core/app-provider.ts:276

Reset the provider state Clears current launcher and app metadata

Returns

void