diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..7aef3fd9d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +#### +# Webstrom + +.idea diff --git a/detox/src/ios/expect.js b/detox/src/ios/expect.js index fb22591e8e..454d7a1f1e 100644 --- a/detox/src/ios/expect.js +++ b/detox/src/ios/expect.js @@ -34,6 +34,14 @@ class LabelMatcher extends Matcher { } } +class IdMatcher extends Matcher { + constructor(value) { + super(); + if (typeof value !== 'string') throw new Error(`IdMatcher ctor argument must be a string, got ${typeof value}`); + this._call = invoke.call(invoke.IOS.Class('GREYMatchers'), 'matcherForAccessibilityId:', value); + } +} + class VisibleMatcher extends Matcher { constructor() { super(); @@ -110,7 +118,8 @@ function element(matcher) { } const by = { - label: (value) => new LabelMatcher(value) + label: (value) => new LabelMatcher(value), + id: (value) => new IdMatcher(value) }; const exportGlobals = function () {