forked from wix/Detox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select date on IOS UIDatePicker with actionForSetDate (wix#1148)
* Select date on IOS UIDatePicker with actionForSetDate * Remove IOSOnly suffix from method name * Remove extraneous line * Add documentation for setDatePickerDate
- Loading branch information
1 parent
bc69538
commit 6a1d700
Showing
12 changed files
with
140 additions
and
29 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// GREYActions+Detox.h | ||
// Detox | ||
// | ||
// Created by Matt Findley on 2/7/19. | ||
// Copyright © 2019 Wix. All rights reserved. | ||
// | ||
|
||
@import Foundation; | ||
#import <EarlGrey/EarlGrey.h> | ||
|
||
@interface GREYActions (Detox) | ||
|
||
+ (id<GREYAction>)detoxSetDatePickerDate:(NSString *)dateString withFormat:(NSString *)dateFormat; | ||
|
||
@end |
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,23 @@ | ||
// | ||
// GREYActions+Detox.m | ||
// Detox | ||
// | ||
// Created by Matt Findley on 2/7/19. | ||
// Copyright © 2019 Wix. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "GREYActions+Detox.h" | ||
#import <EarlGrey/GREYActions.h> | ||
|
||
@implementation GREYActions (Detox) | ||
|
||
+ (id<GREYAction>)detoxSetDatePickerDate:(NSString *)dateString withFormat:(NSString *)dateFormat | ||
{ | ||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | ||
formatter.dateFormat = dateFormat; | ||
|
||
NSDate *date = [formatter dateFromString:dateString]; | ||
return [GREYActions actionForSetDate:date]; | ||
} | ||
@end |
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,31 @@ | ||
/** | ||
This code is generated. | ||
For more information see generation/README.md. | ||
*/ | ||
|
||
|
||
|
||
class GREYActions { | ||
static detoxSetDatePickerDateWithFormat(dateString, dateFormat) { | ||
if (typeof dateString !== "string") throw new Error("dateString should be a string, but got " + (dateString + (" (" + (typeof dateString + ")")))); | ||
if (typeof dateFormat !== "string") throw new Error("dateFormat should be a string, but got " + (dateFormat + (" (" + (typeof dateFormat + ")")))); | ||
return { | ||
target: { | ||
type: "Class", | ||
value: "GREYActions" | ||
}, | ||
method: "detoxSetDatePickerDate:withFormat:", | ||
args: [{ | ||
type: "NSString", | ||
value: dateString | ||
}, { | ||
type: "NSString", | ||
value: dateFormat | ||
}] | ||
}; | ||
} | ||
|
||
} | ||
|
||
module.exports = GREYActions; |
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
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