Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tvOS 17 workaround #2178

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ class XCUITestDriver extends BaseDriver {
return !(this.opts.webDriverAgentUrl || this.opts.usePreinstalledWDA);
}

skipDeviceCheck() {
return true;
// return isTvOs(this.opts.platformName);
}

async createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData) {
try {
let [sessionId, caps] = await super.createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData);
Expand Down Expand Up @@ -1249,19 +1254,23 @@ class XCUITestDriver extends BaseDriver {
return {device, realDevice: false, udid: device.udid};
}
} else {
// make sure it is a connected device. If not, the udid passed in is invalid
const devices = await getConnectedDevices();
this.log.debug(`Available devices: ${devices.join(', ')}`);
if (!devices.includes(this.opts.udid)) {
// check for a particular simulator
this.log.debug(`No real device with udid '${this.opts.udid}'. Looking for a simulator`);
try {
const device = await getSimulator(this.opts.udid, {
devicesSetPath: this.opts.simulatorDevicesSetPath,
});
return {device, realDevice: false, udid: this.opts.udid};
} catch (ign) {
throw new Error(`Unknown device or simulator UDID: '${this.opts.udid}'`);
if (this.skipDeviceCheck()) {
this.log.info(`Skipping connected device check. Using the given udid ${this.opts.udid}.`);
} else {
// make sure it is a connected device. If not, the udid passed in is invalid
const devices = await getConnectedDevices();
this.log.debug(`Available devices: ${devices.join(', ')}`);
if (!devices.includes(this.opts.udid)) {
// check for a particular simulator
this.log.debug(`No real device with udid '${this.opts.udid}'. Looking for a simulator`);
try {
const device = await getSimulator(this.opts.udid, {
devicesSetPath: this.opts.simulatorDevicesSetPath,
});
return {device, realDevice: false, udid: this.opts.udid};
} catch (ign) {
throw new Error(`Unknown device or simulator UDID: '${this.opts.udid}'`);
}
}
}
}
Expand Down Expand Up @@ -1675,6 +1684,11 @@ class XCUITestDriver extends BaseDriver {
isTvOS: isTvOs(this.opts.platformName),
});

if (this.opts.bundleId && this.skipDeviceCheck()) {
// TODO: remove if tvOS iOS 17 has no issue with this installation device check state.
this.log.info('Skip the bundle id installation check');
}

const {install, skipUninstall} = await this.checkAutInstallationState();
if (install) {
if (this.isRealDevice()) {
Expand Down
Loading