Comments (4)
I implemented replaceText as a custom action and it's much faster.
func grey_replaceText(text: String) -> GREYAction {
return GREYActionBlock.actionWithName("Replace text \"\(text)\"", constraints: grey_not(grey_systemAlertViewShown()),
performBlock: { element, errorOrNil in
(element as? UITextField)!.text = text
return true
})
}
from earlgrey.
New version with error reporting:
func grey_replaceText(text: String) -> GREYAction {
return GREYActionBlock.actionWithName("Replace text \"\(text)\"", constraints: grey_not(grey_systemAlertViewShown()),
performBlock: { element, errorOrNil in
guard let textfield = element as? UITextField else {
let reasonAndDetails: String = "grey_replaceText failed. Element is not a UITextField"
let userInfo: [NSObject : AnyObject] = [NSLocalizedDescriptionKey: reasonAndDetails]
errorOrNil.memory = NSError(domain: kGREYInteractionErrorDomain,
code: GREYInteractionErrorCode.ActionFailedErrorCode.rawValue,
userInfo: userInfo)
return false
}
textfield.text = text
return true
})
}
from earlgrey.
Looks like you already have something that works. Can we close the bug?
from earlgrey.
Looks like you already have something that works. Can we close the bug?
I'd like grey_replaceText
to be in EarlGrey core so that it's not required to create a custom action. This also brings us closer to parity with Espresso's type text methods.
from earlgrey.
Related Issues (20)
- [EarlGrey2] AppFramework does not build - 'GREYUILibUtils.h' file not found HOT 2
- Library not loaded: @rpath/AppFramework.framework/AppFramework
- [EarlGrey1] "Failed to load the test bundle" error in Xcode 14
- Failed to load module 'Helper Bundle' after running some test cases in EarlGrey2
- Blacklist UICompatibilityInputViewController from being tracked above iOS 13. HOT 1
- NSInvalidArgumentException unrecognized selector exception EarlGrey2
- How to integrate UILib (libUILib.a) into UITest/Bundle
- [EarlGrey2] Cocoapods support for MacOS Bundle (White Box Testing)
- Default example test crashes
- [EarlGrey2] Host background port not assigned. Application under test may have failed to launch with latest Cocoapods HOT 1
- Apple Watch Support HOT 2
- SwiftUI ViewRepresentable and UIViewRepresentable is not correctly placed in element hierarchy. HOT 2
- [SwiftUI] Anyway to convert EDOObject to SwiftUI View? HOT 1
- Videos/tutorials for new starters
- EarlGrey build failure
- Apple Vision Pro support
- Cannot find 'EDOHostPort' in scope HOT 2
- Earlgrey Cocoapods v2.2.2 crashes on XCode 15 HOT 3
- Version 2.2.2 fails to build in Xcode 15
- Instability testing with Xcode 15 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earlgrey.