-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #726
- Loading branch information
Daniel Schmidt
committed
Nov 24, 2018
1 parent
118eb73
commit 1395964
Showing
16 changed files
with
467 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/** | ||
This code is generated. | ||
For more information see generation/README.md. | ||
*/ | ||
|
||
|
||
function sanitize_matcher(matcher) { | ||
if (!matcher._call) { | ||
return matcher; | ||
} | ||
|
||
const originalMatcher = typeof matcher._call === 'function' ? matcher._call() : matcher._call; | ||
return originalMatcher.type ? originalMatcher.value : originalMatcher; | ||
} | ||
class DetoxAssertion { | ||
static assertMatcher(i, m) { | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "com.wix.detox.espresso.DetoxAssertion" | ||
}, | ||
method: "assertMatcher", | ||
args: [{ | ||
type: "Invocation", | ||
value: i | ||
}, { | ||
type: "Invocation", | ||
value: sanitize_matcher(m) | ||
}] | ||
}; | ||
} | ||
|
||
static assertNotVisible(i) { | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "com.wix.detox.espresso.DetoxAssertion" | ||
}, | ||
method: "assertNotVisible", | ||
args: [{ | ||
type: "Invocation", | ||
value: i | ||
}] | ||
}; | ||
} | ||
|
||
static assertNotExists(i) { | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "com.wix.detox.espresso.DetoxAssertion" | ||
}, | ||
method: "assertNotExists", | ||
args: [{ | ||
type: "Invocation", | ||
value: i | ||
}] | ||
}; | ||
} | ||
|
||
static waitForAssertMatcher(i, m, timeoutSeconds) { | ||
if (typeof timeoutSeconds !== "number") throw new Error("timeoutSeconds should be a number, but got " + (timeoutSeconds + (" (" + (typeof timeoutSeconds + ")")))); | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "com.wix.detox.espresso.DetoxAssertion" | ||
}, | ||
method: "waitForAssertMatcher", | ||
args: [{ | ||
type: "Invocation", | ||
value: i | ||
}, { | ||
type: "Invocation", | ||
value: sanitize_matcher(m) | ||
}, { | ||
type: "Double", | ||
value: timeoutSeconds | ||
}] | ||
}; | ||
} | ||
|
||
static waitForAssertMatcherWithSearchAction(i, m, searchAction, searchMatcher) { | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "com.wix.detox.espresso.DetoxAssertion" | ||
}, | ||
method: "waitForAssertMatcherWithSearchAction", | ||
args: [{ | ||
type: "Invocation", | ||
value: i | ||
}, { | ||
type: "Invocation", | ||
value: sanitize_matcher(m) | ||
}, searchAction, { | ||
type: "Invocation", | ||
value: sanitize_matcher(searchMatcher) | ||
}] | ||
}; | ||
} | ||
|
||
} | ||
|
||
module.exports = DetoxAssertion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.