diff --git a/index.html b/index.html index 7b705c2..e6e0f2b 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@
- +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! ๐ง
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
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! ๐
-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
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
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
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! ๐