<?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 Thanakit Sapmamoon on Medium]]></title>
        <description><![CDATA[Stories by Thanakit Sapmamoon on Medium]]></description>
        <link>https://medium.com/@knotthanakit?source=rss-40ee8f1517d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VHAEsOD1heQe_mCt</url>
            <title>Stories by Thanakit Sapmamoon on Medium</title>
            <link>https://medium.com/@knotthanakit?source=rss-40ee8f1517d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:43:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@knotthanakit/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[มาลองทำ Docker กับ Cypress กัน]]></title>
            <link>https://knotthanakit.medium.com/%E0%B8%A1%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B8%97%E0%B8%B3-docker-%E0%B8%81%E0%B8%B1%E0%B8%9A-cypress-%E0%B8%81%E0%B8%B1%E0%B8%99-27f5e956ba18?source=rss-40ee8f1517d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f5e956ba18</guid>
            <category><![CDATA[automated-testing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cypress]]></category>
            <dc:creator><![CDATA[Thanakit Sapmamoon]]></dc:creator>
            <pubDate>Sun, 21 Feb 2021 10:36:07 GMT</pubDate>
            <atom:updated>2021-02-21T10:37:34.094Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Docker คืออะไร????</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*I0WbLIUxd0pybWZRz6-ptQ.png" /></figure><p><strong>Docker</strong> คือ Platform ของ Software Container ที่เอาไว้ใช้จัดการกับ Container ซึ่ง Container จะมีทุกสิ่งที่ software ต้องการเรียกใช้งานเช่น library รวมไปถึงสิ่งที่จำเป็นในการเรียกใช้เช่น Database หรือ Web Server</p><p>โดย Docker จะมีการทำงานคล้ายๆกับ VM(Virtual Machine)แต่มีส่วนที่ต่างจาก VM คือ VM จะ build ทั้ง OS เลย แต่ Docker จะสร้าง Container เพื่อจำลอง Environment สำหรับ 1 Service เท่านั้น ซึ่งทำให้เบากว่า VM มากๆ เพราะการที่ VM ได้ build ทั้ง OS ก็ทำให้มีบางอย่างที่เราไม่ได้ใช้ แต่ก็จำเป็นที่จะต้องรัน นั่นทำให้เราเสีย Resource ไปเปล่าๆ ซึ่งเป็นสาเหตุทำให้ช้า</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Z3_aN2m37x50VMQ-R-Kjqg.jpeg" /></figure><h3>แล้ว Cypress ล่ะคืออะไร?????</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7ih2zzcCyifrZJ2lOy0FQ.png" /></figure><p>Cypress เป็น Test Framework ที่ไม่ได้ไปยุ่งอะไรเลยกับ Selenium หรือ Webdriver ที่เรารู้จักกันดี แต่จะไปใช้ JavaScript หรือ TypeScript ในการ implement ขึ้นมาซึ่งก็แน่นอนว่าครอบคลุมทั้งระบบ ตั้งแต่ Unit Tests ไปจนถึง End to End Test</p><h4>Cypress VS Robot Framework</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZlhJpZnH1FCKuojZ87YhUA.jpeg" /></figure><p><strong>คราวนี้เราจะลองจับข้อดีของ Docker กับ Cypress แล้วเอามาทำงานคู่กัน</strong></p><blockquote>ปล.ใน blog นี้จะไม่รวมการ install ของ Technology ทั้ง 2 เพราะว่าน่าจะมี blog สำหรับการ install ของทั้งคู่เยอะพอตัว</blockquote><h3>Requirement</h3><ul><li>Git</li><li>Docker for Desktop</li></ul><h3>Let’s Start !!!!!!</h3><p>เปิด Terminal ขึ้นมา แล้วใช้ Git โดยการ clone จาก Repository <a href="https://github.com/bahmutov/demo-docker-cypress-included">demo-docker-cypress-included</a></p><pre>git clone <a href="https://github.com/bahmutov/demo-docker-cypress-included.git">https://github.com/bahmutov/demo-docker-cypress-included.git</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqUdDyrjSTpRLMTlWLxaPQ.png" /></figure><p>จากนั้นก็เข้าไปใน git repo ที่เราเพิ่ง clone มา</p><pre>cd demo-docker-cypress-included</pre><p>พออยู่ใน repo แล้วให้ execute</p><pre>./cy-run.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yN3YG3hNoqZ-SHmWW7X0pw.png" /></figure><p>พอรันเสร็จก็จะมี log ของ result ที่เราเพิ่ง execute ไป</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzBQJ4FP0wBMLFey9vCTmQ.png" /></figure><p>แล้วกอีกอย่างนึงที่ถือว่าเป็นข้อดีของ Cypress เลยก็คือเรื่องของการ capture result ในที่นี้ก็คือเข้าไปที่ folder <strong>images/</strong> จะเจอ img ของ test result ที่จะบอกถึงในการเรียก http method, console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dfl7_xPlnitlQr2rkv54yQ.png" /></figure><p>สุดท้ายเลยที่สำคัญเลยคือในการรันในแต่ล่ะ Test ส่วนของ docker จะมีการ start ขึ้นมา และก็มักจะมี cache มาด้วยบางทีอาจจะทำให้กระทบเรื่องเครื่องช้าบ้าง เรื่อง Disk บ้าง ทางแก้ไขก็คือให้ไปลบ cache ที่ Docker for Desktop</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W3dXmN7Wj2mqsFmpSd2cPQ.png" /></figure><p><strong>Happy Testing ครับโผนนนนน</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f5e956ba18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[ต่อ]มาลองเขียน Automating mobile web apps กันเถอะพี่น้อง!!!!!]]></title>
            <link>https://knotthanakit.medium.com/%E0%B8%95%E0%B9%88%E0%B8%AD-%E0%B8%A1%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-automating-mobile-web-apps-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B9%80%E0%B8%96%E0%B8%AD%E0%B8%B0%E0%B8%9E%E0%B8%B5%E0%B9%88%E0%B8%99%E0%B9%89%E0%B8%AD%E0%B8%87-bfe97d22637d?source=rss-40ee8f1517d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfe97d22637d</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[android-testing]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[automated-testing]]></category>
            <category><![CDATA[ios-testing]]></category>
            <dc:creator><![CDATA[Thanakit Sapmamoon]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 10:01:04 GMT</pubDate>
            <atom:updated>2020-03-09T10:01:04.518Z</atom:updated>
            <content:encoded><![CDATA[<p>จากเมื่อครั้งที่แล้วได้นำเสนอเรื่องราวของ Automating mobile web apps โดยการใช้ simulator ใครยังไม่ได้อ่านกด <a href="https://medium.com/@knotthanakit/%E0%B8%A1%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-automating-mobile-web-apps-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B9%80%E0%B8%96%E0%B8%AD%E0%B8%B0%E0%B8%9E%E0%B8%B5%E0%B9%88%E0%B8%99%E0%B9%89%E0%B8%AD%E0%B8%87-ae5862beffa5">ที่นี่</a> เลยยยยย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*wydehRIWlhcP07yY7s-V4w.png" /></figure><p><strong>มาคุยกันใน blog นี้ต่อเลยล่ะกัน</strong></p><p>ในการทำ testing สิ่งที่สำคัญอีกอย่างหนึ่งก็คือการที่ได้ test ใน evironment ที่ใกล้เคียงกับ evironment ที่ user ใช้ให้ได้มากที่สุด นั่นคือบางทีเราควรที่จะไป test ในส่วนของ UAT, Pre-prod ที่ได้มีการ config package ต่างๆ ที่ใกล้เคียงกับ evironment ที่ user จะใช้</p><p>แต่ในการทำ mobile testing มีอีกสิ่งที่ควรทำคือการได้ test กับ real device เพื่อที่จะได้ทำ behavior ที่ใกล้เคียงกับ user ที่สุด</p><p><strong>Automate Testing ก็เช่นกันนะค้าบบบบบ</strong></p><p>มาเข้าเรื่องเลยล่ะกันครั้งก่อนได้พูดถึงเรื่องวิธีการรัน Automating mobile web apps บน simulator ไปแล้วครั้งนี้จะมาพูดถึงการรันแบบ real device ด้วยนะครับ</p><p><strong>เริ่ม!!!!!!</strong></p><p>จะพูดถึง android ก่อนนะครับ</p><p>ถ้าเราพูดถึง android ที่ใช้รันกับ Emu เราจะใช้ attribute ของ capability ที่จำเป็นแค่ 4 ตัวนั่นก็คือ</p><pre>{<br>  &#39;platformName&#39;: &#39;Android&#39;,<br>  &#39;platformVersion&#39;: &#39;11.0&#39;,<br>  &#39;browserName&#39;: &#39;Chrome&#39;,<br>  &#39;deviceName&#39;: &#39;Pixel&#39;<br>}</pre><p>ทั้งนี้ในการรันบน Emu ตัวที่เป็น identify ว่าจะรันกับ Emu ตัวไหนคือ deviceName แต่ในการรันบน real device จะไม่ใช้ deviceName ในการเป็น identify</p><p>เราจะไปใช้ udid แทน deviceName ในการบอกให้ appium รู้ว่าจะไปรันที่ device ไหน</p><p>ถ้าเพิ่ม udid เข้าไปก็จะประมาณนี้</p><pre>{<br>  &#39;platformName&#39;: &#39;Android&#39;,<br>  &#39;platformVersion&#39;: &#39;11.0&#39;,<br>  &#39;browserName&#39;: &#39;Chrome&#39;,<br>  &#39;deviceName&#39;: &#39;Pixel&#39;,<br>  &#39;udid&#39;: &#39;ab01234567cd8e90f&#39;<br>}</pre><p>มาต่อกันที่ iOS เลยครับ</p><p>ในส่วนของ iOS ในการรันบน Simulator ก็จะมีตัว capability ที่จำเป็นคล้ายๆ android เลยนั่นก็คือ</p><pre>{<br>  &#39;platformName&#39;: &#39;iOS&#39;,<br>  &#39;platformVersion&#39;: &#39;12.4&#39;,<br>  &#39;browserName&#39;: &#39;Safari&#39;,<br>  &#39;deviceName&#39;: &#39;iPhone X&#39;,<br>}</pre><p>แต่ iOS จะมีตัวที่ identify ต่างจาก android นิดหน่อยก็คือ deviceName กับ platformVersion</p><p>และก็แน่นอนเช่นเดียวกับ android สิ่งที่จะเป็น identify ก็คือ udid</p><pre>{<br>  &#39;platformName&#39;: &#39;iOS&#39;,<br>  &#39;platformVersion&#39;: &#39;12.4&#39;,<br>  &#39;browserName&#39;: &#39;Safari&#39;,<br>  &#39;deviceName&#39;: &#39;iPhone X&#39;,<br>  &#39;udid&#39;: &#39;asdfghjkld0243476d78dg9f9fgh&#39;<br>}</pre><p>แต่ในส่วนของ iOS จะมีสิ่งที่พิเศษก็คือ debug port นั่นคือเราต้อง install เพิ่มนั่นเอง</p><p>วิธีการ install ก็ตามไป <a href="https://github.com/google/ios-webkit-debug-proxy">ที่นี่</a> เลยครับ</p><p>วิธีการใช้ก็คือไม่ยากเพียงแค่รัน</p><pre>ios_webkit_debug_proxy</pre><p>แล้วใน log จะบอก port สำหรับ debug</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvZauAM8gx_QIuyhVL5xCA.png" /></figure><p>ตัวอย่างรูปข้างบน log ได้บอก port ที่ connect กับ iPhone คือ 9222</p><p>ดังนั้นใน capability ก็จะมีอีกอย่างที่เพิ่มมาก็คือ <strong>webkitDebugProxyPort </strong>แล้วก็ใส่ค่าเป็น debug port ตามใน log เลย</p><pre>{<br>  &#39;platformName&#39;: &#39;iOS&#39;,<br>  &#39;platformVersion&#39;: &#39;12.4&#39;,<br>  &#39;browserName&#39;: &#39;Safari&#39;,<br>  &#39;deviceName&#39;: &#39;iPhone X&#39;,<br>  &#39;udid&#39;: &#39;asdfghjkld0243476d78dg9f9fgh&#39;,<br>  &#39;webkitDebugProxyPort&#39;: &#39;9222&#39;<br>}</pre><p>จากนั้นก็รันตามอัธยาศัยเลยครับ</p><p>Happy Testing ครับโผนนนนน</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfe97d22637d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[มาลองเขียน Automating mobile web apps กันเถอะพี่น้อง!!!!!]]></title>
            <link>https://knotthanakit.medium.com/%E0%B8%A1%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-automating-mobile-web-apps-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B9%80%E0%B8%96%E0%B8%AD%E0%B8%B0%E0%B8%9E%E0%B8%B5%E0%B9%88%E0%B8%99%E0%B9%89%E0%B8%AD%E0%B8%87-ae5862beffa5?source=rss-40ee8f1517d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae5862beffa5</guid>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[automated-testing]]></category>
            <dc:creator><![CDATA[Thanakit Sapmamoon]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 15:03:14 GMT</pubDate>
            <atom:updated>2020-03-01T15:03:14.478Z</atom:updated>
            <content:encoded><![CDATA[<p>ช่วงนี้ได้เห็นหลายๆทีม ได้ develop web application ซึ่งบาง web ก็มี feature สำหรับ mobile นั่นก็คือ <strong>Mobile view </strong>นั่นทำให้ QA ฝ่าย Automate test ทั้งหลายได้มีการ challenge ว่า automate test มันต้องทำได้สิ แต่…จะทำยังไง ?</p><p>ในที่นี้คือผมจะใช้ Appium ในการ develop นะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EK3mSP3t4bYj0_vVCDl90Q.png" /></figure><p><strong>ในส่วนที่ว่า Appium ใช้ยังไงจะข้ามไปนะครับ</strong></p><p>มาเริ่มกันเลยดีกว่าใน blog นี้ผมจะพูดถึงการทำกับ Simulator ก่อนนะครับ</p><p>ปกติแล้วถ้าเราจะรัน script สักอย่างขึ้นมาส่วนประกอบของ capability หลักๆเลยก็คือ attribute ที่ชื่อ “app” ในตัวนี้จะบอก path ของ app ที่เราจะรันมันขึ้นมา แต่ใน path นี้เราจะตัดมันออกเพราะเราไม่ได้รันตัวที่เปน app ขึ้นมา</p><p><strong>แล้วเราจะรันยังไงถ้าไม่มี app ล่ะ ?</strong></p><p>ในส่วนตรงนี้ให้เราใส่ attribute ไปแทนครับ นั่นก็คือ “browserName” แล้วก็ input ค่าเข้าไป</p><p><strong>iOS</strong></p><pre>{<br>  &#39;platformName&#39;: &#39;iOS&#39;,<br>  &#39;platformVersion&#39;: &#39;12.4&#39;,<br>  &#39;browserName&#39;: &#39;Safari&#39;,<br>  &#39;deviceName&#39;: &#39;iPhone X&#39;<br>}</pre><p><strong>Android</strong></p><pre>{<br>  &#39;platformName&#39;: &#39;Android&#39;,<br>  &#39;platformVersion&#39;: &#39;9&#39;,<br>  &#39;browserName&#39;: &#39;Chrome&#39;,<br>  &#39;deviceName&#39;: &#39;Pixel&#39;<br>}</pre><p>จากนั้นก็ develop ตามแนวทางที่เราถนัดเลยครับ</p><p>Happy Testing ครับโผนนนนน</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae5862beffa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>