theappbusiness / TABTestKit

Library designed to make writing and maintaining automated tests for iOS applications. This includes automation of bio-metrics and controlling of mock servers
MIT License
59 stars 13 forks source link

Tappable for Label #148

Closed bartzet closed 3 years ago

bartzet commented 3 years ago

👋 Hello

Can you please add Tappable to /TABTestKit/Classes/Elements/Label.swift?

zacoid55 commented 3 years ago

Heya @bartzet - I'll endeavour to take a look into this or possibly @roger-tan or @annapiktas. In the mean time do you have any updates?

roger-tan commented 3 years ago

That should be possible if Label is conform to the protocol with Tappable. Have you got chance to get this working by chance? When I have some free time, I could have a look to make conform to Tappable and update our example test against that.

bartzet commented 3 years ago

That should be possible if Label is conform to the protocol with Tappable.

That's correct. It needs to be implemented on the framework level though.

When I applied the change to the framework's code I managed to make it work but it would be great if the framework could support it.

Thanks

stefanrenne commented 3 years ago

@bartzet That's not really how Apple wants you to use labels. try setting accessibilityTraits of your Label to .button (or .link) And use TABKit's Button() This makes your app also better usable for people with viewing problems & accessibility enabled

More information: https://developer.apple.com/documentation/uikit/uiaccessibility/uiaccessibilitytraits

static var button: UIAccessibilityTraits
The accessibility element behaves like a button.

static var link: UIAccessibilityTraits
The accessibility element behaves like a link.
bartzet commented 3 years ago

That's fine. This is what I've been doing so far. Thank you for your comments, appreciate it.