<?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 Sinan Akdaş on Medium]]></title>
        <description><![CDATA[Stories by Sinan Akdaş on Medium]]></description>
        <link>https://medium.com/@sakdas?source=rss-554aa36adcdd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hq-GXeFKQphu0-BK</url>
            <title>Stories by Sinan Akdaş on Medium</title>
            <link>https://medium.com/@sakdas?source=rss-554aa36adcdd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:43:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sakdas/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[Running Android Application Tests Using Playwright/Test Runner with Appium+Webdriverio]]></title>
            <link>https://medium.com/@sakdas/running-android-application-tests-using-playwright-test-runner-with-appium-webdriverio-e52b4fc03c7d?source=rss-554aa36adcdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e52b4fc03c7d</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[webdriverio]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[playwright-test]]></category>
            <category><![CDATA[mocha-js]]></category>
            <dc:creator><![CDATA[Sinan Akdaş]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 08:58:34 GMT</pubDate>
            <atom:updated>2025-07-21T08:58:34.959Z</atom:updated>
            <content:encoded><![CDATA[<p>While setting up an automation project that uses Playwright for web and API automation tests, I needed an alternative for Android mobile app test automation. Continuing with the JS/TS approach and using VS Code, I proceeded with an Appium+Webdriverio-based project, incorporating Mocha as the test runner.</p><p>Initially, there weren’t many issues. I had a project where I could debug by installing and configuring the <a href="https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter">Mocha Test Explorer</a> in VS Code, using <a href="https://www.npmjs.com/package/chai">Chai</a> for assertions and <a href="https://www.npmjs.com/package/mochawesome">Mochawesome</a> for reporting, supporting pause-resume steps. However, at the end, there were three fundamental problems:</p><ol><li>Even though they were written in the same programming language, two different test runners had to be used, and in projects created for testing the same product, some steps (such as preparing the environment for testing from the database before the test, asserting the operation via the API, etc.) required double the effort.</li><li>It was not possible to set up a stable retry mechanism for Mocha and Appium tests. The it(‘should.. ‘ blocks recommended for breaking down tests into sub-steps were treated as separate tests, so it took a lot of time to get the entire test to retry properly when the blocks I designed as “steps” failed. Even when sub-blocks were not used, the readability of the generated test report deteriorated significantly.</li><li>Although I am not 100% sure that the problem originated from Mocha, the tests were not working stably, and random application crashes and Appium server connection drops were occurring.</li></ol><p>While searching for separate solutions to these issues, ChatGPT suggested something interesting: “You could use <a href="https://www.npmjs.com/package/@playwright/test">Playwright/Test</a> instead of Mocha.” At that point, I wasn’t even aware that Playwright/Test was a separate module that can be used in this context, and I thought ChatGPT might be confused since I was asking questions about both web tests and the Appium project. Still, I asked how to do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9ETADUuqsBTiiTgyUI-eQ.png" /></figure><p>In summary:</p><pre>Prerequisites: Nodejs 17+ and npm installed <br>(Ideal: the latest LTS version)</pre><p>Run the commands</p><pre>npm init -y<br>npm install @playwright/test appium webdriverio<br>npx appium driver install uiautomator2<br></pre><p>And write a script in the following format</p><pre>import { test, expect } from ‘@playwright/test’<br>import { remote } from ‘webdriverio’<br><br>test(‘Native Android app login’, async () =&gt; {<br> const driver = await remote({<br> port: 4723,<br> capabilities: {<br> platformName: ‘Android’,<br> deviceName: ‘emulator-5554’,<br> automationName: ‘UiAutomator2’,<br> app: ‘/path/to/your.apk’<br> }<br> })<br><br>const username = await driver.$(‘~username’)<br> await username.setValue(‘testuser’)<br> // … other steps<br> await driver.deleteSession()<br> expect(1).toBe(1) // A simple assertion, Playwright assertion<br>})</pre><pre><br>npx appium //In a separate command line<br>npx playwright test</pre><p>When I ran these commands, I was amazed to see the sample test running smoothly. :)</p><blockquote>When setting up this way, there is one more manual step required to enable reporting. You need to save a file like the one below as playwright.config.ts and keep it in the root directory of the project.</blockquote><pre>import { defineConfig } from ‘@playwright/test’;<br><br>export default defineConfig({<br> testDir: ‘./tests’,<br> fullyParallel: false,<br> reporter: [[‘html’, { open: ‘never’ }]],<br> use: {<br> trace: ‘on-first-retry’,<br> },<br><br>projects: [<br> {<br> name: ‘chromium’,<br> }, <br>});</pre><p><em>What issues did this change resolve?</em></p><p>In the order listed above:</p><ol><li>We transitioned to a common test runner for all test automation projects. The commands used to run tests and the use of setup and teardown steps were standardized.</li><li>We were able to start using Playwright/Test’s <a href="https://playwright.dev/docs/test-retries#retries">retry mechanism</a> without any additional configuration. When used in conjunction with Playwright’s test.step feature, the retry usage issue that I was unable to stabilize by trying to work around it in Mocha was resolved.</li><li>The tests have become much more stable. To reiterate, I cannot say for certain that the issue I previously experienced was Mocha-related, but after switching to Playwright/Test, application crashes and Appium server connection drops have decreased significantly.</li></ol><p><em>What other unexpected improvements did this change bring about?</em></p><ol><li>Playwright’s default report is now available for reporting.</li><li>The run, debug, pause, and resume features previously set up with Mocha Test Explorer remain available without any loss of functionality through the <a href="https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright">Playwright Test for VSCode</a> extension.</li></ol><p>To summarize, by switching from Mocha to Playwright/Test as the test runner, I now have an environment where I can run tests, generate test reports, and share them using more stable and familiar methods, without any loss of functionality, including test writing and debugging in the VS Code environment.</p><p>I was surprised that I hadn’t come across a single example of a project already using this combination online, not even a document or walkthrough. Either I searched with the wrong keywords, or writing mobile application test automation with Appium+Webdriverio isn’t as common as I thought. Still, if someone comes across this article and it at least sparks a new, different idea in their mind, then the article has served its purpose.</p><p>Best regards, have a good day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e52b4fc03c7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playwright/test Runner ile Appium+Webdriverio Kullanarak Android Uygulama Testlerini Çalıştırmak]]></title>
            <link>https://medium.com/@sakdas/playwright-test-runner-ile-appium-webdriverio-kullanarak-android-uygulama-testlerini-%C3%A7al%C4%B1%C5%9Ft%C4%B1rmak-90a62e5e8dfb?source=rss-554aa36adcdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/90a62e5e8dfb</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[playwright-test]]></category>
            <category><![CDATA[webdriverio]]></category>
            <category><![CDATA[mocha-js]]></category>
            <category><![CDATA[appium]]></category>
            <dc:creator><![CDATA[Sinan Akdaş]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 12:00:07 GMT</pubDate>
            <atom:updated>2025-07-21T07:40:33.803Z</atom:updated>
            <content:encoded><![CDATA[<p>Hali hazırda web ve api tarafındaki otomasyon testleri için Playwright kullanan bir otomasyon projesi kurmuşken, Android mobil uygulama test otomasyonu için de bir alternatif gerekti. JS/TS yolundan devam etmek, VS Code’u kullanmak için, Appium+Webdriverio temelli projeye test runner olarak, Mocha’yı dahil ederek devam ettim.</p><p>Başlangıçta pek sorun yoktu aslında, assertion’lar için <a href="https://www.npmjs.com/package/chai">Chai</a>, raporlama için <a href="https://www.npmjs.com/package/mochawesome">Mochawesome</a> kullanarak, VS Code’da <a href="https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter">Mocha Test Explorer</a> yükleyip konfigürasyonunu yaparak debug edebildiğim, pause — resume adımlarını destekleyen bir projeye sahip olmuştum, ama en temelde 3 sorun vardı.</p><ol><li>Ne kadar aynı programlama dili olsa da 2 farklı test runner kullanmak gerekiyordu ve aynı ürünün testi için oluşturulmuş projelerde, bazı adımlarla (test öncesi DB’den ortamı teste hazır hale getirmek, yapılan işlemin api üstünden assertion’ı vs…) çift dikiş uğraşmak gerekiyordu.</li><li>Mocha ile Appium testlerinin retry mekanizmasını stabil olarak kurgulamak mümkün olmamıştı. Testi alt adımlara ayırmak için önerilen <em>it(‘should..</em> ‘la başlayan bloklar, ayrı testler olarak ele alındığı için, benim “adım” olarak tasarladığım bloklar fail ettiğinde testin tamamının retry edilmesini düzgün çalıştırabilmek ciddi zaman aldı. Alt bloklar kullanılmadığında da, üretilen test raporunun okunabilirliği fena halde azalıyordu.</li><li>Hala sorunun kesin kaynağının Mocha olduğuna %100 emin olmasam da, testler bir türlü stabil çalışmıyor, random uygulama çökmeleri ve Appium server bağlantı kopmaları yaşanıyordu.</li></ol><p>Bu sorunlara ayrı ayrı çözüm ararken, ChatGPT, enteresan bir şey önerdi: “Mocha yerine <a href="https://www.npmjs.com/package/@playwright/test">Playwright/Test</a>’i kullanabilirsin”. O noktada Playwright/Test’in ayrı bir modül olduğunun bile farkında değildim ve bir yandan Web testleri bir yandan Appium projesi ile ilgili sorular sorduğum sevgili ChatGPT’nin kafasının karıştığını düşündüm. Ama yine de nasıl yapabileceğimi sordum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9ETADUuqsBTiiTgyUI-eQ.png" /></figure><p>Özetle:</p><pre>Ön gereksinim: Nodejs 17+ ve npm’in kurulu olması <br>(İdeal: en güncel LTS versiyonu)</pre><pre>npm init -y<br>npm install @playwright/test appium webdriverio<br>npx appium driver install uiautomator2</pre><p>komutlarını çalıştırıp, aşağıdaki örnek formatta bir script yazıp</p><pre>import { test, expect } from ‘@playwright/test’<br>import { remote } from ‘webdriverio’<br><br>test(‘Native Android app login’, async () =&gt; {<br> const driver = await remote({<br> port: 4723,<br> capabilities: {<br> platformName: ‘Android’,<br> deviceName: ‘emulator-5554’,<br> automationName: ‘UiAutomator2’,<br> app: ‘/path/to/your.apk’<br> }<br> })<br><br>const username = await driver.$(‘~username’)<br> await username.setValue(‘testuser’)<br> // … diğer adımlar<br> await driver.deleteSession()<br> expect(1).toBe(1) // Basit bir assertion, Playwright assertion’ı<br>})</pre><pre>npx appium //Ayrı bir komut satırında<br>npx playwright test </pre><p>komutlarını çalıştırdığımda, örnek testin şıkır şıkır çalıştığını hayretler içinde izledim. :)</p><blockquote>Bu şekilde bir kurulum yapıldığında, raporlamanın aktif edilmesi için yapılması gereken manuel bir adım daha var. Aşağıdaki gibi bir dosyayı <em>playwright.config.ts</em> adıyla kaydedip, projenin kök dizininde bulundurmak gerekiyor.</blockquote><pre>import { defineConfig } from ‘@playwright/test’;<br><br>export default defineConfig({<br> testDir: ‘./tests’,<br> fullyParallel: false,<br> reporter: [[‘html’, { open: ‘never’ }]],<br> use: {<br> trace: ‘on-first-retry’,<br> },<br><br>projects: [<br> {<br> name: ‘chromium’,<br> }, <br>});</pre><p><em>Bu değişiklik hangi sorunları çözdü ?</em></p><p>Yukarıdaki sırayla gidersem;</p><ol><li>Tüm test otomasyonu projelerinde ortak bir test runner’a geçmiş olduk. Testlerin koşturulması için kullanılacak komutlar, setup ve teardown adımlarının kullanımı, ortaklaştı.</li><li>Playwright/Test’in <a href="https://playwright.dev/docs/test-retries#retries">retry mekanizmasını</a>, ek bir düzenlemeye gerek kalmadan, kullanabilmeye başladık. Playwright’ın desteklediği test.step özelliği ile birlikte kullanıldığında, Mocha’da taklalar atarak yapmaya çalışıp stabil hale getiremediğim retry kullanımı sorunu çözülmüş oldu.</li><li>Testler çok daha stabil hale geldi. Tekrar belirteyim, burada önceden yaşadığım sorunun Mocha kaynaklı olduğunu kesin olarak söyleyemiyorum, ama Playwright/Test’e geçtikten sonra uygulama çökmeleri, Appium server bağlantı kopmaları çok çok azaldı.</li></ol><p><em>Bu değişiklik hesapta olmayan başka hangi iyileşmelere kapı açtı ?</em></p><ol><li>Raporlama için Playwright’ın default raporu kullanılabilir duruma geldi.</li><li>Daha önceden Mocha Test Explorer ile kurgulanmış run, debug, pause, resume özellikleri, fonksiyon kaybı olmadan <a href="https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright">Playwright Test for VSCode</a> eklentisi ile kullanılabilir durumda kaldı.</li></ol><p>Sonuçta toparlarsam; test runner olarak Mocha yerine Playwright/Test kullanmaya başlayarak, VS Code ortamında test yazımı ve debug işleri de dahil olmak üzere hiç bir fonksiyon kaybı olmadan, daha stabil ve daha tanıdık yöntemlerle testlerimi çalıştırıp, test raporunu oluşturup paylaşabildiğim bir ortam ortaya çıktı.</p><p>Yalnız internette bu kombinasyonu zaten kullanmakta olan bir proje örneği, hatta bir doküman, walkthrough ile dahi karşılaşmamış olmama şaşırdım. Ya fena halde yanlış keywordlerle arama yaptım ya da Appium+Webdriverio ile mobil uygulama test otomasyonu yazma işi düşündüğüm kadar yaygın değil. Yine de birileri bu yazıyla karşılaşıp en azından akıllarına yeni, farklı bir yöntem gelirse, yazı amacına ulaşmış olur.</p><p>Sevgiler, İyi günler.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90a62e5e8dfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>