MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / _runWithCaps

Method _runWithCaps

lib/helper/Appium.js:542–562  ·  view source on GitHub ↗
(caps, fn)

Source from the content-addressed store, hash-verified

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.

Callers 2

runOnIOSMethod · 0.95
runOnAndroidMethod · 0.95

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected