Skip to content

Commit

Permalink
fix: Align autoLaunch capability behaviour with iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Feb 7, 2021
1 parent 6db195d commit 15ffd8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
7 changes: 2 additions & 5 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,8 @@ class AndroidDriver extends BaseDriver {
}
}

// If the user sets autoLaunch to false, they are responsible for initAUT() and startAUT()
if (this.opts.autoLaunch) {
// set up app under test
await this.initAUT();
}
// set up app under test
await this.initAUT();

// start UiAutomator
this.bootstrap = new helpers.bootstrap(this.adb, this.opts.bootstrapPort, this.opts.websocket);
Expand Down
13 changes: 4 additions & 9 deletions test/unit/driver-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,6 @@ describe('driver', function () {
await driver.startAndroidSession();
driver.adb.getPlatformVersion.calledOnce.should.be.true;
});
it('should auto launch app if it is on the device', async function () {
driver.opts.autoLaunch = true;
await driver.startAndroidSession();
driver.initAUT.calledOnce.should.be.true;
});
it('should handle chrome sessions', async function () {
driver.opts.browserName = 'Chrome';
await driver.startAndroidSession();
Expand All @@ -414,15 +409,15 @@ describe('driver', function () {
await driver.startAndroidSession();
helpers.unlock.calledOnce.should.be.true;
});
it('should start AUT if auto lauching', async function () {
it('should start AUT if auto launching', async function () {
driver.opts.autoLaunch = true;
await driver.startAndroidSession();
driver.initAUT.calledOnce.should.be.true;
driver.startAUT.calledOnce.should.be.true;
});
it('should not start AUT if not auto lauching', async function () {
it('should not start AUT if not auto launching', async function () {
driver.opts.autoLaunch = false;
await driver.startAndroidSession();
driver.initAUT.calledOnce.should.be.false;
driver.startAUT.calledOnce.should.be.false;
});
it('should set the context if autoWebview is requested', async function () {
driver.opts.autoWebview = true;
Expand Down

0 comments on commit 15ffd8d

Please sign in to comment.