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

Enforce Simulator shutdown if resetOnSessionStartOnly is set to false #950

Merged
merged 2 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Enforce Simulator shutdown if resetOnSessionStartOnly is set to false
  • Loading branch information
mykola-mokhnach committed May 3, 2019
commit 967325e3d789edb358a2c00aa993f24d0577989f
4 changes: 3 additions & 1 deletion lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,9 @@ class XCUITestDriver extends BaseDriver {
}

if (this.opts.resetOnSessionStartOnly === false) {
await this.runReset();
await this.runReset(Object.assign({}, this.opts, {
enforceSimulatorShutdown: true,
}));
}

if (this.isSimulator() && !this.opts.noReset && !!this.opts.device) {
Expand Down
2 changes: 1 addition & 1 deletion lib/simulator-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function runSimulatorReset (device, opts) {
// Terminate the app under test if it is still running on Simulator
// Termination is not needed if Simulator is not running
if (await device.isRunning()) {
if (device.xcodeVersion.major >= 8) {
if (device.xcodeVersion.major >= 8 && !opts.enforceSimulatorShutdown) {
try {
await terminate(device.udid, opts.bundleId);
} catch (err) {
Expand Down