Add handling of boolean caps

This commit is contained in:
Isaac Murchie
2015-12-29 15:14:30 -08:00
parent ad48a826c9
commit abb7b543aa
3 changed files with 32 additions and 1 deletions
+9
View File
@@ -71,6 +71,15 @@ describe('AppiumDriver', () => {
await appium.createSession(BASE_CAPS);
mockFakeDriver.verify();
});
it('should call inner driver\'s createSession with desired capabilities with string booleans transformed to booleans', async () => {
let sentCaps = _.extend({autoAcceptAlerts: 'false', autoDismissAlerts: 'true'}, BASE_CAPS);
let expectedCaps = _.extend({autoAcceptAlerts: false, autoDismissAlerts: true}, BASE_CAPS);
mockFakeDriver.expects("createSession")
.once().withExactArgs(expectedCaps, undefined, [])
.returns([1, expectedCaps]);
await appium.createSession(sentCaps);
mockFakeDriver.verify();
});
});
describe('deleteSession', () => {
let appium