<?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 Lawrence Z on Medium]]></title>
        <description><![CDATA[Stories by Lawrence Z on Medium]]></description>
        <link>https://medium.com/@mgz216?source=rss-57a32e432fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gQXcPU4vKsf7bINK</url>
            <title>Stories by Lawrence Z on Medium</title>
            <link>https://medium.com/@mgz216?source=rss-57a32e432fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:12:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mgz216/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[Playwright Visual Test My Way]]></title>
            <link>https://medium.com/@mgz216/playwright-visual-test-my-way-fe38bbab7846?source=rss-57a32e432fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe38bbab7846</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[playwright-test]]></category>
            <category><![CDATA[visual-testing]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Lawrence Z]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 02:39:04 GMT</pubDate>
            <atom:updated>2023-09-21T02:43:55.068Z</atom:updated>
            <content:encoded><![CDATA[<p>my use case of visual comparisons with playwright test</p><p>This is a quick plug of how I use Playwright Test to solve one of my use cases.</p><p>First off, I have to say that Playwright Test already provides a lot of features right out of the box, <a href="https://playwright.dev/docs/test-snapshots">visual comparisons</a> is one of them (like 👇 from its doc), so there isn’t really much needed for “customization”.</p><pre>import { test, expect } from &#39;@playwright/test&#39;;<br><br>test(&#39;example test&#39;, async ({ page }) =&gt; {<br>  await page.goto(&#39;https://playwright.dev&#39;);<br>  await expect(page).toHaveScreenshot();<br>});</pre><p>However, my use case is little bit different than just taking a snapshot at the same step, and to compare to the previously captured golden image file.</p><p>There are a few key points I’d need to solve in my use case…</p><ul><li>capture a snapshot at one point during the use case flow</li><li>specifically capture the snapshot of the component at that point of the flow, and then use it as a golden file.</li><li>the name and path of the snapshots (including the golden file) can be managed in a parameterized file/folder location</li><li>throughout the use case flow, at various points/steps, the freshly captured component snapshots can be compared to the same golden file.</li></ul><p>So…</p><p>First, I will need a way to manage the snapshot file location at a global level. This can be done in <em>playwright.config.ts</em></p><pre>export default defineConfig&lt;TestOptions&gt;({<br>  snapshotPathTemplate: &quot;{testDir}/__snapshots__/{testFilePath}/{arg}{ext}&quot;,<br>  ...<br>});</pre><p>Second, I will need some helper functions to capture the baseline/golden snapshot, and an example as 👇</p><pre>export async function captureSnapshot(<br>  testInfo: TestInfo,<br>  fileName: string | string[],<br>  options?: { page?: Page; locator?: Locator }<br>): Promise&lt;void&gt; {<br>  const { page, locator } = options || {};<br><br>  if (!page &amp;&amp; !locator) {<br>    throw new Error(&quot;Either &#39;page&#39; or &#39;locator&#39; must be provided.&quot;);<br>  }<br><br>  const screenshotOptions: PageScreenshotOptions = {<br>    animations: &quot;disabled&quot;,<br>    // getSnapshotPath can be another func to map the global file path<br>    path: getSnapshotPath(testInfo, fileName),<br>  };<br><br>  if (page) {<br>    await page.screenshot(screenshotOptions);<br>  } else if (locator) {<br>    await locator.screenshot(screenshotOptions);<br>  }<br>}</pre><p>Third, simply just use Playwright Test <em>expect</em> assertion to compare to the snapshot</p><pre>test(&#39;example test&#39;, async ({ page }) =&gt; {<br>  ...<br>  expect(await page.locator(&#39;some_locator&#39;)).toMatchSnapshot(fileName);<br>});</pre><p>In addition, I really enjoy using the playwright’s built-in html report 🚀 visual comparison slider👇 when there is a diff in snapshots. (🙏 Playwright team for the awesome tooling!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*LKk1QfoL07FGkZFIwU_Vcg.png" /><figcaption>slider view</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe38bbab7846" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Give a little touch-up to my Github profile]]></title>
            <link>https://medium.com/@mgz216/give-a-little-touch-up-to-my-github-profile-ed046cf5f5e1?source=rss-57a32e432fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed046cf5f5e1</guid>
            <category><![CDATA[readme]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[profile]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Lawrence Z]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 01:03:09 GMT</pubDate>
            <atom:updated>2023-04-26T01:03:09.916Z</atom:updated>
            <content:encoded><![CDATA[<p>Github profile README</p><p>Really not that much to say here, but figured I should just jot down what I did and why I did this for the future of me &lt;reading my own notes&gt;</p><p>From time to time, I was asked for my github profile, the <em>https://github.com/your-github-username</em> page.</p><p>There are tons of HOW-TOs tutorials on how to create the profile page, so there’s no need to dive more in details here…But essentially, there are a few key points needed…</p><ul><li>create a public repo named in your github username</li><li>add a README.md file</li><li>update/edit the README.md file</li></ul><p>So all I want is a very simple minimal of readme with some badges, bullet points, and that’s it…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*sdr9BipqSYCjKgP64H1d1A.png" /></figure><p>P.S. some resources I used</p><ul><li><a href="https://shields.io/">https://shields.io/</a></li><li><a href="https://github.com/antonkomarev/github-profile-views-counter">https://github.com/antonkomarev/github-profile-views-counter</a></li><li><a href="https://github.com/devicons/devicon">https://github.com/devicons/devicon</a></li><li>only found this after I created the readme — <a href="https://github.com/rahuldkjain/github-profile-readme-generator">https://github.com/rahuldkjain/github-profile-readme-generator</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed046cf5f5e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yet another iTerm2 Configuration]]></title>
            <link>https://medium.com/@mgz216/yet-another-iterm2-configuration-d7516b69ffc8?source=rss-57a32e432fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7516b69ffc8</guid>
            <category><![CDATA[figs]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[iterm2]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Lawrence Z]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 04:55:13 GMT</pubDate>
            <atom:updated>2023-06-04T17:54:03.676Z</atom:updated>
            <content:encoded><![CDATA[<p>Clearly I have more time lately since I’m writing blog about work station config. And I have the need to setup my old MacBook’s terminal, so better just put something down before I have to re-do all over again…</p><p>After I updated the macOS of my old MacBook Pro, the terminal shell now defaults to zsh, so I figured I should just make it like how I use it at work then, and here goes…</p><ul><li>install iTerm2 to replace terminal, and re-install zsh and use it to be safe. Also install lsd (a better ls)</li></ul><pre>brew install --cask iterm2<br>brew reinstall zsh<br>brew install lsd<br><br>#go to shells<br>sudo vi /etc/shells<br>#add this line 👉🏽 /usr/local/bin/zsh 👈🏽 to the file and save it (for Intel chip)<br>#add this line 👉🏽 /opt/homebrew/bin/zsh 👈🏽 to the file and save it (for Apple arm)<br>#then run this (for Intel chip)<br>chsh -s /usr/local/bin/zsh<br>#Or then run this (for Apple arm chip)<br>chsh -s /opt/homebrew/bin/zsh<br><br>#to check it, run this<br>which zsh<br>#and run this<br>echo $SHELL<br>#both should return /usr/local/bin/zsh (or /opt/homebrew/bin/zsh for Apple arm)</pre><ul><li>install <a href="https://ohmyz.sh/">Oh My Zsh</a></li></ul><pre>sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)&quot;</pre><ul><li><a href="https://formulae.brew.sh/cask/fig">install</a> <a href="https://fig.io/">Fig</a>, and I really 💗 this tool, plus it’s free 🙏🏽 for personal use. (Learn more <a href="https://fig.io/user-manual">HERE</a>)</li></ul><pre>brew install fig</pre><ul><li>after fig install, create an account with fig by using my github account</li><li>from here, I can install whole bunch of <a href="https://app.fig.io/plugins">plugins</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*1Ih_hv4cwbFM_AKbzIcr6w.png" /></figure><ul><li>and I have these installed so far with fig (and will create my own script later)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*92MRRTsHG5C4ql5mvKVj5Q.png" /></figure><ul><li>make sure to reload/reopen everything for iterm2 so to get ready to use the plugins</li></ul><pre>#reload fig<br>fig source<br><br>#reload zsh<br>source ~/.zshrc</pre><ul><li>with fig, it gives a lot of features, one of them is IDE like intelliSense👇🏽</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*3h0AYfRfKwaPS0qgpQw0IA.gif" /></figure><ul><li>now, let me get some colors to my iterm2</li><li>first, <a href="https://github.com/ryanoasis/nerd-fonts#option-4-homebrew-fonts">install</a> the fonts from <a href="https://www.nerdfonts.com/font-downloads">nerdfonts.com</a>, and I like <a href="https://www.programmingfonts.org/#jetbrainsmono">JetBrains Mono</a>, and set the Profile &gt; Text to JetBrainsMono Nerd Fort Mono</li></ul><pre>brew tap homebrew/cask-fonts<br>#install jetbrains mono fonts<br>brew install font-jetbrains-mono-nerd-font</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*pyBOeUuNIJXor1ta-e4mzA.png" /></figure><ul><li>then, install some <a href="https://iterm2colorschemes.com/">color schemes</a>👇🏽, and I like <a href="https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/MaterialDesignColors.itermcolors">MaterialDesignColors</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*B5kDn46TMzNX-SvOqlI9yA.png" /></figure><ul><li>update .zshrc file to add the followings to the file and save</li></ul><pre># this one below is to update the theme with powerlevel10k<br>ZSH_THEME=&quot;powerlevel10k/powerlevel10k&quot;<br><br># add git to the plugins<br>plugins=(git)<br><br># replace ls with lsd<br>alias ls=lsd</pre><ul><li>make sure to reload/reopen everything for iterm2</li></ul><pre>#reload zsh<br>source ~/.zshrc<br><br>#if error out with [oh-my-zsh] them &#39;powerlevel10k/powerlevel10k&#39; not found<br>#run this command to clone the theme repo<br>git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k</pre><ul><li>don’t forget to config powerlevel10k to use the new look of iterm2</li></ul><pre>#follow the prompt after this command<br>p10k configure</pre><ul><li>Now, my terminal will looks like this…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*uYw962zLwz9-6QTcpgZZ6A.png" /></figure><blockquote><em>(P.S. be sure to make update all my IDE’s terminal fonts in pref settings to </em><em>JetBrainsMono Nerd Fort Mono)</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7516b69ffc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The notion of “Engineering Efficiency”]]></title>
            <link>https://medium.com/@mgz216/the-notion-of-engineering-efficiency-65922c7e112a?source=rss-57a32e432fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/65922c7e112a</guid>
            <category><![CDATA[quality-engineering]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Lawrence Z]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 18:36:29 GMT</pubDate>
            <atom:updated>2023-02-09T18:36:29.677Z</atom:updated>
            <content:encoded><![CDATA[<h4>specifically in the topic of lean in quality engineering</h4><p>Now that I have some downtime, it allows me to revisit the topic of engineering efficiency. We all know, the industry is “shift-left”, even ChatGTP gives a pretty solid definition on first try…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*hs-y-w5C4DwaShSCBUVNaQ.png" /></figure><p>Naturally, we’d think shift-left is one of the ways to help us achieve engineering efficiency. Often, it’s also seen as a way of saying <strong><em>everyone owns quality</em></strong>.</p><p>ponder on that…</p><p>First, this is a positive approach, but to what extent does everyone should own the quality. Also one potential trap which is when everyone owns quality, no one would truly own it.</p><p>To be clear, everyone <strong>should</strong> own the quality of their work, by following all the engineering best practices, some basic ones such as test the code by following the test pyramid, review the code by following the guidelines, re-test the code, re-review the code, and etc. However, this is not what shift-left is about, and of course this alone will not lead us to achieve engineering efficiency. This saying of everyone owns quality is a good stepping stone, but we need <strong>quality engineering</strong>.</p><p>One misconception I’ve noticed in the past is that some people think quality engineering just means everyone owns quality or is a way of doing lean in quality engineering.</p><p>Again, ChatGTP gives another pretty good definition…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*ojfu_sNx9r9QJLaco5ueGw.png" /></figure><p>As mentioned above, “everyone owns quality” is just a stepping stone. It will have some shortcomings if this is seen as the equivalent of quality engineering…</p><ul><li>For engineers in development to own the quality, to test the code, to review the code, to test code again both manually and with automated tests, to look for edge cases then re-review and re-test. These are all good and important. It will for sure drive the quality of work way up if it’s done. But there is one thing…engineers in development wants to <strong><em>build things and release things</em></strong>. So to what end, will the test be enough?</li><li>For product/project development team to own the quality, to test the domain team is responsible for, to test the integration with domains other teams are responsible for, to test the entire system with the domain team just puts in, to continuously testing the entire system with team’s existing product for regression risks impacted by other teams’ changes. This is non-trivia task for the product development team to take on. After all, the core of product/project development team is to <strong><em>build things and release things.</em></strong></li><li>For standalone/external test team to own the quality, to test the product/project development team’s domain upon its feature release, to test the entire system for regression risks with all product teams’ features. How feasible is this, when this standalone/external team does not own/know the each of the domain product team owns?</li></ul><p>Everyone owns quality, but what we really need is Engineers In Quality. Product development team needs engineers in quality to work closely with engineers in development within the same team domain, but focus exclusively on quality engineering…</p><ul><li>Engage the dialogue about quality engineering in early stages with engineers in development. Work with team to set processes around quality engineering. Echo the best practices defined as a team. Review and continue to improve the processes.</li><li>Not only just at feature functional level as to assert a function or a feature is working correctly, but also for performance, security, or reliability.</li><li>exploratory and chaos testing to break things.</li><li>organizing and constantly improve regression testing.</li><li>continuous monitor and collect data points in both lower environments and production environment. Especially in a clould-first distributed system, to continue to use different techniques to drive quality engineering, such as ODD (observability driven development).</li><li>Engage with Ops team to collaborate on observability with metrics (such as DORA metrics) to help the team become an elite performance team.</li></ul><p>So yes, we need a “mantra” that everyone owns quality, but what we still need is engineers in quality that embedded in the team to drive quality engineering, and ultimately to achieve engineering efficiency.</p><p>P.S. after writing this, there are a few things I want to follow up.</p><ul><li>download the new edge browser and its bing search</li><li>try out google bard at some point</li><li>put up another post of how I think the “traditional” functional e2e test can be evolved to fit in ODD</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65922c7e112a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>