Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move generation to babel 7 #762

Merged
merged 3 commits into from
Oct 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions detox/src/ios/earlgreyapi/EarlGreyImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ function sanitize_uiDeviceOrientation(value) {
}
class EarlGreyImpl {
/*Provides the file name and line number of the code that is calling into EarlGrey.
In case of a failure, the information is used to tell XCTest the exact line which caused
the failure so it can be highlighted in the IDE.

@param fileName The name of the file where the failing code exists.
@param lineNumber The line number of the failing code.

@return An EarlGreyImpl instance, with details of the code invoking EarlGrey.
*/static invokedFromFileLineNumber(fileName, lineNumber) {
In case of a failure, the information is used to tell XCTest the exact line which caused
the failure so it can be highlighted in the IDE.
@param fileName The name of the file where the failing code exists.
@param lineNumber The line number of the failing code.
@return An EarlGreyImpl instance, with details of the code invoking EarlGrey.*/
static invokedFromFileLineNumber(fileName, lineNumber) {
if (typeof fileName !== "string") throw new Error("fileName should be a string, but got " + (fileName + (" (" + (typeof fileName + ")"))));
if (typeof lineNumber !== "number") throw new Error("lineNumber should be a number, but got " + (lineNumber + (" (" + (typeof lineNumber + ")"))));
return {
Expand All @@ -42,16 +42,16 @@ the failure so it can be highlighted in the IDE.
}

/*Rotate the device to a given @c deviceOrientation. All device orientations except for
@c UIDeviceOrientationUnknown are supported. If a non-nil @c errorOrNil is provided, it will
be populated with the failure reason if the orientation change fails, otherwise a test failure
will be registered.

@param deviceOrientation The desired orientation of the device.
@param[out] errorOrNil Error that will be populated on failure. If @c nil, a test
failure will be reported if the rotation attempt fails.

@return @c YES if the rotation was successful, @c NO otherwise.
*/static rotateDeviceToOrientationErrorOrNil(element, deviceOrientation) {
@c UIDeviceOrientationUnknown are supported. If a non-nil @c errorOrNil is provided, it will
be populated with the failure reason if the orientation change fails, otherwise a test failure
will be registered.
@param deviceOrientation The desired orientation of the device.
@param[out] errorOrNil Error that will be populated on failure. If @c nil, a test
failure will be reported if the rotation attempt fails.
@return @c YES if the rotation was successful, @c NO otherwise.*/
static rotateDeviceToOrientationErrorOrNil(element, deviceOrientation) {
if (!["landscape", "portrait"].some(option => option === deviceOrientation)) throw new Error("deviceOrientation should be one of [landscape, portrait], but got " + deviceOrientation);
return {
target: element,
Expand All @@ -64,16 +64,16 @@ failure will be reported if the rotation attempt fails.
}

/*Shakes the device. If a non-nil @c errorOrNil is provided, it will
be populated with the failure reason if the orientation change fails, otherwise a test failure
will be registered.

@param[out] errorOrNil Error that will be populated on failure. If @c nil, the a test
failure will be reported if the shake attempt fails.

@throws GREYFrameworkException if the action fails and @c errorOrNil is @c nil.
@return @c YES if the shake was successful, @c NO otherwise. If @c errorOrNil is @c nil and
the operation fails, it will throw an exception.
*/static shakeDeviceWithError(element) {
be populated with the failure reason if the orientation change fails, otherwise a test failure
will be registered.
@param[out] errorOrNil Error that will be populated on failure. If @c nil, the a test
failure will be reported if the shake attempt fails.
@throws GREYFrameworkException if the action fails and @c errorOrNil is @c nil.
@return @c YES if the shake was successful, @c NO otherwise. If @c errorOrNil is @c nil and
the operation fails, it will throw an exception.*/
static shakeDeviceWithError(element) {
return {
target: element,
method: "shakeDeviceWithError:",
Expand All @@ -82,13 +82,13 @@ the operation fails, it will throw an exception.
}

/*Dismisses the keyboard by resigning the first responder, if any. Will populate the provided
error if the first responder is not present or if the keyboard is not visible.

@param[out] errorOrNil Error that will be populated on failure. If @c nil, a test
failure will be reported if the dismissing fails.

@return @c YES if the dismissing of the keyboard was successful, @c NO otherwise.
*/static dismissKeyboardWithError(element) {
error if the first responder is not present or if the keyboard is not visible.
@param[out] errorOrNil Error that will be populated on failure. If @c nil, a test
failure will be reported if the dismissing fails.
@return @c YES if the dismissing of the keyboard was successful, @c NO otherwise.*/
static dismissKeyboardWithError(element) {
return {
target: element,
method: "dismissKeyboardWithError:",
Expand Down
Loading