<?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 Beyza Budak on Medium]]></title>
        <description><![CDATA[Stories by Beyza Budak on Medium]]></description>
        <link>https://medium.com/@beyzabudak?source=rss-e816f2cad30a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4JtQ-ly2PNMXdIVjh8igHQ.png</url>
            <title>Stories by Beyza Budak on Medium</title>
            <link>https://medium.com/@beyzabudak?source=rss-e816f2cad30a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:24:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beyzabudak/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 Test Automation: Snapshot Testing in IOS]]></title>
            <link>https://medium.com/cstech/ui-test-automation-snapshot-testing-in-ios-bd8bcb595cf8?source=rss-e816f2cad30a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd8bcb595cf8</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[automated-testing]]></category>
            <category><![CDATA[ui-testing]]></category>
            <category><![CDATA[snapshot-testing]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Beyza Budak]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 18:08:53 GMT</pubDate>
            <atom:updated>2023-07-07T08:22:53.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kv5q7k6derpz4ch5cf4cPQ.png" /></figure><blockquote>As our app evolves, designs may shift, but with snapshot tests, we’re swift to lift 🚀</blockquote><h3>1.1 Introduction</h3><p>In application development, Test Engineers are always faced with the challenge of providing quality and error-free user experiences. While functional testing is important, checking the visual appearance of user interfaces (UIs) is also necessary to deliver a successful product.</p><p>Snapshot testing, by taking screenshots of UI elements and comparing them to reference images, we can quickly identify visual issues and ensure that the UI looks consistent across different devices. Besides the UI Testing technique I mentioned in my previous article, while automatically testing the user interface, snapshot tests are used to check the appearance of the application visually. Both types of testing are important testing techniques that complement each other and help improve practice quality.</p><p>In this article, we will examine snapshot testing from a Test Engineer’s perspective. We’ll discuss the benefits, explore the different types of snapshots, and learn how to set up and write snapshot tests using popular libraries. By following best practices, we can improve our user interface testing strategies and deliver better practices.</p><p>Let’s Assemble and discover the power of snapshot testing for better user experiences!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDY6_cLlPiQk5NLqrl4IoA.jpeg" /></figure><h3>1.2 What is snapshot testing?</h3><p>Snapshot testing is used to verify the visual appearance of iOS app interfaces. It involves capturing an image of a screen and comparing it with a reference image to ensure consistency. Developers can catch unintended UI changes early by incorporating snapshot testing and delivering visually consistent and high-quality apps.</p><h3>1.3 How does it work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkHc9syW5rfNhoTZ55ysyQ.png" /><figcaption>Figure 1: Snapshot testing working principle</figcaption></figure><ul><li>The snapshot test uses a render to take a screenshot of a screen, either through UIKit or SwiftUI. In essence, by editing the interface components and placing the contents to create the image.</li><li>This image is then saved as a reference and used in subsequent tests.</li><li>When the snapshot test is run, the saved reference image is compared with the current screenshot.</li><li>If any differences are detected, the test will fail and inspection is required to identify changes.</li><li>If the screenshot is not detected, it will throw an error and automatically save the image in the snapshot folder by giving the name of the test.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnI81zx-K_CXPI4PQqB7rA.png" /><figcaption>Figure 2: The test report that is automatically recorded when the test fails</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBKoJkJIulN_SvfhSO-YYg.png" /><figcaption>Figure 3: Success sign when snapshots match and error report when they do not match</figcaption></figure><h3><strong>2. Implementing Snapshot Testing in iOS</strong></h3><p>To create a snapshot test in Xcode, you need to follow these steps:</p><ol><li>Create a test class: Select File -&gt; New -&gt; File, choose UI Test Case Class, provide a name for your class, and create it.</li><li>Add the Snapshot Testing library: In the next step, you will need to add the library for Snapshot Testing. This library provides the necessary tools and functionality to perform snapshot tests.</li></ol><blockquote><a href="https://github.com/facebookarchive/ios-snapshot-test-case">FBSnapshotTestCase</a>: A library developed by Facebook that has a large feature set for Snapshot tests. Although it offers many features, unfortunately, it has not received updates for a long time. And the library, whose development was discontinued later, continued to be developed by Airbnb as iOSSnapshotTestCase.</blockquote><blockquote><a href="https://github.com/uber/ios-snapshot-test-case/">iOSSnapshotTestCase</a>: A library for iOS snapshot tests developed by Airbnb. It provides an API similar to FBSnapshotTestCase and lets you run snapshot tests quickly and reliably.</blockquote><blockquote><a href="https://github.com/ashfurrow/Nimble-Snapshots">Nimble-Snapshots</a>: A library that uses the Quick and Nimble testing frameworks. This library allows you to write snapshot tests more descriptively and has powerful matching features.</blockquote><blockquote><a href="https://github.com/pointfreeco/swift-snapshot-testing">SwiftSnapshotTesting</a>: A library developed by Point-Free that helps developers to make it easier to write snapshot tests. This library uses a powerful DSL (Domain Specific Language) and allows writing clean and readable snapshot tests.</blockquote><p>We chose Point-Free in our project, for the reasons for this are:</p><blockquote>Easy to use: SwiftSnapshotTesting makes it simpler and clearer to write snapshot tests. Tests become more readable thanks to the use of a clean DSL.</blockquote><blockquote>Updated documentation: Point-Free provides detailed documentation explaining the use of the library. This allows developers to better understand and use the library.</blockquote><blockquote>Active development: It is known that the library is still actively developed and kept up to date. This provides assurance that potential issues will be fixed and new features added.</blockquote><p>To incorporate the necessary dependencies for snapshot testing into your project, you can utilize package managers like CocoaPods or Swift Package Manager. Follow these steps to add the dependencies to your project:</p><ol><li>Install the SnapshotTesting library using your preferred package manager. For example, if you’re using CocoaPods, add the following line to your project’s Podfile:</li></ol><pre>pod &#39;SnapshotTesting&#39;</pre><p>or</p><blockquote>1. Click on your project in the Xcode project navigator.</blockquote><blockquote>2. Select your UI Test target under the “Targets” section.</blockquote><blockquote>3. Go to the “Build Phases” tab.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MO1DDNUzQzJ4mU9J5gGXHw.png" /><figcaption>Figure 4: Build Phases Link Binary With Libraries</figcaption></figure><blockquote>4. Click on the “+” button under the “Dependencies” section to add a new dependency.</blockquote><blockquote>5. In the popup window, select “Add Package Dependency”.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*dCdo7CDRWNawJ3HRXZblvw.png" /><figcaption>Figure 5: Add Package Dependency</figcaption></figure><blockquote>6. In the search bar, type “SnapshotTesting” and select the package from the search results.</blockquote><blockquote>7. Click “Add Package” to add it to your project.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DsAuEyJaC-fKppU5yUgL_w.png" /><figcaption>Figure 6: Apple Swift Packages page</figcaption></figure><p>Once the library is added, import the SnapshotTesting module in your test class file:</p><pre>import SnapshotTesting</pre><p>Import the module of the target you want to test with snapshot tests using the @testable keyword. For example:</p><pre>@testable import CiceksepetiTest</pre><pre>   func testSplashView() {<br><br>        let splashView = SplashView()<br><br>        /* We call the view that we will define here, it can be a direct <br>          screen or we can also define small structures such as buttons, <br>          images, etc. specifically.*/<br><br>         ...<br>    }</pre><p>Before we start writing our tests, let’s get to know the parameters in the library we chose.</p><h3>4. Exploring Snapshot Testing Parameters</h3><h4>4.1 Record Parameters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPaY4WwWuW7-2DgSR1KK4A.png" /><figcaption>Figure 7: Snapshot Record Parameters</figcaption></figure><p><em>record</em> -&gt; Determines whether to save the snapshot.</p><p><em>named </em>-&gt; If we add a record here, it determines the name of the recorded snapshot image. If we leave it blank, it will give the name of the test to the image and save it in the folder.</p><h4>4.2 Comparison Parameters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FRMJtMQmBwqD_3-XT7FL_w.png" /><figcaption>Figure 8: Snapshot Comparison Parameters</figcaption></figure><p><em>precision</em> -&gt; Specifies the pixel difference precision used in the snapshot comparison.</p><p>For example, a low sensitivity value of 0.1,<br>0.5 compares snapshot images with higher precision than it.</p><p>Setting them depends on the test scenarios used, for example, let’s take the comment banners on the order detail page in the Çiçeksepeti application, they may be less important for us as they are dynamic and constantly changing. 0.5 can be used in this. However, we do not have the opportunity to give a low coverage on the payment page, it is both more static and one of the important pages in the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yX5U_SFLwvvGrEzN_XFLIw.png" /><figcaption>Figure 9: Ciceksepeti Order Detail and Payment Page</figcaption></figure><p><em>sizeTolarance</em> -&gt; This parameter is used for resolving differences. Device differences can be used for dynamic content, animation, and transitions.</p><h4>4.3 Snapshot Types Parameters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHbSxA2B8676Nkj_F7NPSQ.png" /><figcaption>Figure 10: Snapshot Types Parameters</figcaption></figure><p><em>image </em>-&gt; Save as image.</p><p><em>recursiveDescription</em> -&gt; Saves the view hierarchy as a text file.</p><h3>5. Advantages and Disadvantages</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMjrKzLx5MHzOIZWssraRA.png" /><figcaption>Figure 11: Snapshot Testing Advantages vs Disadvantages</figcaption></figure><h4>5.1 Advantages</h4><ul><li>Quickly and effectively checks the visual consistency of interface changes, with no need for extra manual control.</li><li>It can be easily implemented to automate tests and increase reproducibility. Once a snapshot is created, comparisons are made with reference to these snapshots in subsequent tests.</li><li>It can be used to check the compatibility of the app on different platforms such as different devices, screen sizes, and iOS versions. Snapshots help us verify that the app displays consistently across platforms.</li></ul><h4>5.2 Disadvantages</h4><ul><li>Snapshot tests are used only to check the visual accuracy of the application. If not used in conjunction with other types of testing, it may not be sufficient to fully test the functional accuracy of the application.</li><li>It can present challenges on changing, dynamic screens and devices with different resolutions.</li><li>In large and continuously developed projects, snapshot tests can be a huge maintenance cost.</li></ul><p>If we apply the snapshot test well to the project, it will be easier for the test and developer team to detect errors and the product will come out with fewer errors. If we say how best to implement this, we should use stable tests and reference images to increase reliability. If we regularly update the reference images and test the relevant components by dividing them into smaller parts on complex screens, we will reduce the margin of error of the snapshot test as much as possible, thus minimizing the disadvantages.</p><p>In conclusion, snapshot testing offers a powerful approach to ensure the visual correctness of iOS applications. By embracing this technique and continuously refining our tests, we can enhance the quality and reliability of our software. So, why not give snapshot testing a try in your next iOS project? It’s a great way to catch visual bugs early and deliver a polished user experience. Happy testing and may your snapshots always be accurate! ☀️</p><h3>References</h3><ul><li><a href="https://github.com/pointfreeco/swift-snapshot-testing">GitHub - pointfreeco/swift-snapshot-testing: 📸 Delightful Swift snapshot testing.</a></li><li><a href="https://bitrise.io/blog/post/snapshot-testing-in-ios-testing-the-ui-and-beyond">Snapshot testing in iOS: testing the UI and beyond - Bitrise</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd8bcb595cf8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/ui-test-automation-snapshot-testing-in-ios-bd8bcb595cf8">UI Test Automation: Snapshot Testing in IOS</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Motivating Your Team with Creative Retro Meetings]]></title>
            <link>https://medium.com/cstech/motivating-your-team-with-creative-retro-meetings-b05c8dd6068c?source=rss-e816f2cad30a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b05c8dd6068c</guid>
            <category><![CDATA[creative]]></category>
            <category><![CDATA[sprint]]></category>
            <category><![CDATA[retrospectives]]></category>
            <category><![CDATA[improvement]]></category>
            <category><![CDATA[gamification]]></category>
            <dc:creator><![CDATA[Beyza Budak]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 18:06:28 GMT</pubDate>
            <atom:updated>2023-07-07T08:22:46.637Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBUkEqu6GeyoJUBlH4Ho4g.png" /></figure><blockquote>Embrace the Retro, Ignite the Team 🔥</blockquote><p>A retro meeting is a retrospective evaluation and feedback process for a team or project group. These meetings often provide an opportunity to learn from past experiences by reviewing work and goals for a specific period.</p><p>Retro meetings are an important tool to understand what went well as a team, what needs to be improved, and what action to take for future projects. These meetings often become a regular ritual and are repeated at every stage of the project process.</p><p>Retro meetings should be held in an environment that encourages the participation of team members. It is important for everyone to freely express their opinions and give constructive feedback. These meetings increase the motivation of the team, strengthen communication and provide important learning opportunities for future projects. So, how can we encourage participation in Retro meetings and provide a comfortable environment for people to express their thoughts and hold the meeting most effectively? In this article, we will try to answer this question while talking about the methods I have tried in my retrospective meeting management. Let’s get started!</p><h3>Making Retro Engaging and Fun through Personalized Narratives</h3><p>When I started to hold the first retro meeting, the retro culture was just beginning to form, and my first task was to tell people the purpose of the meeting, why we held it, and the benefits for us. After this introduction, which I made by explaining at first, I realized that I had to do this more effectively with the new people who joined the team.</p><p>Considering the interests of the people on the team, I explained this with a slide, which is the game design of the Avengers team. In this way, it would be well established in people’s minds and they would be able to understand the new team members by looking at this document. Not only did this presentation serve as an initiation into the world of retro meetings, but it also facilitated an immediate sense of connection and resonance among team members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*De5B8gXvTWzC8eW7wT7xJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYmo_vQyl3I5osmpi1p-wQ.png" /></figure><h3>Guiding the Team through a Tale-like Retro Adventure</h3><p>In the second step of my journey in enhancing retro, I focused on delivering an engaging narrative-style presentation to capture people’s interest and increase participation. While I was still using the traditional drop, keep, add, and improve table to facilitate the retro meetings, I noticed that the level of engagement was not as high as I had hoped. To draw people’s attention and boost participation, I decided to present retro as if it were unfolding within a captivating story.</p><p>To achieve this, I chose the universally appealing theme of Harry Potter, aligning with each individual’s interests. Before the meeting, I created a poll in the online platform to determine which Hogwarts houses everyone wanted to be sorted into, creating excitement even before the session began. During the meeting, I assigned everyone to their respective Hogwarts houses, adding an element of fun and anticipation. Supported by animated visuals in my presentation, the unveiling of names and their respective houses generated a palpable thrill. I then asked if they were in their expected houses, which led to a lively and enjoyable introduction to the retro session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5HBe86STznrCpDGzoFl9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOJSg7BOxx-rOtfoPbVqpQ.png" /></figure><h3>Gamifying Retro for Enhanced Continuous Improvement</h3><p>Game On! The Harry Potter-inspired storytelling approach I implemented during our previous retrospective meeting received an overwhelmingly positive response. When I assigned everyone to teams, I noticed a spark of excitement and curiosity, as if they were expecting a competition or a chance to win. Given that we often engage in games like Codenames and Gartic.io during our gatherings, I thought, “Why not treat retrospective as a game itself?” This realization led me to create an even more enjoyable atmosphere for sharing our insights and experiences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ehoovq-SFZloNHuHBVrlWA.png" /></figure><p>For this, I chose Jumanji, a nostalgic board game that can appeal to everyone. We divided the team into 4 different teams. And by drawing lots, we determined the team that will start the first game. The team to start first made its first advance by rolling the dice in the game. There are cards with challenges inside along with empty boxes in the game. If it comes across an empty box, it will comment on an item in the retro table or comment on the item added by the previous team. Likewise, this progression rule applies to challenges as well. As for the challenges, I added interesting riddles to find the people in the team, such as ice breakers, both focused on adding substance to the retro board and in order for people to blend in better. Thus, retro meetings have turned into an environment where people can relax and at the same time examine our project development process more efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cima3_v-uDsKPhoKFeelvA.png" /></figure><p>In conclusion, by embracing the retro approach and infusing it with engaging elements like personalized narratives and gamification, we have transformed our retro meetings into lively and effective sessions. Through the journey of exploring different themes like the Avengers and Harry Potter, we have sparked enthusiasm, fostered team connection, and enhanced participation. Gamifying the process with games like Jumanji has not only made the meetings more enjoyable but has also allowed us to delve deeper into our project development process. As I reflect on the impact these strategies have had since taking over the retro meetings, I am excited to continue implementing beneficial approaches in the future. Stay tuned for more articles, and let’s keep sharing our experiences and insights. Until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b05c8dd6068c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/motivating-your-team-with-creative-retro-meetings-b05c8dd6068c">Motivating Your Team with Creative Retro Meetings</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UI Test Automation: Testing with Deep Links]]></title>
            <link>https://medium.com/cstech/ui-test-automation-testing-deep-links-76ca952f96f9?source=rss-e816f2cad30a------2</link>
            <guid isPermaLink="false">https://medium.com/p/76ca952f96f9</guid>
            <category><![CDATA[ui-test-automation]]></category>
            <category><![CDATA[android-intents]]></category>
            <category><![CDATA[deeplink]]></category>
            <category><![CDATA[xctest]]></category>
            <category><![CDATA[espresso]]></category>
            <dc:creator><![CDATA[Beyza Budak]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 13:57:37 GMT</pubDate>
            <atom:updated>2022-12-19T14:37:35.132Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_5vTYKLWF0VcGzU0osWeQ.png" /></figure><p><em>Authors: Beyza Budak &amp; Can Kaygusuz</em></p><h3><strong>1.1 What is a Deep link?</strong></h3><p>We often use mobile applications, which have become an indispensable part of our daily lives. While shopping, listening to music, looking for directions, etc. The links in the push notifications or sms that come to us caught our attention. When we click on these, we observe that if the application is installed, for example, if a product is on sale, we can go to its details. So how is this achieved? What makes us redirect to the page in the application when we click on the notifications? The answer is Deep links. Deep linking in mobile applications can be expressed with a URI (Uniform Resource Identifier) that points to a screen (contents, processes, etc.) within the mobile application instead of launching the application. Deep linking allows app developers to link to specific app products or pages. Also, they’re not easy to implement and require careful testing. If you do not add testing deep links to the test processes, you will cause users to have a negative experience in case of possible errors.</p><h3><strong>1.2 Why did we need to test using the Deep link?</strong></h3><p>The first reason we did this was to reach the pages that we cannot go to with a click (button, banner, or similar) through deep links and to test them as well. For example, in our application, there was a visual confirmation form sent by the flower dealer when the customer shopped for flowers. This form was only allowed to be opened in the application by clicking the sms and push notification sent by the dealer, there was no text, button, etc. directed here. As the automation team, we were responsible for the UI control of every page in the application, and we thought to launch the pages in this way in the application. So how did we achieve this, let’s learn together how to do it on both android and ios below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1IHS0ROka13SuOdd09k2A.png" /><figcaption>Figure 1: How Deep Links works</figcaption></figure><h3><strong>2.1 The choice of the method we use?</strong></h3><p>Above, we have explained deep links and why we want to do a deep link test. In this section, we will talk about which methods and why we prefer when using them.</p><p>Let’s start with Android first. There are 3 different methods for testing deep links in Android and they are testing with ADB, testing with espresso intents, and testing with ActivityScenarioRule. The logic of all of them is the same, to launch an intent. Since we used espresso in our UI tests, we chose to use espresso for integrity while testing the deep links. We used Espresso’s espresso-intents extension to make our app perform what we expect when we click a link. Espresso-intents make easy these checks with the<strong> intended()</strong> method, which verifies that an Intent was seen during testing that matches the given criteria. We opened the page and made an in-page assert using other functions of espresso. With some simple settings, we can use it to check whether the application sees the links we enter.</p><p>We were using the XCode UI test on IOS and there were 2 different methods to do this. One is to go to the deep link by clicking on iMessage and the other is to type the deep link through Safari and click open in the application.</p><h3><strong>2.2 Test Scenarios</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LN4hdO7I7-Hs6Dl8QAM0WQ.jpeg" /><figcaption>Figure 2: Test steps without using deep link</figcaption></figure><blockquote><strong>Title: </strong>What is Collection Page — Control of title and button on what is collection page</blockquote><blockquote><strong>Description:</strong> It should be seen that the title of the What is Collection page is correct and when the button is clicked, it goes to the collection creation screen.</blockquote><blockquote><strong>Precondition:</strong> Login if not opened with deep link</blockquote><blockquote><strong>Test Steps:</strong></blockquote><blockquote><strong>1.</strong> The application opens with the live api selected</blockquote><blockquote><strong>2.</strong> Click on the Favorites tab, click on the sign in button, and redirect to the login page and login.</blockquote><blockquote><strong>3.</strong> It is observed that the collection listing page appears and the first collection is clicked on from the listing page.</blockquote><blockquote><strong>4. </strong>After going to the collection detail page, the top settings are pressed and it is observed that the bottom sheet dialog is opened.</blockquote><blockquote><strong>5.</strong> After clicking on what is a collection option, the title and button are checked on the page that opens.</blockquote><p>As you can see above, the What is a collection page can be accessed from within the application with these steps, without using manual or deep links. We talked about pages that cannot be opened from within the application. In addition, if only those pages will be tested on the pages opened from within the application (if no end-to-end testing will be performed), we can use deep links to save time. Let’s see how many steps it takes to use a deep link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHywJcWG5ew4h75aLlphZA.jpeg" /><figcaption>Figure 3: Test steps without using deep link</figcaption></figure><blockquote><strong>Title: </strong>What is Collection Page — Control of title and button on what is collection page</blockquote><blockquote><strong>Description:</strong> It should be seen that the title of the What is Collection page is correct and when the button is clicked, it goes to the collection creation screen.</blockquote><blockquote><strong>Precondition:</strong> Login if not opened with deep link</blockquote><blockquote><strong>Test Steps:</strong></blockquote><blockquote><strong>1.</strong> The application opens with the live api selected. Also Pop up select case works in setup every time.</blockquote><blockquote><strong>2.</strong> Assert the title and button are checked on the page that opens.</blockquote><h3>3. Usages And Experiences Shared</h3><h3><strong>3.1 Usage in Android</strong></h3><p>First of all, we implement the espresso-intents extension into the build.gradle in our project.</p><pre>    androidTestImplementation &#39;androidx.test.espresso:espresso-intents:3.4.0&#39;</pre><p>We create our test class and define our rule in it. Here we normally use MainActivity as an activity in our tests, but here we will use the class where deep links are handled in the application. For more information and implementation about ActivityTestRule please <a href="https://developer.android.com/reference/androidx/test/rule/ActivityTestRule">click</a>.</p><pre>@Rule<br>@JvmField<br>var deepLinkActivityHandler = ActivityTestRule(MyDLHandlerActivity::class.java, true, false)<br></pre><p>Uri (uniform resource identifier) is a standard used to name a resource or data. It also qualifies the source. This type of information is required when using Intent. Therefore, we parsed the URI we defined for the intent and added it as a variable. You can also choose to write in the code, we preferred to define Constanta. Because it stops more regularly and when it changes, we can change the URI from one place instead of going to the places we call one by one.</p><pre>private val DEEPLINK_URI_WHAT_IS_COLLECTION = Uri.parse(&quot;cstest://0/about-collection&quot;)</pre><pre>@Test<br>fun test_what_is_collection_deeplink(){<br>    val intent = Intent(Intent.ACTION_VIEW, DEEPLINK_URI_WHAT_IS_COLLECTION)<br>// New task and clearing previous tasks<br>    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)<br>    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)<br>    deepLinkActivityHandler.launchActivity(intent)<br>// Get the title from the toolbar and assert it<br>    Assert.assertEquals(<br>        getToolbar()?.title,<br>        WHAT_IS_COLLECTİON_TITLE<br>    )<br>/* click(), withIdAccess(), accessItemIsDisplayedOnView(), isDisplayed()<br> warning :extension used */<br>    R.id.button.accessItemIsDisplayedOnView().isDisplayed()<br>    R.id.button.withIdAccess().click()<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*ZuqMfPfdgvwcOhun0NJJ9A.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKCTxkx8bpOzNmVX32uWGw.jpeg" /><figcaption>Figure 4: Android Test Results</figcaption></figure><h3>3.2 Usage in IOS</h3><p>Here we were defining the app in normal cases.</p><pre>    var app: XCUIApplication!</pre><p>Likewise, we make a definition for Safari, and just like we call it app.launch, we also launch for Safari in our tests.</p><pre>let safari = XCUIApplication(bundleIdentifier: &quot;com.apple.mobilesafari&quot;)<br>            safari.launch()</pre><p>After starting Safari, we do the test steps given below and then write our tests for the usual application.</p><blockquote>1-application setup settings are made<br>2-the application is run<br>3-open the safari<br>4- deep link is written in the address bar<br>5-Press the “Open” button on the pop-up<br>6-It is checked whether the desired page has been reached.</blockquote><pre> struct DeepLinkUtils {<br>        static func openFromSafari(with urlString: String) {<br>            let safari = XCUIApplication(bundleIdentifier: &quot;com.apple.mobilesafari&quot;)<br>            safari.launch()<br>            XCTAssert(safari.wait(for: .runningForeground, timeout: 3))<br>            tapIfExists(app: safari, title: &quot;Continue&quot;)<br>            safari.otherElements[&quot;URL&quot;].tap()<br>            safari.textFields[&quot;Address&quot;].tap()<br>            tapIfExists(app: safari, title: &quot;Continue&quot;)<br>            safari.typeText(urlString)<br>            safari.buttons[&quot;Go&quot;].tap()<br>            tapIfExists(app: safari, title: &quot;Open&quot;)<br>        }</pre><pre> func test_DeepLink_What_Is_Collection(){<br>         DeepLinkUtils.openFromSafari(with: shareDeepLink)<br> // shareDeepLink was identified in ConstantClass as a String<br>}</pre><p>Thank you for reading. You can contact us for the places you do not understand or the problems you experience while applying. Stay tuned for more UI Test Automation content.</p><h3>References:</h3><ul><li><a href="https://developer.android.com/reference/android/net/Uri">Uri | Android Developers</a></li><li><a href="https://developer.android.com/reference/androidx/test/rule/ActivityTestRule">ActivityTestRule | Android Developers</a></li><li><a href="https://developer.android.com/training/testing/espresso/intents">Espresso-Intents | Android Developers</a></li><li><a href="https://www.nathankrishnan.com/fundamentals-of-xcuitest/">Fundamentals of XCUITest</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76ca952f96f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/ui-test-automation-testing-deep-links-76ca952f96f9">UI Test Automation: Testing with Deep Links</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</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 Write Android Automation In Your App Road Map]]></title>
            <link>https://medium.com/cstech/how-to-write-android-automation-in-your-app-road-map-b740d505db2e?source=rss-e816f2cad30a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b740d505db2e</guid>
            <category><![CDATA[android-espresso]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[espresso-testing]]></category>
            <category><![CDATA[android-automation]]></category>
            <category><![CDATA[ui-automation-testing]]></category>
            <dc:creator><![CDATA[Beyza Budak]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 11:36:06 GMT</pubDate>
            <atom:updated>2022-07-04T07:43:27.108Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Authors : </em><a href="https://medium.com/@cihatbstnc"><em>Cihat Bostancı</em></a><em> &amp; Beyza Budak</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPf2tSro6McITiH07hDT0Q.png" /></figure><h3><strong>1.1 Why Is Automation Necessary?</strong></h3><p>Today, technology, which enters every aspect of our lives, is an inevitable even in our simple daily lives. There may be negative experiences we encounter while using mobile applications and websites, which are indispensable for everyone. In order to reduce these experiences as much as possible, it is very important for clients to go through the testing phase before they are released.</p><p>Before we talk about the automation stage of these test stages, let’s briefly talk about manual testing. Manual tests are UI tests performed by humans in line with scenarios prepared by a test engineer. It takes more time than automation testing and is more likely to be mistaken. In automation, on the other hand, it tests from end to end according to completely written scenarios, it is fast and the probability of errors is very low compared to manual testing. In particular, regression automation tests run before each live are the savior of the whole test team in revealing better quality works and seeing that all areas work in harmony with each other. Automation is very important at this point, especially since store approvals of mobile apps can sometimes take even 1 day.</p><h3><strong>1.2 Which Tool Is Better Espresso or Cross Platform Tools and Why do we use Espresso?</strong></h3><p>Principally, after clearly determining all the project needs, the desired requirements, the necessary automation tool should be selected. By the way, Android and IOS applications are developing natively in the projects we are currently involved in. Although it seems to be suitable for cross platform, we are developing our automation test with native tools.</p><p>Secondly, we will be making mention of the needs and requirements of the project on the below. Besides that, although<a href="https://developer.android.com/training/testing/other-components/ui-automator"> UI Automator</a> and <a href="https://appium.io/docs/en/about-appium/intro/">Appium</a> etc. seem to be alternatives to <a href="https://developer.android.com/training/testing/espresso">Espresso</a>, the table in the following made it easier for us to make this decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*44ENVbSpbKvi-Drhun28lQ.png" /><figcaption>Figure 1 : Comparisons between Espresso and Cross Platform UI Test</figcaption></figure><p>Consequently, in our opinion Espresso is much more suitable for our project.</p><h3><strong>2.1 Identifying Issues And Requirements</strong></h3><p>As we mentioned in the previous paragraph, we had to choose a tool, and our issues and requirements were at the forefront in this choice.</p><p><strong><em>So, what are our issues and requirements while creating the automation infrastructure?</em></strong></p><ul><li>Reducing the cost of testing on the manual side when the app goes live,</li><li>Catching possible bugs in the live process faster,</li><li>Improving the duration of regression tests to ensure that added features affect other screens (E.g. Being able to detect problems without skipping a place in big features),</li><li>To be able to perform end to end tests where automation progresses like a user rather than a single screen test (In this way, to be able to observe that interconnected screens can work in harmony),</li><li>It should be able to be divided into sections in order for the necessary tests to run at the necessary moments during the live process (E.g. the regression test when going live or the smoke test to be able to run if necessary to observe whether critical areas are affected),</li><li>We also expected settings to be made so that our tests would work in different environments and for different users.</li></ul><p>The key factor in adding these requirements was that we wanted to test the features with the whole application end-to-end. Below is an example scenario of one of the end-to-end tests we did.</p><h3><strong>2.2 Test Scenarios</strong></h3><p>First of all, we are testing a large e-commerce application, so our regression test cases had to be very detailed, to touch every point and to cover the entire application. Briefly, the screens we tested are items on the<strong> Homepage</strong> (stories, banners, widgets, see more button, favorites add — remove functions etc.),<strong> Account tab</strong> (my orders, membership information, registered cards, reminders, addresses, help, wallet, gift checks, coupons, live support etc.),<strong> Favorites tab </strong>(create -delete-share, favorite add-remove functions etc.), C<strong>ategories tab </strong>(category selections, search fields (city, product, category) etc.) and we perform our tests on a wide variety of screens such as <strong>Product</strong> <strong>listings </strong>(suggestions, filter, city search, add-remove to favorites, banners, product details etc. ). You can take a look at the case we have added as an example to the cases we mentioned below.</p><p><strong>Title</strong>: HomePage — Products similar to your recent visits on the homepage widget control</p><p><strong>Description: </strong>After the product goes into detail, a product widget similar to the last one you visited should be displayed on the homepage.</p><p><strong>Precondition:</strong> -</p><p><strong>Test Steps:</strong></p><ol><li>The application opens with the live api selected</li><li>By clicking on the Categories tab, the first category is selected and the see all products sub-category is clicked.</li><li>It is observed that the product listing page appears and the first product is clicked on from the listing page.</li><li>After reaching the product detail, clicked on the back icon to reached the homepage.</li><li>It is observed that the widget appears on the screen by scrolling on the homepage.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dl0BoVpu4xynqfi_af6vdg.png" /><figcaption>Figure 2 : Sample Test Senario</figcaption></figure><h3><strong>2.3. How to Build The Infrastructure of UI Tests?</strong></h3><p>A UI Automation Test infrastructure is definitely directly related to the flow of the desired tests and the scenarios set up. In our example, the requests focused on real-time and written about features rather than mock servers and repositories. For our needs, we mostly performed the newly released features and old written features before and used our test in the test phase within the development cycle.</p><figure><img alt="https://marketinginnepal.com/android-app-development-nepal/" src="https://cdn-images-1.medium.com/max/1000/1*SjAX5vX2oTHwi_effj3aOw.png" /><figcaption>Figure 3 : Development Cycle</figcaption></figure><p>We derived our every written test from the Screen Test blueprint classes. Thus, we have provided the generic functions that are relevant to all our tests and the ones that should be specific standards. The main reason why we do it this way is that our android application is implemented with the Single Activity — Multiple Fragments approach. It made it easy for us to manage features such as toolbar, bottom change, navigation, getting text from resources etc. which are particularly relevant to Activity from a single point. In fact, we have tried to also manage everything directly the necessary actions about Activity in Screen Test with avoiding that becoming God Class.</p><blockquote>Besides that, we tried to write View Actions, View Assertions and View Matchers for specific and/or generic solutions whenever necessary. Below you may see a few examples of where we need them. It has already clearly stated that we can apply this method in specialized problems, which android has suggested to us. In order to ensure maintainability, we realized through ids and scripts instead of specific text matchers. If the scenarios change, our tests will naturally have to change too. Surely, we conducted our test by approaching feature tests ( favorite, account, home feed etc. ) rather than fragment, view tests.</blockquote><p>We have created test suite classes in order to perform the tests and at the required stage ( For example: Smoke Test Suite , Release Test Suite etc., Feature Test Suite)</p><h3><strong>3. How We Solved Our Problems And Experiences Shared</strong></h3><p>First of all, we noticed that Espresso is trying to perform actions as quick as to the views that are on the screen at that moment in the meantime. This made it easy to understand that when we click on something that is not on the screen, it throws illegal State Exception errors when we access No Matching View Exception. As a precaution, we wrote sleep codes that keep the main thread waiting. There were cases where we made the main thread wait when we had great difficulty. Mostly we tried to remove it from all our tests but a few code remained.</p><pre><em>/**<br> * For Main Thread sleeps<br> */</em><br>fun sleep(millis: Long = 1000) = try {<br>    Thread.sleep(millis)<br>} catch (e: InterruptedException) {<br>    e.printStackTrace()<br>}</pre><ul><li>However, since we do not know that API return time and when it is different, the sleep codes we set did not offer any performance and while main threads waiting, which we kept on a per-second basis were long in duration and did not occur as healthy tests. Therefore, we implemented the code that if the view is displayed on the screen, it can wait until that threshold is reached.</li></ul><pre><em>/**<br> * Wait for view to be visible<br> */<br></em>fun ViewInteraction.waitUntilVisible(timeout: Long = 4000L): ViewInteraction {<br>    val startTime = System.currentTimeMillis()<br>    val endTime = startTime + timeout<br>    do {<br>        try {<br>            <em>isDisplayed</em>()<br>            return this<br>        } catch (e: AssertionFailedError) {<br>            <em>sleep</em>(50)<br>        }<br>    } while (System.currentTimeMillis() &lt; endTime)<br>    throw TimeoutException()<br>}</pre><ul><li>Here, if it is not on the screen, we get errors because we waited for the second value, or because the renderer with animations tried to access our screens or directly with the pop up dialogs. Although it provides some solution, it did not work properly what we wanted, literally waiting until visible. In case of waiting until visible code is insufficient, we used the <a href="https://academy.realm.io/posts/kau-jake-wharton-testing-robots/">Base Robot class developed by Jake Wharton</a>. That traverses the view by doing a breadth first search, and when it gets an error, it continues to try them, thus covering the views that come out according to the animation time, api return time, and the loss of time while rendering.</li><li>To avoid thread sleep, and to handle synchronization with the background jobs, we should create our own Espresso Idling Resources. <a href="https://medium.com/androiddevelopers/android-testing-with-espressos-idling-resources-and-testing-fidelity-8b8647ed57f4">In this link </a>we may understand how we could add and why we should use.</li><li>Another function we used while writing our tests was the isDisplayedBool function. The reason we use this function is to handle the features that appear on the screen only at certain periods (such as pop-up that appears on the first login to the application) or that can be turned on or off according to the API. If it is on the screen, it returns true, if not on the screen, it returns false, and by inserting it into an if or while statement, we can direct it to the steps that should be seen in the relevant situation.</li></ul><pre><em>/**<br> * View Interaction that checks item is displayed and return boolean<br> */</em></pre><pre>fun ViewInteraction.isDisplayedBool(): Boolean {<br>    try {<br>        check(matches(ViewMatchers.isDisplayed()))<br>        return true<br>    } catch (e: NoMatchingViewException) {<br>        return false<br>    }<br>    catch (e:AssertionFailedError) {<br>        return false<br>    }<br>}</pre><ul><li>One of our problems was to take a variable number of incoming Edit Texts on a Linear Layout page and fill in all the fields. In order to achieve this, we had to write a View Action for this situation cause of no resource ids of Edit Texts and added view with manually. As in the code example below, we matched the Linear Layout and then used the children in the Linear Layout in the perform part and set the strings to all the EditTexts that matched in the children.</li></ul><pre><em>/**<br> * View Action that takes the number of EditTexts in the Linear Layout and sets random strings to them<br> */</em></pre><pre>object LinearClickChildItemViewAction {<br>    fun clickChildViewWithId(): ViewAction {<br>        return object : ViewAction {<br>            override fun getConstraints(): BaseMatcher&lt;View&gt; {<br>                return object : BaseMatcher&lt;View&gt;() {<br>                    override fun matches(item: Any?): Boolean {<br>                        return isA(LinearLayout::class.<em>java</em>).matches(item)<br>                    }<br><br>                    override fun describeMismatch(item: Any?, mismatchDescription: Description?) {}<br>                    override fun describeTo(description: Description?) {}<br>                }<br>            }<br><br>            override fun getDescription(): String {<br>                return &quot;Click on a child view with specified id.&quot;<br>            }<br><br>            override fun perform(uiController: UiController?, view: View) {<br>                val linearLayoutView: LinearLayout = view as LinearLayout<br>                linearLayoutView.<em>children</em>.<em>forEach </em><strong>{<br>                    </strong>if (<strong>it </strong>is EditText){<br>                        val ed = <strong>it </strong>as EditText<br>                        ed.setText(<em>getRandomString</em>(5))<br>                    }<br>                <strong>}<br>            </strong>}<br>        }<br>    }<br>}</pre><ul><li>Throughout the process, we had to come up with new solutions specific to situations. One of them was accessing and clicking the child of the Item View in the Recycler View. We wrote a custom view action for this. This View Action circulates the children in the itemView at the desired position in the Recycler View on the screen and clicks the desired child.</li></ul><pre><em>/**<br> * [ChildItemViewAction] works for required then return ViewHolder view<br> */<br></em>class ChildItemViewAction(val callback: (View?) -&gt; Boolean, val position: Int, val itemId: Int) {<br><br>    var view: View? = null<br>    var currentPosition: Int = 0<br>    var isCallBackReturn = false<br><br>    <em>/**<br>     * Get Child View From Recycler View<br>     */<br>    </em>fun getChildItemView() = object : ViewAction {<br>        override fun getDescription(): String {<br>            return &quot;Child Item View Action&quot;<br>        }<br><br>        override fun getConstraints(): Matcher&lt;View&gt; {<br>            return allOf(<br>                isAssignableFrom(RecyclerView::class.<em>java</em>),<br>                isDisplayed()<br>            )<br>        }<br><br>        override fun perform(uiController: UiController?, view: View?) {<br>            val recyclerView = view as RecyclerView<br>            val adapter = recyclerView.<em>adapter<br>            </em>val itemCount = adapter?.<em>itemCount </em>?: 0<br>            for (i in 0 <em>until </em>itemCount) {<br>                if (adapter?.getItemViewType(i) == itemId) {<br>                    if (currentPosition == position) {<br>                        recyclerView.scrollToPosition(i)<br>                        uiController?.loopMainThreadUntilIdle()<br>                        val itemViewHolder = recyclerView.findViewHolderForAdapterPosition(i)<br>                        isCallBackReturn = if (itemViewHolder != null) {<br>                            callback.invoke(itemViewHolder.itemView)<br>                        } else {<br>                            false<br>                        }<br>                        if (isCallBackReturn) {<br>                            break<br>                        } else {<br>                            uiController?.loopMainThreadUntilIdle()<br>                        }<br>                    }<br>                    currentPosition++<br>                }<br>            }<br>        }<br>    }<br>}</pre><ul><li>In order to avoid errors for system animations both virtual or physical devices, Android recommends in the following; On your device, under <strong>Settings &gt; Developer options</strong>, disable the following 3 settings:</li></ul><blockquote>1. Window animation scale</blockquote><blockquote>2. Transition animation scale</blockquote><blockquote>3. Animator duration scale</blockquote><ul><li>We have different urls and test users for the different test environments. At the same time, in order to adjust the payment methods according to the test environments, we were able to solve the Test Constant Manager which is Singleton Class thus we could set all constants according to the Manager in a single point. We ran the test on what we desired values and made it independent from the environments.</li></ul><h4>References:</h4><ul><li><a href="https://developer.android.com/training/testing/other-components/ui-automator">https://developer.android.com/training/testing/other-components/ui-automator</a></li><li><a href="https://appium.io/docs/en/about-appium/intro/">https://appium.io/docs/en/about-appium/intro/</a></li><li><a href="https://developer.android.com/training/testing/espresso">https://developer.android.com/training/testing/espresso</a></li><li><a href="https://academy.realm.io/posts/kau-jake-wharton-testing-robots/">https://academy.realm.io/posts/kau-jake-wharton-testing-robots/</a></li><li><a href="https://medium.com/androiddevelopers/android-testing-with-espressos-idling-resources-and-testing-fidelity-8b8647ed57f4">https://medium.com/androiddevelopers/android-testing-with-espressos-idling-resources-and-testing-fidelity-8b8647ed57f4</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b740d505db2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/how-to-write-android-automation-in-your-app-road-map-b740d505db2e">How To Write Android Automation In Your App Road Map</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>