fix: Make device name non required
MODIFY
lib/basedriver/desired-caps.js
lib/basedriver/desired-caps.js
@@ -9,10 +9,11 @@ let desiredCapabilityConstraints = {
isString: true,
},
deviceName: {
- presence: true,
isString: true
},
- platformVersion: {},
+ platformVersion: {
+ isString: true
+ },
newCommandTimeout: {
isNumber: true
},

MODIFY
test/basedriver/capabilities-specs.js
test/basedriver/capabilities-specs.js
@@ -350,13 +350,6 @@ describe('caps', function () {
processCapabilities(caps, constraints).should.deep.equal(matchingCaps);
});
- it('should fail when deviceName is blank', function () {
- caps = {
- alwaysMatch: _.omit(matchingCaps, ['deviceName']),
- };
- (() => processCapabilities(caps, constraints)).should.throw(/'deviceName' can't be blank/);
- });
-
it('should fail when bad parameters are passed in more than one firstMatch capability', function () {
caps = {
alwaysMatch: {},

MODIFY
test/basedriver/capability-specs.js
test/basedriver/capability-specs.js
@@ -25,26 +25,14 @@ describe('Desired Capabilities', function () {
} catch (e) {
e.should.be.instanceof(errors.SessionNotCreatedError);
e.message.should.contain('platformName');
- e.message.should.contain('deviceName');
return;
}
should.fail('error should have been thrown');
});
- it('should require platformName', async function () {
- try {
- await d.createSession({'platformName': 'iOS'});
- } catch (e) {
- e.should.be.instanceof(errors.SessionNotCreatedError);
- e.message.should.contain('deviceName');
- return;
- }
- should.fail('error should have been thrown');
- });
-
- it('should require deviceName', async function () {
+ it('should require platformName', async function () {
try {
await d.createSession({'deviceName': 'Delorean'});
} catch (e) {
@@ -112,7 +100,6 @@ describe('Desired Capabilities', function () {
} catch (e) {
e.should.be.instanceof(errors.SessionNotCreatedError);
e.message.should.contain('platformName');
- e.message.should.contain('deviceName');
return;
}

fix: Make device name non required (#363)