Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Feb 5, 2024
1 parent 53995a5 commit f85a0d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit/driver-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ describe('driver.js', function () {
it('should set sessionId', async function () {
let driver = new AndroidUiautomator2Driver({}, false);
defaultStub(driver);
driver.adb = new ADB();
sinon.mock(driver).expects('checkAppPresent').once().returns(B.resolve());
sinon.stub(driver.adb, 'getApiLevel').onFirstCall().returns(B.resolve(24));
sinon.mock(driver).expects('startUiAutomator2Session').once().returns(B.resolve());
await driver.createSession(null, null, {
firstMatch: [{}],
Expand All @@ -56,6 +58,8 @@ describe('driver.js', function () {
it('should set the default context', async function () {
let driver = new AndroidUiautomator2Driver({}, false);
defaultStub(driver);
driver.adb = new ADB();
sinon.stub(driver.adb, 'getApiLevel').onFirstCall().returns(B.resolve(24));
sinon.mock(driver).expects('checkAppPresent').returns(B.resolve());
sinon.mock(driver).expects('startUiAutomator2Session').returns(B.resolve());
await driver.createSession(null, null, {
Expand Down Expand Up @@ -148,7 +152,9 @@ describe('driver.js', function () {
beforeEach(function () {
driver = new AndroidUiautomator2Driver({}, false);
defaultStub(driver);
driver.adb = new ADB();
sinon.mock(driver).expects('checkAppPresent').once().returns(B.resolve());
sinon.stub(driver.adb, 'getApiLevel').onFirstCall().returns(B.resolve(24));
sinon.mock(driver).expects('startUiAutomator2Session').once().returns(B.resolve());
});

Expand Down

0 comments on commit f85a0d7

Please sign in to comment.