Skip to content

Commit

Permalink
update the option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Jan 24, 2025
1 parent bf9e95c commit ca7003b
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ export class XCUITestDriver extends BaseDriver {
/** @type {import('./commands/pcap').TrafficCapture|null} */
_trafficCapture;

/** @type {boolean} */
skipDeviceCheck;

/** @type {Simulator|RealDevice} */
_device;

Expand Down Expand Up @@ -326,13 +323,6 @@ export class XCUITestDriver extends BaseDriver {
this.appInfosCache = new AppInfosCache(this.log);
this.remote = null;
this.doesSupportBidi = true;

// Whether to skip the device check in a new session request.
// This is a workaround for network-connected devices such as an Apple TV 4k tvOS 17+ real device.
// A situation that requires this capability may have an issue with communicating with the device
// over appium-ios-device for example.
// Please remove this capability when we no longer need this workaround.
this.skipDeviceCheck = this.opts.skipDeviceCheck || false;
}

async onSettingsUpdate(key, value) {
Expand Down Expand Up @@ -632,7 +622,12 @@ export class XCUITestDriver extends BaseDriver {
await this.installAUT();

// if we only have bundle identifier and no app, fail if it is not already installed.
if (this.skipDeviceCheck) {
if (!!this.opts.skipDeviceCheck) {
// Whether to skip the device check in a new session request.
// This is a workaround for network-connected devices such as an Apple TV 4k tvOS 17+ real device.
// A situation that requires this capability may have an issue with communicating with the device
// over appium-ios-device for example.
// Please remove this capability when we no longer need this workaround.
this.log.debug(`Skipping ${this.opts.bundleId} installation check since skipDeviceCheck was given.`);
} else if (
!this.opts.app &&
Expand Down Expand Up @@ -1596,7 +1591,7 @@ export class XCUITestDriver extends BaseDriver {
return;
}

if (this.opts.bundleId && this.skipDeviceCheck) {
if (this.opts.bundleId && !!this.opts.skipDeviceCheck) {
this.log.debug('Skipping the bundle id installation check');
return;
}
Expand Down

0 comments on commit ca7003b

Please sign in to comment.