-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add support for Selector.instance
on iOS
#952
Conversation
aad22b8
to
98dc243
Compare
4c35b9f
to
acc10fe
Compare
acc10fe
to
aa24993
Compare
381bae9
to
9a01642
Compare
… the automation server
9a01642
to
874df90
Compare
Unfortunately, there are some very strange problems with
(The log above was obtained with I performed some debugging of the func enterText(_ data: String, byIndex index: Int, inApp bundleId: String) async throws {
try await runAction("entering text \(format: data) by index \(index) in app \(bundleId)") {
let app = try self.getApp(withBundleId: bundleId)
// elementType must be specified as integer
// See:
// * https://developer.apple.com/documentation/xctest/xcuielementtype/xcuielementtypetextfield
// * https://developer.apple.com/documentation/xctest/xcuielementtype/xcuielementtypesecuretextfield
let textFieldPredicate = NSPredicate(format: "elementType == 49")
let secureTextFieldPredicate = NSPredicate(format: "elementType == 50")
let predicate = NSCompoundPredicate(
orPredicateWithSubpredicates: [textFieldPredicate, secureTextFieldPredicate]
)
let elementQuery = app.descendants(matching: .any).matching(predicate)
guard let element = self.waitForView(query: elementQuery, index: index) else {
throw PatrolError.viewNotExists("text field at index \(index) in app \(bundleId)")
}
element.tap() // works just fine
element.typeText(data) // <- crashes here
}
} Happens both on CI and on Simulator. Also, happens almost always on the StackOverflow site, but rarely on the "login" website. |
This reverts commit 9db9e4d.
This reverts commit 9db9e4d.
Another example of this crash, this time patrol test -t integration_test/webview_stackoverflow_test.dart --wait 3 Code import 'common.dart';
void main() async {
patrol(
'interacts with the StackOverflow website in a webview',
($) async {
await createApp($);
await $('Open webview (StackOverflow)').scrollTo().tap();
await $.native.tap(Selector(text: 'Accept all cookies'));
await $.native.tap(Selector(text: 'Log in'));
await $.pump(Duration(seconds: 2));
await $.native.enterTextByIndex('[email protected]', index: 0);
await $.native.enterTextByIndex('ny4ncat', index: 1);
await $.native.tap(Selector(text: 'Log in'));
},
);
} Logs Expand to see the logs
Video crash.ugh.mp4What the hell. |
Fix #663