Skip to content

Commit

Permalink
fix: added capability to enable camera injection using config (#229)
Browse files Browse the repository at this point in the history
* fix: added capability to enable camera injection using config

* Create beige-peas-deny.md

* fix: rename capability

* fix: updated capability in lambdatest
  • Loading branch information
pushpam5 authored Nov 15, 2024
1 parent 381bf62 commit fbcbe5a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/beige-peas-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"appwright": patch
---

fix: added capability to enable camera injection using config
4 changes: 3 additions & 1 deletion src/providers/browserstack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ export class BrowserStackDeviceProvider implements DeviceProvider {
interactiveDebugging: true,
networkLogs: true,
appiumVersion: "2.6.0",
enableCameraImageInjection: true,
enableCameraImageInjection: (
this.project.use.device as BrowserStackConfig
)?.enableCameraImageInjection,
idleTimeout: 180,
deviceName: this.project.use.device?.name,
osVersion: (this.project.use.device as BrowserStackConfig).osVersion,
Expand Down
2 changes: 2 additions & 0 deletions src/providers/lambdatest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ export class LambdaTestDeviceProvider implements DeviceProvider {
autoGrantPermissions: true,
autoAcceptAlerts: true,
isRealMobile: true,
enableImageInjection: (this.project.use.device as LambdaTestConfig)
?.enableCameraImageInjection,
"settings[snapshotMaxDepth]": 62,
},
};
Expand Down
12 changes: 12 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ export type BrowserStackConfig = {
* Default orientation is "portrait".
*/
orientation?: DeviceOrientation;

/**
* Whether to enable camera injection on the device.
* Default is false.
*/
enableCameraImageInjection?: boolean;
};

export type LambdaTestConfig = {
Expand All @@ -108,6 +114,12 @@ export type LambdaTestConfig = {
* Default orientation is "portrait".
*/
orientation?: DeviceOrientation;

/**
* Whether to enable camera injection on the device.
* Default is false.
*/
enableCameraImageInjection?: boolean;
};

/**
Expand Down

0 comments on commit fbcbe5a

Please sign in to comment.