我们有一个UITextView
包含两个嵌入链接的属性字符串,这些链接是通过使用在文本视图中创建的NSLinkAttributeName
。我们正在使用 Calabash 进行自动化测试,而 Calabash 不能“点击”这些 TextView 内部的链接。有什么我遗漏的东西使这些链接可以在UITextView
自动化/可访问性工具中点击吗?
用户可以点击这些链接,并确认预期的委托回调正在工作。唯一不起作用的情况是使用辅助工具尝试点击UITextView
.
以供参考:
NSDictionary *plainAttributes = [self plainTextAttributes];
NSDictionary *linkAttributes = [self linkAttributes];
NSMutableDictionary *linkOneAttributes = [linkAttributes mutableCopy];
termsOfUseAttributes[NSLinkAttributeName] = @"linkOne";
NSMutableDictionary *linkTwoAttributes = [linkAttributes mutableCopy];
privacyPolicyAttributes[NSLinkAttributeName] = @"linkTwo";
NSMutableAttributedString *string = [NSMutableAttributedString new];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Blah blah blah blah " attributes:plainAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link One" attributes:linkOneAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@". Blah blah blah blah" attributes:plainAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link Two" attributes:linkTwoAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"." attributes:plainAttributes]];
非常感谢在使用NSLinkAttributeName
in的属性字符串时对可访问性的任何见解。UITextView