Merge pull request #31 from appium/isaac-driver

Add command to get driver for a session
This commit is contained in:
Isaac A. Murchie
2015-09-28 08:51:25 -07:00
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -79,6 +79,12 @@ class BaseDriver extends MobileJsonWireProtocol {
return sessionId === this.sessionId;
}
// method required by MJSONWP in order to determine if the command should
// be proxied directly to the driver
driverForSession (/*sessionId*/) {
return this;
}
logExtraCaps (caps) {
let extraCaps = _.difference(_.keys(caps),
_.keys(this._constraints));
+5
View File
@@ -103,6 +103,11 @@ function baseDriverUnitTests (DriverClass, defaultCaps = {}) {
await d.deleteSession();
});
it('should have a method to get driver for a session', async () => {
let [sessId] = await d.createSession(defaultCaps);
d.driverForSession(sessId).should.eql(d);
});
describe('command queue', () => {
let d = new DriverClass();