From f53d28264fcb3136327a84d13e50bfbf388d4370 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:03:06 +0530 Subject: [PATCH] feat: add udid parameter to EmulatorConfig (#242) * feat: add udid parameter to EmulatorConfig Co-Authored-By: pushpam@empirical.run * feat: implement udid in EmulatorProvider createConfig Co-Authored-By: pushpam@empirical.run * Create blue-teachers-crash.md --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: pushpam@empirical.run Co-authored-by: Pushpam Saxena <43639045+pushpam5@users.noreply.github.com> --- .changeset/blue-teachers-crash.md | 5 +++++ src/providers/emulator/index.ts | 2 ++ src/types/index.ts | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 .changeset/blue-teachers-crash.md diff --git a/.changeset/blue-teachers-crash.md b/.changeset/blue-teachers-crash.md new file mode 100644 index 0000000..d1434e1 --- /dev/null +++ b/.changeset/blue-teachers-crash.md @@ -0,0 +1,5 @@ +--- +"appwright": patch +--- + +feat: add udid parameter to EmulatorConfig diff --git a/src/providers/emulator/index.ts b/src/providers/emulator/index.ts index 9140cc5..f380a82 100644 --- a/src/providers/emulator/index.ts +++ b/src/providers/emulator/index.ts @@ -90,6 +90,7 @@ Follow the steps mentioned in ${androidSimulatorConfigDocLink} to run test on An private async createConfig() { const platformName = this.project.use.platform; + const udid = (this.project.use.device as EmulatorConfig).udid; let appPackageName: string | undefined; let appLaunchableActivity: string | undefined; @@ -104,6 +105,7 @@ Follow the steps mentioned in ${androidSimulatorConfigDocLink} to run test on An port: 4723, capabilities: { "appium:deviceName": this.project.use.device?.name, + "appium:udid": udid, "appium:automationName": platformName == Platform.ANDROID ? "uiautomator2" : "xcuitest", "appium:platformVersion": (this.project.use.device as EmulatorConfig) diff --git a/src/types/index.ts b/src/types/index.ts index afdd2f7..39574b8 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -149,6 +149,11 @@ export type EmulatorConfig = { name?: string; osVersion?: string; + /** + * The unique device identifier (UDID) of the emulator. + */ + udid?: string; + /** * The orientation of the emulator. * Default orientation is "portrait".