<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paweł Zemsta on Medium]]></title>
        <description><![CDATA[Stories by Paweł Zemsta on Medium]]></description>
        <link>https://medium.com/@pawel.zemsta?source=rss-61147f5860f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0ZzvFnegML6EGiJl5_-BnQ.png</url>
            <title>Stories by Paweł Zemsta on Medium</title>
            <link>https://medium.com/@pawel.zemsta?source=rss-61147f5860f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:33:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pawel.zemsta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[UI Tests on iOS]]></title>
            <link>https://medium.com/azimolabs/ui-tests-on-ios-a7883ca72358?source=rss-61147f5860f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7883ca72358</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Paweł Zemsta]]></dc:creator>
            <pubDate>Tue, 01 Sep 2020 09:05:33 GMT</pubDate>
            <atom:updated>2021-03-10T11:55:32.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bh5oe7JvfBCP68tgY7KQSQ.png" /></figure><h4>Testing automation done right</h4><p>Many of today’s mobile applications display customized content to user, base on dynamic parameters. The <strong>Azimo</strong> application is no different.</p><p>With our mobile platform, our customers can transfer money to almost every country all over the world. There are literally thousands of combinations of sending and receiving countries, payments, and delivery methods.</p><p>Combinations of these parameters can be a big challenge for the QA engineering team. Ideally, every possible case should be covered. That’s why It’s not the best idea to test this type of functionality manually. We need to write test automation not to do this tedious work over and over again. <br>Read more about why “<a href="https://medium.com/azimolabs/automated-testing-will-set-your-engineering-team-free-a89467c40731">Automated testing will set your engineering team free.</a>”</p><p><a href="https://medium.com/azimolabs/automated-testing-will-set-your-engineering-team-free-a89467c40731">Automated testing will set your engineering team free</a></p><p>In this article, I will show how we approach writing automation tests for functionalities with dynamic content while trying to create the most flexible and readable code.</p><h3><strong>1. What are we going to test?</strong></h3><p>The <strong>Azimo</strong> app helps our customers to transfer money around the world. To ensure that the user experience is at the highest possible level, we introduced a functionality called “<strong>How it works.</strong>” It explains what to do to send money to the customer’s recipient, with the selected delivery method. Let’s prepare the testing automation for it together.</p><p>Here are the structure of the functionality and the expected test result. From a technical point of view, this feature is a bottom sheet containing a four-step explanation of how to create a transfer and additional information about the selected destination country.</p><p>It looks like this:</p><p><strong>Navigation bar:</strong></p><ul><li>name of the country to which we want to send money,</li><li>short description</li></ul><p><strong>Content:</strong></p><ul><li>header,</li><li>four steps to send a transfer, each including: <br>- title, <br>- description</li></ul><p>Now, I want to implement tests that are comparing data of two objects. It’s a standard assertion, where the first object contains expected data, and the second is fetched from the application (so this is what users see on the screen).</p><p>This is how the assertion looks like:</p><p><strong>AssertEqual</strong>(<strong>ObjectWIthExpectedData</strong>, <strong>ObjectWithFetchedData</strong>)</p><p>First thing — we have to consider whether each of the above elements will be present for every single test case. In our case, the answer is “<em>yes</em>”. It means that for each country + delivery method combination, we display the name of the country, short description, header, and four steps.</p><p>If this isn’t true (e.g., some configurations have fewer or more steps), we would need to set some parameters as optional. In that situation, we would need to find the boundary conditions (a minimum and a maximum number of steps) and set everything except the minimum/maximum number of steps as optional.</p><h3>2. Navigate to the bottom sheet</h3><p>Let’s start by navigating to the <strong>How it works</strong> bottom sheet in the app. In the <strong>verifyHowItWorksBottomSheet()</strong> function, wait until the <strong>How it works</strong> button appears and click on it to start verifying the correctness of the displayed data (the description of the entire function is presented later in this article).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ba41DHQhIYIEy_8kUu8Ejg.png" /></figure><h3>3. Create an object that collects data visible on the screen</h3><p>As I mentioned in the previous point, each step in the instruction contains a title and a short description. So we create a new <strong>HowItWorksBottomSheetCell</strong> — the class responsible for getting this data from the screen. To simplify and unambiguous searching for elements in the DOM tree, I added appropriate identifiers for them. The title is marked with the <strong>HowItWorksSheet_title</strong> identifier, while the description is <strong>HowItWorksSheet_subtitle</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*emQTe3fiJu8K8nfYuuW4DA.png" /></figure><h3>4. Create an object containing the expected data</h3><p>Now let’s move on to creating an object with data that we expect to be displayed in the application for a specific country + delivery method combination.</p><p>We create two structures <strong>HowItWorksBottomSheetData</strong> and <strong>Cell</strong> with parameters:</p><ul><li>title</li><li>navbar Title</li><li>navBarSubtitle</li><li>position1, position2, position3, position4, which will be of the <strong>Cell</strong> type and contain parameters:<br> - title<br> - subtitle</li></ul><p>Because the title, the description in the navigation bar, and the title in the content section will be the same for each step, we provide them only once for the entire object. However, the content (title, description) of individual steps will be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tKV6WDgFDCn0glxR3dJtg.png" /></figure><p>As for different combinations, we expect different output, using the parameters passed in the function <strong>for(country, deliveryMethod) </strong>and the conditional statement <strong>switch,</strong> I will be able to choose the option we are interested in and extract the necessary data from it.</p><p>The <strong>for</strong> function takes two parameters, which are enums:</p><ul><li><strong>country</strong> type: <strong>CountryLabel</strong></li><li><strong>deliveryMethod</strong> type: <strong>DeliveryMethod</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fiIKd9SVkyYJZA4lJMmgHA.png" /></figure><p>For example, for country Philippines and delivery methods Cash pick-up we will select accordingly:</p><p><strong>case(.philippines, .cashPickUp)</strong>.</p><p>Remember to cover all the most critical test cases. If some of them overlap, i.e., we expect the same data, we can group them.</p><h3>5. Create a function comparing the data of both objects</h3><p>Now, when we have an object with expected data and the one with data taken from the app, we need to compare them. For this purpose, we will write the function <strong>verifyHowItWorksBottomSheet()</strong>, which takes two parameters: <strong>country</strong> and <strong>deliveryMethod</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bh5oe7JvfBCP68tgY7KQSQ.png" /></figure><p>As you can see in the above screenshot, we also use the <strong>howItWorksBottomSheetGetCellAtIndex() </strong>function, which returns a <strong>HowItWorksSheetCell</strong> (step) object in the appropriate position (<strong>index</strong>). The implementation is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A7xzA-KjdZP9kvPR" /></figure><p>We retrieved all expected data for a specific <strong>country + delivery</strong> method to the <strong>data</strong> variable.</p><p>In case you cannot download <strong>data</strong> to the data object, the test will fail with appropriate information about the error in the logs.</p><p>The <strong>closeButton</strong>, <strong>navBarTitle</strong>, <strong>navBarSubtitle,</strong> and <strong>header</strong> variables only appear once on the screen, so there is no need to create a separate class for them as they will not be reused. We can declare them as variables in the base class and compare the contents like the rest to the data object’s parameters.</p><p>This is how we call the comparison function in the test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6iBWBz7Z9VA84EQm" /></figure><p>To make the logs in the console and test logs in <strong>Xcode</strong> more transparent, I use <strong>XCTActivity</strong>, making it clear and legible for me to see when the bottom sheet was verified:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1gS--cmFHuZ3GFxa" /></figure><h3>6. Summary</h3><p><strong>Here are the advantages of the presented solution:</strong></p><ul><li>In the case of changes to the application code or translations, we have to change only one place in the tests, not in each test case separately.</li><li>We have clear and transparent code even for non-technical people.</li><li>We cover all expected test scenarios.</li><li>The solution is easy to maintain and extend.</li><li>We have great control over data from the test level.</li></ul><p>I hope the solution I have presented will allow you to look at writing automated tests from a different perspective. I highly encourage you to implement it in your project and let me know how it goes. If you have any questions or suggestions, feel free to leave a comment or contact us directly.</p><h3>Towards financial services available to all</h3><p>We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our <a href="http://bit.ly/3vajnu6">careers page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7883ca72358" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azimolabs/ui-tests-on-ios-a7883ca72358">UI Tests on iOS</a> was originally published in <a href="https://medium.com/azimolabs">AzimoLabs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to test push notifications in UI Tests]]></title>
            <link>https://medium.com/azimolabs/https-medium-com-pawel-zemsta-how-to-test-push-notifications-in-ui-tests-8ac76007c095?source=rss-61147f5860f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ac76007c095</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[push-notification]]></category>
            <dc:creator><![CDATA[Paweł Zemsta]]></dc:creator>
            <pubDate>Thu, 12 Sep 2019 13:10:43 GMT</pubDate>
            <atom:updated>2021-03-10T11:58:32.434Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to test push notifications with UI tests</h3><h4><strong>Automated testing of push notifications on iOS</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*3O73bKAKkoTT3ijybJNpfQ.jpeg" /></figure><p>New software features need to be tested in a variety of different ways. If you don’t do thorough tests, you will break things. When you break things, you lose customers.</p><p>At the same time, no company has infinite resources. At Azimo, for instance, we assume that new functionality will be tested manually only once. For the rest, we rely on <a href="https://medium.com/azimolabs/automated-testing-will-set-your-engineering-team-free-a89467c40731">automated testing</a>.</p><p>Why have we invested so much time and money in building automated testing software? Because it saves time and allows us to test more thoroughly than any human could.</p><p>Let’s imagine that before each application release, we had to manually test all functionality. Not only would the work be incredibly tedious, but we would risk mistakes thanks to <a href="https://en.wikipedia.org/wiki/Human_error">human error</a>.</p><p>In addition, the ever-increasing complexity of our application would continue to increase the intensity of our testing schedule. New features must be tested not only for how they work independently, but how they affect existing code. That’s a lot of additional testing.</p><p>Eventually, we would spend more time testing than coding, and our release cycle would slip from weekly to monthly and beyond. Automated testing solves that problem.</p><p>But not everything can be handled by automatic integration tests, especially those run on simulators. Simulators do not have the same features as a real device, such as push notifications. Testing the full flow of a push notification has always been a manual job, until now. In the step-by-step guide below, I will show you how we automated push notification testing for the Azimo app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*7D4I1kiP2x2TL8IUUPi9ug.gif" /><figcaption>Full flow from sending push to receiving</figcaption></figure><p><strong>1. Check whether the tests work on a real device</strong></p><p>Assuming that the entire test cycle is run on many simulators running simultaneously, to avoid unnecessary failure of tests, we add the following condition before the name of the test class:</p><pre><strong>#if !targetEnvironment(simulator)</strong></pre><p>and at the end of the test class:</p><pre><strong>#endif</strong></pre><p>This condition checks whether the tests run on the simulator or on a real device.</p><p><strong>2. Launch the application on a real device.</strong></p><p><strong>3. Check if the user has push notifications enabled.</strong></p><p>In this case, I open the settings screen of the device and check whether the switch responsible for push notification is set to true. If not, I change its value to true by clicking on the switch and then on “Allow” when the permissions pop-up appears.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f968f08fe9bdf1cd64843ccbd3ce490/href">https://medium.com/media/7f968f08fe9bdf1cd64843ccbd3ce490/href</a></iframe><p><strong>4.</strong> <strong>Launch the home screen.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e383f7e5748f53c5824a73efeb55aa5/href">https://medium.com/media/0e383f7e5748f53c5824a73efeb55aa5/href</a></iframe><p><strong>5</strong>. <strong>Launch Notification Center on the device.</strong></p><p>To run the Notification Center, we need to simulate swiping from the top of the device’s screen, which we can do like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f01efb90317bf0ef46af5059b87c32fe/href">https://medium.com/media/f01efb90317bf0ef46af5059b87c32fe/href</a></iframe><p><strong>6.</strong> <strong>Make a request for push notifications from Braze (the software that manages Azimo’s push notifications).</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5acdff20f2f2d1a10d778ee1fdf6cdba/href">https://medium.com/media/5acdff20f2f2d1a10d778ee1fdf6cdba/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96566fcccd9487ace2dd1a79e2b8cfab/href">https://medium.com/media/96566fcccd9487ace2dd1a79e2b8cfab/href</a></iframe><p><strong>7. Check that the title and description of the push notification are correct.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*v8LOwiEGcTEksOaetPzT5A.png" /><figcaption>Push notification received on device</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fbba74a6609e45a68c97c02fc47f979/href">https://medium.com/media/2fbba74a6609e45a68c97c02fc47f979/href</a></iframe><p><strong>8. Open the notification and check whether the correct view has been opened in the application and making the appropriate assertion.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*-67JMPxpaeANMp0JS_IQhQ.png" /><figcaption>View opened after clicked on notification</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea6189f8a2d1f7bcd4ff05d5a010c577/href">https://medium.com/media/ea6189f8a2d1f7bcd4ff05d5a010c577/href</a></iframe><p>I hope these steps will help you to build your own automated push notification tests, so that your testing cycle gets faster and your app remains bug-free 😄.</p><p>If you have any questions, feel free to post in the comment section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4PmC-lEO8TrQWBvG.png" /></figure><h3>Towards financial services available to all</h3><p>We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our <a href="http://bit.ly/3vajnu6">careers page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ac76007c095" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azimolabs/https-medium-com-pawel-zemsta-how-to-test-push-notifications-in-ui-tests-8ac76007c095">How to test push notifications in UI Tests</a> was originally published in <a href="https://medium.com/azimolabs">AzimoLabs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallel testing: get feedback earlier, release faster]]></title>
            <link>https://medium.com/azimolabs/parallel-testing-get-feedback-earlier-release-faster-b66d4dd08930?source=rss-61147f5860f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b66d4dd08930</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Paweł Zemsta]]></dc:creator>
            <pubDate>Fri, 28 Dec 2018 09:14:33 GMT</pubDate>
            <atom:updated>2021-03-10T12:11:43.296Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to test your iOS apps with Xcode 10 effectively</h4><p>As the only person responsible for testing the Azimo iOS app, I encounter problems of all sizes. When I started at Azimo nearly four years ago, testing was 100% manual. A full test cycle could take up to two days 😱. Some functionality wasn’t tested at all, let alone on different devices and operating systems.</p><p>These days, only 15% of our testing is manual. Automation has made us faster and more efficient. In 2018, we 99.9% of our users were crash-free. Due to the complexity of our application, however, a full test cycle took around eight hours. More than half of this time was taken up by automated tests. Given that we release at least once per week, we needed to find a way to reduce our test cycle even further.</p><p>Fortunately, on June 5th, a revolution arrived. At the WWDC 2018 conference, Apple announced support for parallel testing in Xcode 10. This reduced our cycle of 250 automated tests to around 55 minutes and made my life a lot less stressful in the process 😎.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NiA199QsTXdP7TDkMV4NgQ.png" /><figcaption>Integration takes ~56 minutes on 5 simulators with 247 test cases — 98.38% passed</figcaption></figure><p>In this article, I will guide you through the benefits of parallel testing as we have experienced them at Azimo. I will outline what we test, how we configured our machine and the problems that we encountered. I will also provide some tips and tricks that will help you to get the most out of parallel testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*p-2bngR1wA_rd6AiIpKOkg.gif" /><figcaption>Testing in parallel on 5 simulators</figcaption></figure><h3>Parallel testing in UI Tests</h3><p>Parallel testing was introduced for iOS devices in Xcode 9. Since then, we have been able to test different classes in parallel on different devices. The Xcode 9 version, however, required us to use the command line with appropriate parameters.</p><h3>Xcode 10</h3><p>The revolutionary feature of Xcode 10 is an automation tester — the ability to run different test classes simultaneously on multiple simulators directly from the Xcode level, with far less effort from a human tester. It’s as simple as enabling the feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*APlZL7OoItcnJ_jde_K-Bg.gif" /><figcaption>How to enable parallel testing option</figcaption></figure><p>In this mode, Xcode creates several clones of the same simulator (e.g. if we use the iPhone X simulator, then Xcode creates simulated iPhone X clones). This only works for simulated devices. We will tackle parallel testing on physical devices later in the article.</p><h4>Benefits:</h4><ul><li>Simple, intuitive configuration</li><li>Faster test execution</li><li>Faster feedback</li><li>Allows for more releases</li><li>Check the application server on multiple devices at the same time (request, timeouts etc.)</li><li>No need to create further test targets, to distribute test classes between them</li><li>Great integration with CI</li></ul><h4>Drawbacks:</h4><ul><li>In the case of an unstable back-end / application server the possibility of occurring timeouts (several requests at the same time may cause longer responses)</li><li>Plenty of processing power needed to keep simulators stable</li><li>Flakiness — if any of the above problems occur</li><li>Cloning the same device / system configuration, not being able to test at the same time on several different configurations (we must use the command line)</li></ul><h4>Assumptions:</h4><p>The basic condition that must be met to use parallel testing is the independence of test cases. For example:</p><ul><li>We cannot rely on test B starting only after test A is complete</li><li>A faster execution or result of test B cannot affect the results of test A and vice versa</li></ul><h4>Useful parameters:</h4><pre><strong>maximum-concurrent-test-simulator-destinations NUMBER </strong>the maximum number of simulator destinations to test on concurrently</pre><pre><strong>parallel-testing-enabled YES|NO</strong> overrides the per-target setting in the scheme</pre><pre><strong>parallel-testing-worker-count NUMBER</strong> the exact number of test runners that will be spawned during parallel testing</pre><pre><strong>maximum-parallel-testing-workers NUMBER</strong> the maximum number of test runners that will be spawned during parallel testing</pre><h4>Effective division of tests</h4><p>To maximise the advantages of parallel testing, we must divide the test cases into classes. Let’s use our international money transfer application, Azimo, as an example, and assume that our full test cycle contains five test cases.</p><p>The first option, which we definitely don’t recommend, is to create one large class containing all five test cases:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96ad2ec52eac3b547067875ef8a5d06d/href">https://medium.com/media/96ad2ec52eac3b547067875ef8a5d06d/href</a></iframe><p>It is far better to create several smaller test classes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3d6419139d7c851508ec685b4c95b01/href">https://medium.com/media/e3d6419139d7c851508ec685b4c95b01/href</a></iframe><p>In the first example, we have no way to test in parallel because Xcode assigns test classes to simulators: namely one free test class is allocated to one free device. Even if we have five devices available, only one can be used. In the second case, each class can be tested on a separate device.</p><p>If you have more classes than available devices, say six classes and only five devices, the first device that completes testing will receive the sixth and final class.</p><h3>Run in parallel via command line</h3><p>If we want to test in parallel on physical devices, we are forced to use the command line. There are several ways to do this.</p><p>For parallel testing using the command line, we need the ID of our devices. The first step is to display all connected devices and simulators together with their ID, using the following command:</p><pre>xcrun instruments -s devices</pre><p>Using the ID of a specific physical device, we can run the command responsible for running parallel testing.</p><p>In the project folder, we run the following command:</p><pre>xcodebuild \<br> -scheme Azimo \<br> -destination id={deviceID1} \<br> -destination id={deviceID2} \<br> test</pre><p>This command will run the same test classes in parallel on two different devices. This approach allows us to test on different devices and systems simultaneously, but doesn’t save us any time.</p><p>To speed things up, we can manually separate classes into devices. First we need to build our testing project with the following command:</p><pre>xcodebuild -project Azimo.xcodeproj -scheme Azimo -destination id={deviceID} build-for-testing</pre><p>Then we divide our test classes into the number of available devices. For example, with four test classes and two available devices, it is best to divide the two test classes into each device as follows:</p><pre>xcodebuild \<br> -scheme Azimo \<br> -destination id={deviceID1} \<br> -only-testing: Azimo/login_tests \<br> -only-testing: Azimo/register_tests \<br>test-without-building &amp;</pre><pre>xcodebuild \<br> -scheme Azimo \<br> -destination id={deviceID2} \<br> -only-testing: Azimo/createRecipient_tests \<br> -only-testing: Azimo/createTransfer_tests \<br> test-without-building &amp;</pre><p>In the case mentioned above, separating the classes into devices saves a lot of time. The optimal solution would be to use four devices, one for each class, but this isn’t always possible.</p><p>Another way to divide test classes is to create a new test target, eg Azimo1, and to include there appropriate test classes other than in the Azimo Target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*EeME3BsDg7imWBRkHF3LTA.png" /><figcaption>Adding classes to the test target</figcaption></figure><p>Assuming that the Azimo target has different test classes than the Azimo1 target and vice versa, we run parallel testing on both targets on different devices by using the following command:</p><pre>xcodebuild \<br> -scheme Azimo \<br> -destination id={deviceID1} \<br> test-without-building &amp; \</pre><pre>xcodebuild \<br> -scheme Azimo1 \<br> -destination id={deviceID2} \<br> test-without-building &amp;</pre><p>The test execution time will be equal to the execution time using the <em>-only-testing</em> parameter together with the determination of the test classes.</p><p>As you can see, the above methods work but require some human effort (creating new targets, separating tests between targets, maintaining targets when adding new cases / test classes). Xcode 10 brought substantial benefits that help with this.</p><h3>Continuous Integration</h3><p>Since Xcode 9, Apple has supported a built-in Xcode server. Previously, we had to use an additional OS X server application. Creating and configuring an Xcode server is simple: go to <em>Xcode -&gt; Preferences -&gt; Server &amp; Bots</em>, and create new<em> </em>Xcode server<em> </em>with the correct credentials.</p><p>After enabling and configuring an Xcode server, next we must create a bot to run integration with the given configuration. In our case, it’s a bot called UITestsDaily. The bot runs a full cycle of application tests at our local CI every day at midnight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*q_HCK5T87qZfyajh9FJBmg.png" /><figcaption>Command to force running tests on 5 simulators in parallel</figcaption></figure><p>Personally, by configuring the bot through parameters <em>parallel-testing-worker-count</em> with the value <em>5</em>, I enforce running tests on five simulators at the same time.</p><p>At Azimo, we use an iMac (specification below) with <em>Xcode 10</em> installed. This serves as our local continuous integration.</p><h4>Why use the solution above?</h4><ul><li>Each bot has an integration history (screenshots, logs etc.)</li><li>On our personal computer we can implement / debug other test scenarios while integration is tested on CI</li><li>More resources (memory, processor) — while allows us to run more simulators in parallel testing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*3vy_9vJLiLuJZRE82YB_nw.png" /><figcaption>Continuous Integration specification</figcaption></figure><p>The above specification allows you to run parallel testing on five stable simulators. My MacBook Pro 15” (16GB RAM, Intel i7 2.2GHZ) allows up to 3 simulators. This allows us to save a lot of time.</p><h4>Disadvantages:</h4><ul><li>Requires a dedicated, hi-spec computer</li><li>Large integrations use a lot of memory</li><li>No easy way to clean old and unnecessary data</li><li>No flexibility in bot configuration (for example, we can not set integration to start every 30 minutes)</li></ul><h3>Test reporting</h3><p>After every integration started on our CI, we want to know what % of tests were successful. One option is to connect to the CI and enter a specific integration, then manually check. A better option is to use the Slack + Fastlane connection, which sends notifications to Slack immediately after completing the integration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gYMtgE8dzNLBD9uUOCrIQ.png" /><figcaption>Notification on slack after integration 98.38% passed</figcaption></figure><p>As you can see, the above integration provides us with a lot of interesting information, including:</p><ul><li>Branch on which integration was carried out</li><li>Name of the bot on which the integration was made</li><li>Number of tests in the integration</li><li>Number of failed tests</li><li>Percentage of tests completed successfully</li></ul><h4>Triggers</h4><p>Each of the created bots has the tab <em>Triggers</em>. There we can determine what should be called before and after each integration. Properly written scripts can speed up debugging — searching for reasons for integration errors (eg, attempting to test for a device that does not exist, running a script from a wrong directory, etc.). On the example of integration of <em>UITests Daily</em>, it will show what we use to improve our work.</p><p><strong>Pre-integration scripts</strong> — commands invoked before integration</p><p><strong><em>Log information</em></strong></p><ul><li>Print of environmental variables</li><li>Print a list of all available simulators</li><li>Print all files in the current folder</li><li>Print the path to the current folder</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c66fd7f846051c28fabcf7c51efc32f2/href">https://medium.com/media/c66fd7f846051c28fabcf7c51efc32f2/href</a></iframe><p><strong><em>Clean</em></strong></p><ul><li>Cleaning simulators before running the testing</li><li>Opening a folder with a project</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61a0d750dc8f52b9a29067bea65cabd3/href">https://medium.com/media/61a0d750dc8f52b9a29067bea65cabd3/href</a></iframe><p><strong>Post-integration scripts </strong>— commands to be invoked after integration</p><p><strong><em>Log information</em></strong></p><ul><li>Print of environmental variables</li><li>Print the path to the current folder</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9df5bd21f5c1b908f94e8be304f40212/href">https://medium.com/media/9df5bd21f5c1b908f94e8be304f40212/href</a></iframe><p><strong><em>Send status</em></strong></p><ul><li>Opening the home directory so that we can benefit from sending status from integration into Slack</li><li>Print the path to the current folder</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7a5706f1cc97cef1b3d9508c08f7673/href">https://medium.com/media/c7a5706f1cc97cef1b3d9508c08f7673/href</a></iframe><p><em>LANG=en_US.UTF-8</em><strong> </strong>— setting locale in a terminal session export <em>PATH=/usr/local/bin:$PATH</em> — adding a path to usr / local / bin to the path variable (in our case to facilitate access to the use of Fastlane)</p><pre>echo: “…..:: all env variables ::…..”,<br>      “…..:: send status ::…..”,<br>      “…..:: simulators list ::…..”,<br>      “…..:: list current folder ::…..”</pre><p>the above printouts make it easier to search in the logs of the values we are interested in.</p><h3>In future: testing in cloud</h3><p>I hope that this article provided some useful information about the benefits of parallel testing. While parallel testing has saved us huge amounts of time and effort, it still has hardware limitations (you always need more devices/processing power). Our next step is to start testing in the cloud, where resources are almost limitless. I will write about this in my next article.</p><p>If you have any questions, feel free to post in the comment section 🤓.</p><h3>Towards financial services available to all</h3><p>We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our <a href="http://bit.ly/3vajnu6">careers page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b66d4dd08930" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azimolabs/parallel-testing-get-feedback-earlier-release-faster-b66d4dd08930">Parallel testing: get feedback earlier, release faster</a> was originally published in <a href="https://medium.com/azimolabs">AzimoLabs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>