(caps, fn)
| 540 | } |
| 541 | |
| 542 | _runWithCaps(caps, fn) { |
| 543 | if (typeof caps === 'object') { |
| 544 | for (const key in caps) { |
| 545 | // skip if capabilities do not match |
| 546 | if (this.config.desiredCapabilities[key] !== caps[key]) { |
| 547 | return |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | if (typeof caps === 'function') { |
| 552 | if (!fn) { |
| 553 | fn = caps |
| 554 | } else { |
| 555 | // skip if capabilities are checked inside a function |
| 556 | const enabled = caps(this.config.desiredCapabilities) |
| 557 | if (!enabled) return |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | fn() |
| 562 | } |
| 563 | |
| 564 | /** |
| 565 | * Returns app installation status. |
no test coverage detected