diff --git a/index.html b/index.html index 7b705c2..e6e0f2b 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + jhandguy diff --git a/posts/path-to-cicd-nirvana-ios/index.html b/posts/path-to-cicd-nirvana-ios/index.html index 31a5eb7..f785205 100644 --- a/posts/path-to-cicd-nirvana-ios/index.html +++ b/posts/path-to-cicd-nirvana-ios/index.html @@ -96,24 +96,24 @@

Continuous Integration (CI)

We all know it, UI Testing is a pain when it comes to stability and maintainability, but donโ€™t you worry, I might just have what you are looking for! ๐Ÿง

UI Testing in iOS - The Ultimate Guide

Thatโ€™s right, I made a complete guide for you to get started with stable, maintainable and scalable UI testing in iOS! ๐ŸŽ‰

-

๐Ÿ”Œ Mocking the Network

+

๐Ÿ”Œ Mocking the Network

The first thing you need to take care of is Mocking the Network. You donโ€™t want to let your network requests hit an actual network and there are mainly two reasons for that.

Isolation. Of course, what if your backend friends break their test server? Well, your UI Tests will fail as well, even though nothing is wrong with the app ๐Ÿ˜ฑ So now youโ€™ll say โ€œWell let’s deploy a dedicated environment for it then!โ€. And whose ownership will that be? iOS devs? Or Backend devs? Isnโ€™t that a little bit over-engineering? ๐Ÿค” Mocking the Network allows you to avoid unnecessary headaches and โ€œJust re-trigger it!โ€ kind of workflows. ๐Ÿ˜†

Monitoring. Well yes, if you mock or stub the network, that means you need to predict exactly how many calls are going to be made during your UI test and thatโ€™s extremely valuable because you might sometimes find out that your app is actually making unnecessary calls which are eating your userโ€™s data! ๐Ÿ˜ฎ

Overall, Mocking the Network gives you full control and helps to keep your UI tests stability to a very high standard! ๐Ÿ’ช

If you want to read more about Mocking the Network, go ahead and check out my dedicated article! ๐Ÿ‘€

-

๐Ÿšฆ Stubbing the Navigation

+

๐Ÿšฆ Stubbing the Navigation

The second thing you want to address is Stubbing the Navigation. One major pain point with iOS UI Testing is that every test will always relaunch the app entirely. This means that you are forced to go through several screens manually before getting to the one you actually want to test. That breaks the isolation principle, making UI tests hard to debug. ๐Ÿ˜•

One way of solving this is to inject a stub that will route your navigation in the exact screen you want to end up on. Of course, that also means that your navigation logic must be centralised in a dedicated layer like the Coordinator for instance! ๐Ÿšฆ

That way, your UI Tests will suddenly become blazingly fast, but also more isolated, stable and easier to maintain! ๐Ÿš€

If you want to read more about Stubbing the Navigation, go ahead and check out my dedicated article! ๐Ÿ‘€

-

๐Ÿ“บ Disabling Animations

+

๐Ÿ“บ Disabling Animations

The third action you might want to take is Disabling Animations. This one is a quick and easy win, simply disabling animations while UI testing will make your tests not only faster but more stable as animations wonโ€™t be a potential risk for your assertions. ๐Ÿ‘

If you want to read more about Disabling Animations, go ahead and check out my dedicated article! ๐Ÿ‘€

-

๐Ÿ”ฎ Generating Accessibility Identifiers using Reflection

+

๐Ÿ”ฎ Generating Accessibility Identifiers using Reflection

Until now, Accessibility Identifiers have always been assigned manually. This is a pain and most importantly unnecessary noise in your code so you should avoid doing this. Generating Accessibility Identifiers using Reflection is a great way to get rid of all this manual work, but instead, let your code generate it for you at runtime! ๐Ÿคฏ

If you want to read more about Generating Accessibility Identifiers using Reflection, go ahead and check out my dedicated article! ๐Ÿ‘€

-

๐Ÿค– Implementing the Robot Pattern

+

๐Ÿค– Implementing the Robot Pattern

Finally, UI Tests are not only meant to be verifying that your app still behaves as expected, but they also can serve as implicit documentation of how your app works, what the main features are, for your new hires who do not have a clue about the product yet! ๐Ÿ˜ฎ

Implementing the Robot Pattern will not only help you separate the What from the How of your UI Tests and make screen assertions reusable across UI Tests, but also provide a more human-readable way of specifying tests! ๐Ÿ˜Ž

If you want to read more about Implementing the Robot Pattern, go ahead and check out my dedicated article! ๐Ÿ‘€