<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3868566217808655382</id><updated>2026-08-25T17:24:05.203-04:00</updated><category term="Java"/><category term="code examples"/><category term="test framework"/><category term="WebDriver"/><category term="beginner"/><category term="appium"/><category term="Playwright"/><category term="Ruby"/><category term="qa"/><category term="Fitbit-Boston"/><category term="industry"/><category term="Gauge"/><category term="Rest API"/><category term="AI"/><category term="Angie Jones"/><category term="Dave Haeffner"/><category term="MoTB"/><category term="Gradle"/><category term="AI QA"/><category term="Capybara"/><category term="intermediate"/><category term="manual to automation"/><category term="Docker"/><category term="Meetup"/><category term="Page Object"/><category term="bdd"/><category term="security"/><category term="Claude.ai"/><category term="Design Pattern"/><category term="Detox"/><category term="DetoxDemo"/><category term="DevOps"/><category term="Simon Stewart"/><category term="bun-create-playwright"/><category term="conference"/><category term="setup"/><category term="GitHub Action Workflows"/><category term="SDET"/><category term="Sauce Labs"/><category term="SeleniumGrid"/><category term="sqgne"/><category term="vlog"/><category term="AngularJS"/><category term="Chef"/><category term="GIT"/><category term="Groovy"/><category term="Protractor"/><category term="Python"/><category term="Twitter"/><category term="algorithms"/><category term="book review"/><category term="manual"/><category term="Agile"/><category term="Android"/><category term="BostonRecruiterSurvey2017"/><category term="Geb"/><category term="Jenkins"/><category term="Jim Evans"/><category term="Joe Colantonio"/><category term="STAR East"/><category term="TestBash"/><category term="VirtualBox"/><category term="Yeoman"/><category term="code review request"/><category term="courses"/><category term="#OpenToWork"/><category term="API"/><category term="Builder Pattern"/><category term="Chrome"/><category term="CommandLine"/><category term="Contract Testing"/><category term="Cursor"/><category term="GeekDad"/><category term="Hamcrest"/><category term="IntelliJ"/><category term="JUnit"/><category term="Jason Huggins"/><category term="JavaScript"/><category term="Kali Linux"/><category term="KitchenCI"/><category term="Login"/><category term="Pact.io"/><category term="Page Factory"/><category term="REST Assured"/><category term="Test Talks"/><category term="TestGuild"/><category term="Vagrant"/><category term="W3C"/><category term="aws"/><category term="baby"/><category term="waterfall"/><category term="#motb"/><category term="AAA Life"/><category term="Android Studio"/><category term="Applitools"/><category term="ArrangeActAsset"/><category term="Butch Mayhew"/><category term="C#"/><category term="CI"/><category term="CSS Selectors"/><category term="ClaudeConversations"/><category term="Codecademy"/><category term="Cucumber"/><category term="Cypress"/><category term="DesiredCapabilities"/><category term="Dorothy Graham"/><category term="Eclipse"/><category term="Facebook"/><category term="GitHub Copilot"/><category term="GitLab"/><category term="JBrains"/><category term="JIRA"/><category term="James Bach"/><category term="Jupyter"/><category term="Meta"/><category term="Metro"/><category term="OOP"/><category term="Postman"/><category term="RST"/><category term="Rapid Software Testing"/><category term="React"/><category term="RemoteWebDriver"/><category term="Seb Rose"/><category term="Seeding"/><category term="SerenityBDD"/><category term="Snyk"/><category term="Spock"/><category term="Test Kitchen"/><category term="TestNG"/><category term="Threat Stack"/><category term="Uncle Bob Martin"/><category term="Ward Cunningham"/><category term="Yarn"/><category term="automation"/><category term="cURL"/><category term="certification"/><category term="cve"/><category term="data structures"/><category term="emulator"/><category term="humor"/><category term="jokes"/><category term="logging"/><category term="nvd"/><category term="pojos"/><category term="subscribe"/><category term="talks"/><category term="tdd"/><category term="vibe coding"/><category term="vscode"/><category term="vulns"/><title type='text'>Adventures in Automation</title><subtitle type='html'>Stories for Software QA Engineers shifting from manual to automated testing. </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.tjmaher.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default?start-index=26&amp;max-results=25'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>420</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-6355218177602804828</id><published>2026-08-24T22:28:52.253-04:00</published><updated>2026-08-25T14:05:16.992-04:00</updated><title type='text'>Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report</title><content type='html'>&lt;div&gt;So far, we have reviewed how to &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot; target=&quot;_blank&quot;&gt;review code with ES Lint + Prettier&lt;/a&gt; and &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot; target=&quot;_blank&quot;&gt;Typecheck&lt;/a&gt;, how to &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot; target=&quot;_blank&quot;&gt;set up and run smoke tests&lt;/a&gt;, how to &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot; target=&quot;_blank&quot;&gt;run all Playwright + TypeScript tests&lt;/a&gt;, and reviewed the HTML report of results.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this post, we are going to set up a three stage GitLab CI/ CD pipeline that will run against every merge request:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&amp;nbsp;Quality (lint, typecheck, prettier)&amp;nbsp; --&amp;gt; Test ( smoke + regression ) --&amp;gt; Report ( Downloadable )&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I haven&#39;t used GitLab since when I worked at ThreatStack back in 2020. ( See my blog entry &lt;a href=&quot;https://www.tjmaher.com/2018/03/getting-to-know-gitlab-and-how-they.html&quot; target=&quot;_blank&quot;&gt;Getting to Know GitLab and How They Test the UI&lt;/a&gt; )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;GitLab reads .gitlab-ci.yml from the repository root and turns it into a &lt;i&gt;pipeline,&lt;/i&gt; a set of jobs, grouped into stages, running whenever you push a change to a repository.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Stages run one after another, and jobs within a stage run in parallel.&amp;nbsp; If one stage fails, the stages after it are skipped.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;This begs the question: What is GitLab? What is CI/ CD? Or a pipeline? Or a merge request?&amp;nbsp;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is GitLab?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;GitLab began in 2011 as a side project by Ukrainian programmer Dmytro Zaporozhets, built to help developers work together on code more easily. Over time, it grew into a large open-source DevOps platform. More than just storing code, it handles code reviews, CI/CD (continuous integration and continuous delivery), and package registries. A company called GitLab Inc. was eventually created to turn the project into a commercial product.&lt;/div&gt;&lt;div&gt;
&lt;p dir=&quot;ltr&quot;&gt;What makes GitLab different from tools that only host Git repositories (like a basic Git server) is that it bundles the entire software delivery process into one application. This includes:&lt;/p&gt;
&lt;ul dir=&quot;ltr&quot;&gt;
&lt;li&gt;&lt;strong&gt;Merge requests&lt;/strong&gt; – GitLab&#39;s term for proposing and reviewing code changes before they&#39;re merged into the main codebase (similar to a &quot;pull request&quot; in GitHub)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Issue tracking&lt;/strong&gt; – a built-in system for logging bugs, tasks, and feature requests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pipelines&lt;/strong&gt; – automated workflows that build, test, and deploy code whenever changes are pushed&lt;/li&gt;
&lt;/ul&gt;
&lt;p dir=&quot;ltr&quot;&gt;So instead of stitching together separate tools for version control, testing, and deployment, GitLab gives you all of it in one place.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Isn&#39;t That Just GitHub?&amp;nbsp;&lt;/h2&gt;According to GitLab&#39;s &quot;&lt;a href=&quot;https://about.gitlab.com/compare/gitlab-vs-github/&quot;&gt;What are the fundamental differences between GitLab and GitHub&lt;/a&gt;&quot;, &quot;GitHub&#39;s security scanning, AI, and advanced CI/CD are native but sold as separate paid add-ons on top of the base platform price [...] GitLab puts planning, source code, CI/CD, security, and deployment into a single application with one permission model, one audit trail, and shared analytics. That means fewer tools to run, fewer integrations to maintain, and one place to apply policies and AI across the whole lifecycle&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GitLab calls all the extra stuff you need to purchase from GitHub a &quot;toolchain tax&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is CI/ CD?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;CI/CD stands for Continuous Integration and Continuous Delivery (or Deployment). It&#39;s a DevOps&amp;nbsp;practice that automates building, testing, and deploying code changes, enabling faster and more reliable software releases.&lt;br /&gt;&lt;br /&gt;&quot;CI/CD is best explained as an automated workflow that replaces manual steps with pipelines that build, test, and deploy software reliably.&lt;br /&gt;&lt;br /&gt;&quot;CI/CD falls under DevOps (the joining of development and operations teams) and combines the practices of continuous integration and continuous delivery. CI/CD automates much or all of the manual human intervention traditionally needed to get new code from a commit into production, encompassing the build, test (including integration tests, unit tests, and regression tests), and deploy phases, as well as infrastructure provisioning.&lt;br /&gt;&lt;br /&gt;&quot;With a CI/CD pipeline, development teams can make changes to code that are then automatically tested and pushed out for delivery and deployment. &lt;a href=&quot;https://about.gitlab.com/blog/beginner-guide-ci-cd/&quot;&gt;Get CI/CD right&lt;/a&gt; and downtime is minimized and code releases happen faster&quot; - &lt;a href=&quot;https://about.gitlab.com/topics/ci-cd/&quot;&gt;GitLab.com / What is CI / CD&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What are CI/ CD Pipelines?&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&quot;A &lt;a href=&quot;https://about.gitlab.com/topics/ci-cd/cicd-pipeline/&quot;&gt;CI/CD pipeline&lt;/a&gt; is an automated process utilized by software development teams to streamline the creation, testing and deployment of applications.&lt;br /&gt;&lt;br /&gt;&quot;CI represents continuous integration, where developers frequently merge code changes into a central repository, allowing early detection of issues. CD refers to continuous deployment or continuous delivery, which automates the application&#39;s release to its intended environment, ensuring that it is readily available to users. This pipeline is vital for teams aiming to improve software quality and speed up delivery through regular, reliable updates.&lt;br /&gt;&lt;br /&gt;&quot;Integrating a CI/CD pipeline into your workflow significantly reduces the risk of errors in the deployment process. Automating builds and tests ensures that bugs are caught early and fixed promptly, maintaining high-quality software&quot;. - &lt;a href=&quot;https://about.gitlab.com/topics/ci-cd/&quot;&gt;GitLab.com / What is CI / CD&lt;/a&gt;?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just like GitHub, GitLab is free to join, hoping people will use the platform and decide to subscribe for more of its services.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With GitLab you can take your changes you want to make to the codebase of the &lt;b&gt;code repository&lt;/b&gt;, try to &lt;b&gt;commit &lt;/b&gt;the changes, and make a request to merge the changes into the main branch.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can set up the CI/ CD pipeline that before a senior developer looks at your merge request to see if it can be approved, the merge request gets tested right when it gets created.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;How Do You Create a Merge Request?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say you want to make a change to a code repository to &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/&quot; target=&quot;_blank&quot;&gt;bun-create-playwright&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, if you haven&#39;t already, you need to pull down the code repo:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Do you have Git? Open PowerShell or the Terminal, whatever is your Command Line Interface for the PC or the Mac, and run: &lt;b&gt;git --install&lt;/b&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you do not have git, &lt;a href=&quot;https://git-scm.com/book/en/v2/Getting-Started-Installing-Git&quot; target=&quot;_blank&quot;&gt;install it on you Windows machine or MacBook&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Get the code repository: &lt;b&gt;git clone git@gitlab.com:tjmaher/bun-create-playwright.git&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Already downloaded the repo, and want to make sure you have the latest version?&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;git fetch origin&lt;/li&gt;&lt;li&gt;git checkout main&lt;/li&gt;&lt;li&gt;git pull origin main&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Ready to make some updates?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;git checkout -b feature/my-new-change&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Then make your changes. After that is done, add your changes and create a commit for your changes:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;git status // All your files you made changes to are listed in red, since they are unstaged.&lt;/li&gt;&lt;li&gt;git .add&amp;nbsp;&lt;/li&gt;&lt;li&gt;git status // All your changes are now listed in green. They are staged.&amp;nbsp;&lt;/li&gt;&lt;li&gt;git commit -m &quot;This is my commit!&quot;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;Changes all set? Push the changes to your remote repo:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;git push -u origin features/my-new-change&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Now, you will see a URL pointing exactly to the link where you can see your commit in GitLab. Select the button, &quot;Create Merge Request&quot;.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once you that, the Merge Request will be created, and will be run automatically on the GitLab CI/ CD pipeline.. once we create one.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Create the Configuration File For a CI/ CD Pipeline&lt;/h2&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Want to practice the basics? See &lt;a href=&quot;https://docs.gitlab.com/ci/quick_start/#create-a-gitlab-ciyml-file&quot; target=&quot;_blank&quot;&gt;Tutorial: Create and run your first GitLab CI/CD pipeline&lt;/a&gt;&lt;/li&gt;&lt;li&gt;This walks you through creating a public project, setting up a test runner, and creating a .gitlab-ci.yml file in your root directory, and running a job.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Here, we are going to start reviewing the sample&amp;nbsp;&lt;b&gt;.gitlab-ci.yml&lt;/b&gt; file I created for &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot; target=&quot;_blank&quot;&gt;Bun-Create-Playwright&lt;/a&gt;, the configuration file used when creating a new pipeline that will process the changes we have made to the code base.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;bun-create-playwright / .gitlab-ci.yml&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;stages&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;test&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;report&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/.gitlab-ci.yml&quot;&gt;&lt;i&gt;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/.gitlab-ci.yml&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For any CI / CD pipeline created when a merge request is pushed, we are setting up four stages:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Quality&lt;/b&gt;: Where we check the format using Prettier, run the linter allowing no warnings to sneak by, and run the TypeScript compiler to do type checking. This stage takes seconds to run.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Test&lt;/b&gt;:&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;We run just the one smoke test on Chromium, checking that we can log into the Login page.&lt;/li&gt;&lt;li&gt;Is the smoke test successful? We then will run ALL the tests, positive and negative, on every platform, on Chrome, Firefox, and WebKit / Safari.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;b&gt;Report&lt;/b&gt;: Create a report we can download and examine.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Hidden Jobs: The Quality Template&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;If we take a GitLab job, and add a dot to the name, it becomes a &quot;hidden&quot; job. Let&#39;s say that you have a stage called QUALITY, and you have a substage which checks the format of the code, a substage that runs a linter on the code, and a substage that type checks the code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Each substage might need to have the same things added to it, such as using the same pre-configured Docker image for bun, version 1.3, so you don&#39;t have to manually install bun, its version managers or system libraries.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Or you could take the lockfile as is, produced when dependencies are installed, and use that same exact version on all three substages.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That ,bun_quality could act as a template that could be extended into all three substages.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;.bun_quality&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;image&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;oven/bun:1.3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;before_script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun --version&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun install --frozen-lockfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Docker is a tool that packages your code and everything it needs -- like libraries and system tools -- into a single box called a container. This container runs the exact same way on your laptop, your teammate&#39;s computer, and the cloud server, fixing the classic &quot;it works on my machine&quot; problem&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Docker Hub is a public cloud-based registry service and community library of Docker images.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bun, the package manager, has a Docker Hub it has dubbed &quot;oven&quot;. Here, we are going to be using the Docker image of Bun version 1.3.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Before we run any of the substages -- format, lint, or typecheck -- we will in all stages check the version of bun used, print it out to the log file, then install bun using the Bun 1.3 Docker image, from a frozen lockfile.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;A &lt;b&gt;lockfile &lt;/b&gt;is a &quot;file that lists the direct and indirect dependencies of an application and their version numbers. Its purpose is reproducibility, to ensure anyone installing the application’s dependencies gets the exact same versions&quot;. ( &lt;a href=&quot;https://docs.gitlab.com/user/application_security/terminology/#lockfile&quot; target=&quot;_blank&quot;&gt;GitLab / Terminology&amp;nbsp; Lockfile&lt;/a&gt; )&lt;/li&gt;&lt;li&gt;By installing a &lt;b&gt;frozen lockfile&lt;/b&gt;, we are locking down all package dependencies in our jobs so we will use the same exact version in all three cases. If the lock file is out of sync from package.json, we will have it fail instead of it silently updating.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;By having it frozen, we can guarantee reproducible builds and catch cases where a dependency was added/changed without committing the updated lockfile.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Quality Stage&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that we set up the quality template, we can use it for the substages: format, lint, and typecheck.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;format&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;extends&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;.bun_quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;stage&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun run format:check&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;lint&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;extends&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;.bun_quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;stage&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun run lint:ci&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;typecheck&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;extends&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;.bun_quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;stage&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;quality&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun run typecheck&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Need to add another part to the quality stage? You can just declare it, extending the same template, designating the stage, and adding the script you want to run.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Back in the post&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&amp;nbsp;we set up the following scripts:&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Format:check throws an error when Prettier finds a formatting style error while running the script: &quot;prettier --check .&quot;&lt;/li&gt;&lt;li&gt;Lint:ci uses ES Lint to see if the code has an errors with the script: &quot;eslint . --max-warnings 0&quot;&lt;/li&gt;&lt;li&gt;Typecheck uses the TypeScript compiler to see if there an errors, running: &quot;tsc --noEmit&quot;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;This CI Pipeline will execute these three stages. Any errors detected? The build pipeline will be halted.&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Introducing: The Official Playwright Docker Image&lt;/h2&gt;&lt;div&gt;This GitLab pipeline when running tests, will use the official Docker image that Microsoft has released to run Playwright tests: &lt;b&gt;mcr.microsoft.com/playwright:v1.62.1-noble&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Microsoft stores its Docker images in the Microsoft Artifact Registry under the Playwright subfolder at at&amp;nbsp;&lt;a href=&quot;https://mcr.microsoft.com/en-us/artifact/mar/playwright&quot; target=&quot;_blank&quot;&gt;https://mcr.microsoft.com/en-us/artifact/mar/playwright&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Docker image uses the Ubuntu 24.04 LTS (Noble Numbat) operating system. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Hidden Jobs: The Test Template, Run on Playwright Docker&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just like the Quality stage, the Test stage will receive its own template to be used in its substages.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And, just like the Quality stage, to make sure that each substage is on the same page, we will be using a Docker environment. The Docker image we will be using is Microsoft&#39;s official Docker environment for Playwright.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;.bun_playwright&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;image&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;mcr.microsoft.com/playwright:v1.62.1-noble&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;before_script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;apt-get update &amp;amp;&amp;amp; apt-get install -y unzip curl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;curl -fsSL https://bun.sh/install | bash&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;export PATH=&quot;$HOME/.bun/bin:$PATH&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun --version&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun install --frozen-lockfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From &lt;a href=&quot;https://playwright.dev/docs/docker&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Docker&lt;/a&gt;:&amp;nbsp;&quot;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.noble&quot;&gt;Dockerfile.noble&lt;/a&gt; can be used to run Playwright scripts in Docker environment. This image includes the &lt;a href=&quot;https://playwright.dev/docs/browsers#install-browsers&quot;&gt;Playwright browsers&lt;/a&gt; and &lt;a href=&quot;https://playwright.dev/docs/browsers#install-system-dependencies&quot;&gt;browser system dependencies&lt;/a&gt;&quot;.&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using this image in your CI/CD pipeline guarantees a stable, pre-configured, and reproducible environment for running your automated tests&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After that, we are using APT, the Advanced Package Tool to refresh the container&#39;s package index, then install unzip and curl.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once curl is installed, we download Bun&#39;s official install script (See &lt;a href=&quot;https://bun.sh/docs/installation&quot;&gt;Bun.sh / Installation&lt;/a&gt; ) and pipes it directly into bash to execute. The flags:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;-f fails silently on server errors instead of printing an HTML error page&lt;/li&gt;&lt;li&gt;-s runs silently (no progress meter)&lt;/li&gt;&lt;li&gt;-S re-enables error messages even in silent mode&lt;/li&gt;&lt;li&gt;&amp;nbsp;-L follows redirects.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;This installs the Bun binary into ~/.bun/bin.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then we export bun&#39;s install directory to the shell&#39;s PATH for the current job session, since the install script doesn&#39;t automatically make bun available in a fresh shell (it normally edits .bashrc/.zshrc for interactive shells, which CI runners don&#39;t source the same way).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Did everything work?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Print the installed Bun version to the job log. This confirms the install succeeded (the job fails fast here if &lt;code&gt;bun&lt;/code&gt; isn&#39;t on &lt;code&gt;PATH&lt;/code&gt;), and leaves a version record in the CI logs for debugging.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Finally we install the project&#39;s dependencies using Bun&#39;s package manager. --frozen-lockfile tells Bun to install exactly what&#39;s in bun.lock (or bun.lockb) and fail the build if the lockfile is out of sync with package.json, rather than silently updating it, which is the standard practice for CI to guarantee reproducible builds.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whew! And this will happen on every substage in Test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Test Stage&lt;/h2&gt;&lt;div&gt;Now, we set up the test stage, first running all tests we have tagged with &quot;@smoke&quot;. If that passes, we run ALL the tests.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everything we set up in .bun_playwright gets pulled right into this GitLab CI job.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;playwright&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;extends&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;.bun_playwright&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;stage&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;test&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;timeout&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;60 minutes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun run test:smoke&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;bun run test&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;artifacts&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;when&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;always&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;paths&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;playwright-report/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;test-results/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;reports/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;reports&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;junit&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;reports/junit/results.xml&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;expire_in&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;30 days&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;After the clock starts, we are giving it one full hour for all the tests to run.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Assemble the Artifacts!&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Whether the jobs pass or fail, we are going to create a report so we can audit the test. We are placing the items produced in:&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;playwright-report&lt;/b&gt;/: This directory holds the main interactive HTML report. It includes the index.html file that lets you visually click through test suites, read error logs, and see execution timelines.&lt;/li&gt;&lt;li&gt;&lt;b&gt;test-results/&lt;/b&gt;: This folder stores the raw individual assets captured during test execution. If a test fails, Playwright drops failure screenshots, video recordings of the browser screen, and .zip trace files (which allow you to step through the test execution like a video) into this directory&lt;/li&gt;&lt;li&gt;&lt;b&gt;reports/&lt;/b&gt;: This is a catch-all or customized directory often used for alternative report formats. It holds JUnit XML files meant to be parsed directly by your CI platform to display a quick test summary on your pull/merge request page&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Report Stage&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;On the report stage, we are using a lightweight Linux container called &quot;alpine&quot; to execute the commands quickly. We don&#39;t need pre-installed browsers or a JavaScript runtime environment. These reports will be generated whether the tests pass or fail.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This job will be started right after the &quot;playwright&quot; job finishes in the Test stage.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;report&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;stage&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;report&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;image&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;alpine:latest&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;when&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;always&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;needs&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;job&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;playwright&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;artifacts&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;script&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;ls -la playwright-report/ test-results/ reports/junit/ || true&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;artifacts&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;when&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;always&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;paths&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;playwright-report/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;test-results/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; - &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;reports/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;reports&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;junit&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;reports/junit/results.xml&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;expire_in&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;30 days&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Next, we have the script, where we are going to list the contents of our test results directory. The &quot;-la&quot; will even list the hidden directories that might exist.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Even if one of the directories do not exist, we still want to carry on, which is why we are appending &quot;OR TRUE&quot; to the script.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, we add the reports and XML file to GitLab&#39;s servers.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;View The Results&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There you have it! Now, when you push changes, your code can be checked for quality, and you can make sure the tests all actually run.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Each code change, each merge request, generates a new pipeline. You can view it at&amp;nbsp;&lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/pipelines&quot; target=&quot;_blank&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright/-/pipelines&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEglkgM7x8AWb6cLwSRe5iIhizj--qywOLeEn1sYiQf6Re3vsSwzld_usWJajLcaKFKUCq_zvfEhyNYUwTagQOvwGxfhDK-8xy2-YQRLe3P3QUwE7mReUgXSac-uuY840sLNu5oi4I0h_p2LPa9wovJNgXWPHhgnPmzezszUHQvlrt1obaos0mO7Bgd5EBM&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;348&quot; data-original-width=&quot;800&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEglkgM7x8AWb6cLwSRe5iIhizj--qywOLeEn1sYiQf6Re3vsSwzld_usWJajLcaKFKUCq_zvfEhyNYUwTagQOvwGxfhDK-8xy2-YQRLe3P3QUwE7mReUgXSac-uuY840sLNu5oi4I0h_p2LPa9wovJNgXWPHhgnPmzezszUHQvlrt1obaos0mO7Bgd5EBM=w640-h278&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can also download the reports:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg98e_XIeF46NfD9ib86IsH1abi0_6vbvOjfIpkOfPs6r2BCnOLSv_l0WzQ4X2wzXFGBtQ8eERNWHsLu_hrow-7m0VQaPA2hYa3RrLJWTYTYFnli3KmJyA0-GFW6Zw6h33BEkRpJ37_zsT_8jmcDbVzgXmxtMD-w1n8l2K2P_7fQFV6ovozozyX3OXCxpQ&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;352&quot; data-original-width=&quot;340&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg98e_XIeF46NfD9ib86IsH1abi0_6vbvOjfIpkOfPs6r2BCnOLSv_l0WzQ4X2wzXFGBtQ8eERNWHsLu_hrow-7m0VQaPA2hYa3RrLJWTYTYFnli3KmJyA0-GFW6Zw6h33BEkRpJ37_zsT_8jmcDbVzgXmxtMD-w1n8l2K2P_7fQFV6ovozozyX3OXCxpQ=w387-h400&quot; width=&quot;387&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3 style=&quot;border-bottom: 0px rgb(10, 10, 10); margin: 24px 0px 12px; text-align: left;&quot;&gt;Test&amp;nbsp;Report Artifacts&lt;/h3&gt;&lt;div aria-level=&quot;3&quot; class=&quot;otQkpb&quot; data-animation-nesting=&quot;&quot; data-complete=&quot;true&quot; data-copy-service-computed-style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 20px; font-weight: 600; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);&quot; data-processed=&quot;true&quot; data-sae=&quot;&quot; data-sfc-cp=&quot;&quot; data-sfc-root=&quot;ep&quot; data-wiz-attrbind=&quot;aria-level=VHQTtb_2e/fLk2Md&quot; jsaction=&quot;&quot; jscontroller=&quot;a7qCn#ZxCkTb&quot; jsuid=&quot;VHQTtb_2e&quot; role=&quot;heading&quot; style=&quot;border-bottom: 0px rgb(10, 10, 10); margin: 24px 0px 12px;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;report:archive&lt;/b&gt;: Contains the full, human-readable HTML test reports (like Allure, if set up, or Playwright&#39;s native HTML report) compressed into a zip archive.&lt;/li&gt;&lt;li&gt;&lt;b&gt;report:junit&lt;/b&gt;: Contains a structured XML file in the JUnit format used by CI/CD platforms to parse, count, and display test success rates directly in the pipeline UI.&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Playwright Specific Artifacts&lt;/h3&gt;&lt;/div&gt;&lt;div aria-level=&quot;3&quot; class=&quot;otQkpb&quot; data-animation-nesting=&quot;&quot; data-complete=&quot;true&quot; data-copy-service-computed-style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 20px; font-weight: 600; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);&quot; data-processed=&quot;true&quot; data-sae=&quot;&quot; data-sfc-cp=&quot;&quot; data-sfc-root=&quot;ep&quot; data-wiz-attrbind=&quot;aria-level=VHQTtb_2e/fLk2Md&quot; jsaction=&quot;&quot; jscontroller=&quot;a7qCn#ZxCkTb&quot; jsuid=&quot;VHQTtb_2e&quot; role=&quot;heading&quot; style=&quot;border-bottom: 0px rgb(10, 10, 10); margin: 24px 0px 12px;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;playwright:archive&lt;/b&gt;: Stores heavy debugging assets generated during test failures, such as recorded videos, browser screenshots, and .zip trace files that you can load into the Playwright Trace Viewer.&lt;/li&gt;&lt;li&gt;&lt;b&gt;playwright:junit&lt;/b&gt;: Holds the specific JUnit-formatted XML results generated directly by the Playwright test runner (@playwright/test) during execution.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;You can also drill &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/pipelines/2783793814&quot; target=&quot;_blank&quot;&gt;down into the pipeline&lt;/a&gt; to see each stage&#39;s results.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhFLvogeDJQbYZRVmQapFa5X72wE4S6Of50e7O88tCAYsuxE9D0RDjxq-9a-0QoGsoPjY4CFThmRyW_3bCbv_jP1n02V5AaaxefGslpJe3zzJmOQGLfqP5iVfohn8Zdnbxxg0XdmiBf8ylgr77wE8ycS35QVapjoRhvLmOUkFNLzNl0lJ6yrB7DZaxv3fI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;278&quot; data-original-width=&quot;1067&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhFLvogeDJQbYZRVmQapFa5X72wE4S6Of50e7O88tCAYsuxE9D0RDjxq-9a-0QoGsoPjY4CFThmRyW_3bCbv_jP1n02V5AaaxefGslpJe3zzJmOQGLfqP5iVfohn8Zdnbxxg0XdmiBf8ylgr77wE8ycS35QVapjoRhvLmOUkFNLzNl0lJ6yrB7DZaxv3fI=w640-h166&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;With each stage, you can drill down to see the log files for that stage.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And, last of all, you can download an HTML version of the report, in the archive of artifacts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjovmULGcEwv16TfabVvXrB7fX8ZCUKy8icynGm_k7sfY8ldrX-3xrsklRo-HtRUbPhkJcfrkpVwFvAZtvKwDzvAGq0qX0NGg4rAUJbElwXsXEi-n658uHR5O8ZDcg47xXuxV5yWg2RscY1c4unpIkr0mxUTOag1qURNI3-gdg4JM-460AZizJXtv6br18&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;638&quot; data-original-width=&quot;986&quot; height=&quot;414&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjovmULGcEwv16TfabVvXrB7fX8ZCUKy8icynGm_k7sfY8ldrX-3xrsklRo-HtRUbPhkJcfrkpVwFvAZtvKwDzvAGq0qX0NGg4rAUJbElwXsXEi-n658uHR5O8ZDcg47xXuxV5yWg2RscY1c4unpIkr0mxUTOag1qURNI3-gdg4JM-460AZizJXtv6br18=w640-h414&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;That&#39;s how you set up a GitLab CI/ CD pipeline!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, we are going to look into manually kicking off a job, viewing a report on GitLab Pages.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;&lt;b&gt;Bun Create Playwright:&lt;/b&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Until then, Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/6355218177602804828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6355218177602804828'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6355218177602804828'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html' title='Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEglkgM7x8AWb6cLwSRe5iIhizj--qywOLeEn1sYiQf6Re3vsSwzld_usWJajLcaKFKUCq_zvfEhyNYUwTagQOvwGxfhDK-8xy2-YQRLe3P3QUwE7mReUgXSac-uuY840sLNu5oi4I0h_p2LPa9wovJNgXWPHhgnPmzezszUHQvlrt1obaos0mO7Bgd5EBM=s72-w640-h278-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-3398035820088482738</id><published>2026-08-19T22:13:32.812-04:00</published><updated>2026-08-24T22:34:06.775-04:00</updated><title type='text'>How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json</title><content type='html'>Earlier, we went over how we could create scripts in the package.json file of our Playwright framework to add &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot; target=&quot;_blank&quot;&gt;typechecking, linting&lt;/a&gt;, and &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;formatting your code with prettier&lt;/a&gt;.&amp;nbsp;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Want to see the entire &lt;b&gt;bun-create-playwright&lt;/b&gt; project? It is on &lt;a href=&quot;http://tinyurl.com/bun-create-playwright&quot; target=&quot;_blank&quot;&gt;tinyurl.com/bun-create-playwright&lt;/a&gt;!&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;With this post, we will explore how the built-in test runner for Playwright Test can run headed tests, debug versions of tests, and smoke tests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... and shortcuts for all of these can be set up in the scripts in your package.json! If you are using &quot;bun&quot; as a package manager, as we are in &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot; target=&quot;_blank&quot;&gt;bun-create-playwright&lt;/a&gt;, just type out &quot;bun run&quot;, a space and then the shortcut such as: &lt;b&gt;bun run test&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;package.json&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div style=&quot;line-height: 19px;&quot;&gt;&lt;div style=&quot;line-height: 19px;&quot;&gt;&lt;div style=&quot;line-height: 19px;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;scripts&quot;&lt;/span&gt;: {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:headed&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --headed&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:trace&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --trace on&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:chromium&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --project=chromium&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:firefox&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --project=firefox&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:webkit&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --project=webkit&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:smoke&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --project=chromium --grep &#39;@smoke&#39;&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:flaky&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --project=chromium --repeat-each=20&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:ui&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --ui&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:debug&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --debug&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:failed&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --last-failed&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:login&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test tests/login.spec.ts&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test:secure-area&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test tests/secure-area.spec.ts&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;report:list&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --reporter=list&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;report:line&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --reporter=line&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;report:dot&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --reporter=dot&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;report:blob&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test --reporter=blob&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;report&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright show-report&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;codegen&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright codegen&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint:ci&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint . --max-warnings 0&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint:fix&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint . --fix&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --write .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:check&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --check .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:debug&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --check . --log-level debug&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:diff&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --list-different&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;typecheck&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;tsc --noEmit&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; },&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/package.json?ref_type=heads&quot; target=&quot;_blank&quot;&gt;bun-create-playwright / package.json&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Do you need to really set up shortcuts like these? Certainly not! But it is easier than typing out: &lt;b&gt;bunx playwright test --project=chromium --grep &#39;@smoke&#39;.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Feel free to name these commands anything you want!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;You Can Run Scripts in Bunx? What is Bunx?&lt;/h2&gt;&lt;div&gt;When you install &lt;b&gt;Node.js&lt;/b&gt;, you are installing Node Package Execute (&lt;b&gt;npx&lt;/b&gt;) a package runner that lets you auto-install and execute any npm packages on the&amp;nbsp;fly. &quot;This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via npm run&quot; ( &lt;a href=&quot;https://docs.npmjs.com/cli/v8/commands/npx&quot; target=&quot;_blank&quot;&gt;NPMJS.com Docs / npx&lt;/a&gt; ).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Bunx&lt;/b&gt;&amp;nbsp;is part of &lt;a href=&quot;http://bun.sh&quot; target=&quot;_blank&quot;&gt;bun.sh&lt;/a&gt;, auto-installs and runs packages from npm... and claims to be 100x faster than npx for locally installed packages, like the Playwright test runner (&lt;a href=&quot;https://bun.com/docs/pm/bunx&quot; target=&quot;_blank&quot;&gt;bun.com Docs / bunx&lt;/a&gt; ).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have the package.json set up like above, &lt;b&gt;bun run test&lt;/b&gt; would do the same thing as &lt;b&gt;bunx playwright test&lt;/b&gt;... but with a lot less typing.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is a Package.json file?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Before Node.js had NPM as a package manager, there was &lt;b&gt;CommonJS&lt;/b&gt;&amp;nbsp;that tried to standardize how server-side JavaScript applications should interact with the operating system. Back in 2009, it gave JavaScript the ability to manage dependencies. It could require() outside packages to be installed. The CommonJS Packages 1.1 specification introduced a &quot;scripts&quot; block, an &quot;Object hash of scripts used in managing the package. A package manager tool may use these scripts to install, build, test or uninstall the package&quot;, as shown in the &lt;a href=&quot;https://wiki.commonjs.org/wiki/Packages/1.1&quot; target=&quot;_blank&quot;&gt;CommonJS Wiki / 1.1&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When Issac Schlueter created npm, he adopted CommonJS&#39;s package.json terminology, turning the scripts block into general task runners.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Read more&amp;nbsp;on &lt;a href=&quot;https://increment.com/development/interview-with-isaac-z-schlueter-ceo-of-npm/&quot; target=&quot;_blank&quot;&gt;Increment.com / Interview with Isaac Z. Schlueter, CEO of npm&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Because of that, with Package.json scripts, you can include a whole library of functionality!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Setting Up Scripts To Run and Debug Tests&lt;/h2&gt;&quot;With Playwright you can run a single test, a set of tests, or all tests. Tests can be run on one browser or multiple browsers using the --project flag. Tests run in parallel by default and in headless mode, meaning no browser window opens while running the tests and results appear in the terminal. You can run tests in headed mode using the --headed CLI argument, or run your tests in &lt;a href=&quot;https://playwright.dev/docs/test-ui-mode&quot;&gt;UI mode&lt;/a&gt; using the --ui flag to see a full trace of your tests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;[...] You can run your tests with the playwright test command. This runs your tests on all browsers as configured in the playwright.config file, and results appear in the terminal. Tests run in headless mode by default, meaning no browser window opens while running the tests&quot;. -&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/running-tests&quot; target=&quot;_blank&quot;&gt;https://playwright.dev/docs/running-tests&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Note that on &lt;a href=&quot;https://playwright.dev/docs/running-tests&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Running and debugging tests&lt;/a&gt; it assumes you are using node, and instructs you to use &quot;npx playwright test&quot;. If using bun as a package manager, use &quot;bunx playwright test&quot; to run tests from the command line interface.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Run Tests in UI Mode&lt;/h2&gt;&quot;We highly recommend running your tests with &lt;a href=&quot;https://playwright.dev/docs/test-ui-mode&quot;&gt;UI Mode&lt;/a&gt; for a better developer experience where you can easily walk through each step of the test and visually see what was happening before, during and after each step. UI mode also comes with many other features such as the locator picker, watch mode and more&quot;. - &lt;a href=&quot;https://playwright.dev/docs/running-tests&quot;&gt;Playwright.dev / Running and debugging tests&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;UI Mode lets you explore, run, and debug tests with a time travel experience complete with a watch mode. All test files are displayed in the testing sidebar, allowing you to expand each file and describe block to individually run, view, watch, and debug each test. Filter tests by name, &lt;a href=&quot;https://playwright.dev/docs/test-projects&quot;&gt;projects&lt;/a&gt; (set in your playwright.config file), @tag, or by the execution status of passed, failed, and skipped. See a full trace of your tests and hover back and forward over each action to see what was happening during each step. You can also pop out the DOM snapshot of a given moment into a separate window for a better debugging experience&quot;. - &lt;a href=&quot;https://playwright.dev/docs/test-ui-mode&quot; target=&quot;_blank&quot;&gt;Playwright.dev / UI Mode&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Review&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/test-ui-mode&quot; target=&quot;_blank&quot;&gt;Playwright.dev / UI Mode&lt;/a&gt;&amp;nbsp;to learn about running your tests, filtering tests. seeing the Timeline view at the top of the trace, the Actions tab in UI view, how to inspect the DOM, pick a locator, view the source, see the action called, the full log of the test, errors, the console logs, network tab, attachments if doing &lt;a href=&quot;https://playwright.dev/docs/test-snapshots&quot; target=&quot;_blank&quot;&gt;visual regression testing&lt;/a&gt;, and watch mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can even run UI Mode in the browser for Docker and GitHub Codespace environments with &quot;npx playwright test --ui-host=0.0.0.0&quot; to have the port forwarded automatically, or &quot;npx playwright test --ui-port=8080 --ui-host=0.0.0.0&quot; to set the port.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Run Tests in Headed Mode&lt;/h2&gt;&quot;To run your tests in headed mode, use the --headed flag. This gives you the ability to visually see how Playwright interacts with the website&quot;.&lt;/div&gt;&lt;div&gt;&lt;h3 class=&quot;anchor anchorTargetStickyNavbar_Vzrq&quot; id=&quot;run-tests-on-different-browsers&quot; style=&quot;--ifm-h3-font-size: 1.5rem; box-sizing: border-box; color: #1c1e21; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 24px; line-height: 1.25; margin: 30px 0px 20px; scroll-margin-top: 68px;&quot;&gt;Run tests on different browsers&lt;/h3&gt;&quot;To specify which browser you would like to run your tests on, use the --project flag followed by the browser name.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--project&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; webkit&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;To specify multiple browsers to run your tests on, use the --project flag multiple times followed by each browser name&quot;.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--project&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; webkit &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--project&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; firefox&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;anchor anchorTargetStickyNavbar_Vzrq&quot; id=&quot;run-specific-tests&quot; style=&quot;--ifm-h3-font-size: 1.5rem; box-sizing: border-box; color: #1c1e21; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 24px; line-height: 1.25; margin: 30px 0px 20px; scroll-margin-top: 68px;&quot;&gt;Run specific tests&lt;/h3&gt;&quot;To run a single test file, pass in the test file name that you want to run.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; landing-page.spec.ts&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;To run a set of test files from different directories, pass in the directory names that you want to run the tests in.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; tests/todo-page/ tests/landing-page/&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;To run files that have landing or login in the file name, simply pass in these keywords to the CLI.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; landing login&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;To run a test with a specific title, use the -g flag followed by the title of the test&quot;.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;-g&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #c6105f;&quot;&gt;&quot;add a todo item&quot;&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;anchor anchorTargetStickyNavbar_Vzrq&quot; id=&quot;run-last-failed-tests&quot; style=&quot;--ifm-h3-font-size: 1.5rem; box-sizing: border-box; color: #1c1e21; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 24px; line-height: 1.25; margin: 30px 0px 20px; scroll-margin-top: 68px;&quot;&gt;Run last failed tests&lt;/h3&gt;&quot;To run only the tests that failed in the last test run, first run your tests and then run them again with the --last-failed flag.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bunx playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; --last-failed&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;Playwright stores the list of failed tests from the previous run in &amp;lt;outputDir&amp;gt;/.last-run.json (see &lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot;&gt;testConfig.outputDir&lt;/a&gt;). To use a different file path, pass --last-failed-file=&amp;lt;path&amp;gt; or set PLAYWRIGHT_LAST_RUN_OUTPUT_FILE&quot;.&lt;h2 style=&quot;text-align: left;&quot;&gt;Debug tests with the Playwright Inspector&lt;/h2&gt;&quot;To debug all tests, run the Playwright test command followed by the --debug flag.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bun playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--debug&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&quot;This command opens a browser window as well as the Playwright Inspector. You can use the step over button at the top of the inspector to step through your test. Or, press the play button to run your test from start to finish. Once the test finishes, the browser window closes.&lt;br /&gt;&lt;br /&gt;&quot;To debug one test file, run the Playwright test command with the test file name that you want to debug followed by the --debug flag.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bun playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; example.spec.ts &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--debug&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;buttonGroup_M5ko&quot; style=&quot;box-sizing: border-box; column-gap: 0.2rem; display: flex; position: absolute; right: 8px; top: 8px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;clean-btn&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-color: rgb(218, 221, 225); border-radius: 6.4px; border-style: solid; border-width: 1px; color: #2e2e2c; cursor: pointer; display: flex; font-family: inherit; line-height: 0; opacity: 0; padding: 0.4rem; transition: opacity 0.2s ease-in-out;&quot; title=&quot;Copy&quot; type=&quot;button&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;copyButtonIcons_IEyt&quot; style=&quot;box-sizing: border-box; height: 1.125rem; position: relative; width: 1.125rem;&quot;&gt;&lt;svg class=&quot;copyButtonIcon_TrPX&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;copyButtonSuccessIcon_cVMy&quot; viewbox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;To debug a specific test from the line number where the test(.. is defined, add a colon followed by the line number at the end of the test file name, followed by the --debug flag&quot;.&lt;div class=&quot;language-bash codeBlockContainer_Ckt0 theme-code-block&quot; style=&quot;--prism-background-color: #f6f8fa; --prism-color: #2e2e2c; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(246, 248, 250); border-radius: 6.4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; box-sizing: border-box; color: #2e2e2c; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;codeBlockContent_QJqH&quot; style=&quot;border-radius: inherit; box-sizing: border-box; direction: ltr; position: relative;&quot;&gt;&lt;pre class=&quot;prism-code language-bash codeBlock_bY9V thin-scrollbar&quot; style=&quot;--ifm-pre-background: #f6f8fa; border-radius: 6.4px; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 15.2px; font-stretch: normal; font-style: normal; font-variant: normal; font-variation-settings: normal; line-height: 1.45; margin: 0px; overflow: auto; padding: 0px; scrollbar-width: thin;&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;codeBlockLines_e6Vv&quot; style=&quot;background-color: transparent; border-color: currentcolor; border-image: none; border-radius: 6.4px; border-style: none; border-width: medium; box-sizing: border-box; float: left; font: inherit; min-width: 100%; padding: 16px; vertical-align: middle;&quot;&gt;&lt;div class=&quot;token-line&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;bun playwright &lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot; style=&quot;box-sizing: border-box; color: #116329;&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;token plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; example.spec.ts:10 &lt;/span&gt;&lt;span class=&quot;token parameter variable&quot; style=&quot;box-sizing: border-box; color: #b74e05;&quot;&gt;--debug&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Read more at &lt;a href=&quot;https://playwright.dev/docs/debug&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Debugging Tests&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;&lt;b&gt;Bun Create Playwright:&lt;/b&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Happy Testing!&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/3398035820088482738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/3398035820088482738'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/3398035820088482738'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html' title='How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7009343743562552017</id><published>2026-08-16T18:04:38.139-04:00</published><updated>2026-08-24T22:34:29.259-04:00</updated><title type='text'>Implementing Page Objects in Playwright</title><content type='html'>&lt;div&gt;Picture a login screen, such as &lt;a href=&quot;https://the-internet.herokuapp.com/login&quot; target=&quot;_blank&quot;&gt;The-Internet / Login&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjdktRcEmjQSmhFeskjFOAzzFpAPjkfj00pfA87GhFl0-Ec95kc4fqhHAc-HJBfrBAZyzF6xVh9Hta_1fqQrX4hYNAA2eWTHyfsJoJit7LonMLT9Wnx5HzEUQEn8eVUjH--OOYW57Zu1S5bKYW4prvgRFgDMw-9SoKEGxesgcvgVtRy950efOCC7OipPCY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;383&quot; data-original-width=&quot;484&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjdktRcEmjQSmhFeskjFOAzzFpAPjkfj00pfA87GhFl0-Ec95kc4fqhHAc-HJBfrBAZyzF6xVh9Hta_1fqQrX4hYNAA2eWTHyfsJoJit7LonMLT9Wnx5HzEUQEn8eVUjH--OOYW57Zu1S5bKYW4prvgRFgDMw-9SoKEGxesgcvgVtRy950efOCC7OipPCY=w400-h317&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On this LoginPage, there is:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;a heading: Login Page&lt;/li&gt;&lt;li&gt;a user name textbox with the label, &quot;Username&quot;&lt;/li&gt;&lt;li&gt;a password textbox with the label, &quot;Password&quot;&lt;/li&gt;&lt;li&gt;a login button, with the role of a button, and the name of &quot;Login&quot;&lt;/li&gt;&lt;li&gt;a flash message that appears if you enter invalid credentials such as &quot;NotAUser&quot; and &quot;NotAPassword&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;If you successfully log in with &quot;tomsmith&quot; and &quot;SuperSecretPassword!, there is a SecureArea:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;a heading: &quot;Secure Area&quot;&lt;/li&gt;&lt;li&gt;a flash message &quot;You logged into a secure area!&quot;&lt;/li&gt;&lt;li&gt;a Logout button.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Sure, you could interact with each web element in your test... but what if the username text box locator changes? You would have to update multiple tests every time the element changed.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;... Instead, you could place it in a Page Object, something that &lt;a href=&quot;https://playwright.dev/docs/pom&quot;&gt;Playwright handles well&lt;/a&gt;! &lt;br /&gt;&lt;br /&gt;&quot;A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models.&lt;br /&gt;&lt;br /&gt;&quot;Page objects simplify authoring by creating a higher-level API which suits your application and simplify maintenance by capturing element selectors in one place and create reusable code to avoid repetition&quot;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Using Playwright&#39;s Built-In Test Runner? Or Something Else?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You may have noticed in &lt;a href=&quot;https://playwright.dev/docs/pom&quot;&gt;https://playwright.dev/docs/pom&lt;/a&gt; that there are two different styles of page objects. One for &quot;Test&quot;. One for &quot;Library&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Test&lt;/b&gt;: If you are writing actual Playwright test suites, and Playwright&#39;s built in test runner, use the Test section as a guide when creating page objects.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Library&lt;/b&gt;: If you are integrating Playwright into an existing test framework such as Jest or Cucumber and just want browser automation, instead of having pre-built page fixtures, etc, you can use this format.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;Setting Up Page Objects&lt;/h2&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
Let&#39;s review a page object I created for the main login page on my GitLab account for the bun-create-typescript project, &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/pages/LoginPage.ts&quot; target=&quot;_blank&quot;&gt;tests/pages/LoginPage.ts&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first thing we do is import the Locator method and Page fixture from the Playwright Test library.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;  
  
&lt;pre&gt;&lt;code&gt;import { type Locator, type Page } from &quot;@playwright/test&quot;;
&lt;/code&gt;&lt;/pre&gt;
According to &lt;a href=&quot;https://playwright.dev/docs/api/class-fixtures&quot;&gt;Playwright.dev / Class-Fixtures&lt;/a&gt;, &quot;Playwright Test is based on the concept of the &lt;a href=&quot;https://playwright.dev/docs/test-fixtures&quot;&gt;test fixtures&lt;/a&gt;. Test fixtures are used to establish environment for each test, giving the test everything it needs and nothing else.&lt;br /&gt;&lt;br /&gt;&quot;Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is available to the test, hooks, annotations and other fixtures as a first parameter [...]&lt;br /&gt;&lt;br /&gt;&quot;Playwright Test will set up the page fixture before running the test, and tear it down after the test has finished. page fixture provides a &lt;a href=&quot;https://playwright.dev/docs/api/class-page&quot;&gt;Page&lt;/a&gt; object that is available to the test&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Page and Locator Class&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to &lt;a href=&quot;https://playwright.dev/docs/api/class-page&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Page&lt;/a&gt;, &quot;Page provides methods to interact with a single tab in a &lt;a href=&quot;https://playwright.dev/docs/api/class-browser&quot;&gt;Browser&lt;/a&gt;, or an &lt;a href=&quot;https://developer.chrome.com/extensions/background_pages&quot;&gt;extension background page&lt;/a&gt; in Chromium. One &lt;a href=&quot;https://playwright.dev/docs/api/class-browser&quot;&gt;Browser&lt;/a&gt; instance might have multiple &lt;a href=&quot;https://playwright.dev/docs/api/class-page&quot;&gt;Page&lt;/a&gt; instances.&quot;. These pages are isolated from each other, created for each test. The page fixtures have their own setup and teardown methods, such as opening up a new browser before a test starts, and closing a browser when a test ends.&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;According to &lt;a href=&quot;https://playwright.dev/docs/locators&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Locators&lt;/a&gt;, &quot;&lt;a href=&quot;https://playwright.dev/docs/api/class-locator&quot;&gt;Locator&lt;/a&gt;s are the central piece of Playwright&#39;s auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment&quot;. The built-in Playwright locators are:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-role&quot;&gt;page.getByRole()&lt;/a&gt; to locate by explicit and implicit accessibility attributes.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-text&quot;&gt;page.getByText()&lt;/a&gt; to locate by text content.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-label&quot;&gt;page.getByLabel()&lt;/a&gt; to locate a form control by associated label&#39;s text.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-placeholder&quot;&gt;page.getByPlaceholder()&lt;/a&gt; to locate an input by placeholder.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-alt-text&quot;&gt;page.getByAltText()&lt;/a&gt; to locate an element, usually image, by its text alternative.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-title&quot;&gt;page.getByTitle()&lt;/a&gt; to locate an element by its title attribute.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/locators#locate-by-test-id&quot;&gt;page.getByTestId()&lt;/a&gt; to locate an element based on its data-testid attribute (other attributes can be configured).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Define the Page Object Class&lt;/h2&gt;&lt;div&gt;Now that we have imported the Page and Locator class from Playwright, we can define the LoginPage page object class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;export class LoginPage {
  readonly page: Page;
  readonly usernameInput: Locator;
  readonly passwordInput: Locator;
  readonly loginButton: Locator;
  readonly alertMessage: Locator;
  readonly heading: Locator;
&lt;/code&gt;&lt;/pre&gt;
Here, we are declaring LoginPage as a Page class, and creating Locator objects that will find and point to the username and password textboxes, the login button, the alertMessage, and the heading.&amp;nbsp;&lt;br /&gt;  
&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Initialize the Page Object Class&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that we have defined the page object, we can initialize a constructor for the page, setting up reusable locators for all the web elements we defined.&amp;nbsp;&lt;br /&gt;  
  
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt;  constructor(page: Page) {
    this.page = page;
    this.usernameInput = page.getByLabel(&quot;Username&quot;);
    this.passwordInput = page.getByLabel(&quot;Password&quot;);
    this.loginButton = page.getByRole(&quot;button&quot;, { name: &quot;Login&quot; });
    this.alertMessage = page.locator(&quot;#flash&quot;);
    this.heading = page.getByRole(&quot;heading&quot;, { name: &quot;Login Page&quot; });
  }&lt;/code&gt;&lt;/pre&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The textboxes are labeled &quot;Username&quot; and &quot;Password&quot;. If we know that these labels are not expected to change, we can use the labels as a locator strategy.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The login button, we can use as a locator strategy its role &quot;button&quot; and the name &quot;Login&quot;.&lt;/li&gt;&lt;li&gt;The alert message is tricky. Here, we can grab the id, &quot;#flash&quot;, in the locator.&lt;/li&gt;&lt;li&gt;The heading, we can also get by role of &quot;heading&quot;, and name of &quot;Login Page&quot;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Navigate to the Login Page&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s embed in this Login Page Object a way to navigate to the Login page.&amp;nbsp;&lt;/div&gt;  
  
&lt;pre&gt;&lt;code&gt;  async navigate(): {
    await this.page.goto(&quot;/login&quot;);
  }
&lt;/code&gt;&lt;/pre&gt;
  
Here, we have defined a method in the LoginPage page object our tests can use.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In our &lt;b&gt;playwright.config.ts&lt;/b&gt; (see &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/playwright.config.ts&quot; target=&quot;_blank&quot;&gt;code in GitLab&lt;/a&gt;) we have already declared our baseURL to be &lt;a href=&quot;https://the-internet.herokuapp.com&quot; target=&quot;_blank&quot;&gt;https://the-internet.herokuapp.com&lt;/a&gt;, which will display when a new browser window is opened when a new test starts.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When in our test we instantiate a new LoginPage method, and call the navigate method, it will goto &quot;login&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;async&lt;/b&gt; has been placed before the function definition, since the browser will not be happening instantly. Actions will be happening asynchronously, all at the same time. It returns a &quot;Promise&quot; object.&lt;/li&gt;&lt;li&gt;&lt;b&gt;await&lt;/b&gt; can be used inside an aync function. It tells the program to pause execution until the slow action, such as loading a webpage is finished.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;What is a Promise?&lt;/u&gt;&lt;/b&gt; &quot;A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action&#39;s eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future&quot;. - &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;Developer.Mozilla.com / JavaScript / Promise&lt;/i&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;What is Asynchronous Programming in JavaScript&lt;/u&gt;?&lt;/b&gt;&amp;nbsp;&quot;JavaScript, especially when running in a web browser environment, has a unique challenge. It&#39;s single-threaded, meaning it has one line of execution at a time. If any task (fetching data, responding to a button click, etc.) takes a long time, it would freeze the entire webpage!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;Asynchronous programming is the pattern to tackle this. It enables us to start a potentially long-running operation and tell JavaScript, &#39;Go about your business, I&#39;ll let you know when this is ready.&#39; This prevents the webpage from locking up. &lt;br /&gt;&lt;br /&gt;&quot;[...] JavaScript async await lets us write asynchronous code that resembles the style of straightforward, step-by-step (synchronous) code. This often makes the logic much easier to follow.-&amp;nbsp;&lt;a href=&quot;https://www.upgrad.com/tutorials/software-engineering/javascript-tutorial/javascript-async-await/&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;Upgrad.com / tutorials / JavaScript aync-await&lt;/i&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Creating a LoginAs Method&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sure, we could fill in the username, fill in the password, and click the login button, but what if that login procedure changes? We would have to hunt down every time we logged into the app, and make the changes in the test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a software design principle called &lt;b&gt;DRY: Don&#39;t Repeat Yourself&lt;/b&gt;, first coined by Andy Hunt and Dave Thomas in their book &quot;The Pragmatic Programmer: From Journeyman to Master (1999)&quot; (&lt;a href=&quot;https://en.wikipedia.org/wiki/The_Pragmatic_Programmer&quot; target=&quot;_blank&quot;&gt;See Wikipedia&lt;/a&gt;, and the interview with both authors &lt;a href=&quot;https://youtu.be/taCNjiiusRk?si=RltNuFmX8FuigiCj&quot; target=&quot;_blank&quot;&gt;on YouTube at GoTo Conference 2020&lt;/a&gt;).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Instead, we could create a new async method called &quot;loginAs&quot; where we pass in the username and password.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;pre&gt;&lt;code&gt;  async loginAs(username: string, password: string): {
    await this.usernameInput.fill(username);
    await this.passwordInput.fill(password);
    await this.loginButton.click();
  }
&lt;/code&gt;&lt;/pre&gt;  
  
Both &quot;fill&quot; and &quot;click&quot; are Playwright actions ( &lt;a href=&quot;https://playwright.dev/docs/input&quot; target=&quot;_blank&quot;&gt;See docs&lt;/a&gt; ).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Text input can use &lt;a href=&quot;https://playwright.dev/docs/api/class-locator#locator-fill&quot;&gt;locator.fill&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Checkboxes and radio buttons can .check them off, then expect them .toBeChecked.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Multiple radio buttons can be .selectOptions by value or label.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Mouse clicks can be performed with a mouse click, a double mouse click, a right click, a shift click, or a control click.&amp;nbsp;&lt;/li&gt;&lt;li&gt;You can press keys such as .press(&#39;Enter&#39;), or .press(&#39;Control+ArrowRight&#39;).&lt;/li&gt;&lt;li&gt;You can also press keys such as Backquote, Minus, Equal, Backslash, Backspace, Tab, Delete, Escape, ArrowDown, End, Enter, Home, Insert, PageDown, PageUp, ArrowRight, ArrowUp, F1 - F12, Digit0 - Digit9, KeyA - KeyZ, etc&lt;/li&gt;&lt;li&gt;You can .dragAndDrop, and explicitly .scrollIntoViewIfNeeded().&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;We have the locator, such as this.usernameInput, that we have declared, so now we can perform an action on the locator.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Get Text From Web Elements&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Need to get text from an element such as an alert message or a heading? Using a locator, you can retrieve the innerText property of the web element. According to &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText&quot; target=&quot;_blank&quot;&gt;Mozilla Org / HTMLElement / innerText&lt;/a&gt;, &quot;As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard&quot;.&lt;/div&gt;  
&lt;pre&gt;&lt;code&gt;  async getAlertMessage() {
    return (await this.alertMessage.innerText()).trim();
  }
&lt;/code&gt;&lt;/pre&gt;
Once we get the text of the web element, there may be hidden whitespaces in the text. &quot;The trim() method of &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String&quot;&gt;String&lt;/a&gt; values removes whitespace from both ends of this string and returns a new string, without modifying the original string&quot;. - &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim&quot; target=&quot;_blank&quot;&gt;Mozilla.Org / String / Trim&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  
&lt;pre&gt;&lt;code&gt;  async getHeading() {
    return (await this.heading.innerText()).trim();
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;After getting the text and trimming it, we return it to our test function.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We could have set up the page objects to expect the correct heading or alert message is correct, sending to the method what should be expected... but I try to avoid this whenever possible.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Personally, I prefer to keep the assertions, the things we are testing for, in the actual test and out of the page object.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Setting Up Test Data&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Yes, with just one set of valid credentials, separating them into a JSON file is overkill... but what if there were hundreds of valid test users? Here we are placing them into a JSON (JavaScript Notation) file called credentials with two top level objects... valid, and invalid.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In them, we have two key-value pairs in each object, username and password.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  

tests/ data/ credentials.json&lt;pre&gt;&lt;code&gt;{
  &quot;valid&quot;: {
    &quot;username&quot;: &quot;tomsmith&quot;,
    &quot;password&quot;: &quot;SuperSecretPassword!&quot;
  },
  &quot;invalid&quot;: {
    &quot;username&quot;: &quot;NotAUser&quot;,
    &quot;password&quot;: &quot;NotAPassword&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;  
  
Need to add or change usernames and passwords?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No need to hunt through test data. Change just what is in the credentials file, and everything else will be reset. ( &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/data/credentials.json?ref_type=heads&quot; target=&quot;_blank&quot;&gt;See this code in GitLab bun-create-playwright.&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Setting Up The Tests&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Tests are set up in the Arrange / Act / Assert fashion, the pattern first mentioned by software developer Bill Wake in 2001 regarding the Extreme Programming movement (See &lt;a href=&quot;https://xp123.com/3a-arrange-act-assert/&quot; target=&quot;_blank&quot;&gt;XP123 / 3a- Arrange, Act. Assert&lt;/a&gt; ).&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Arrange&lt;/b&gt;: Get the test data, open the browsers&lt;/li&gt;&lt;li&gt;&lt;b&gt;Act&lt;/b&gt;: Navigate to the page and login&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Assert&lt;/b&gt;: Do we have the proper heading (&quot;Secure Area&quot;), url, and alert message that we have logged into a secure area?&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Finally, it&#39;s time to write our first test suite! &lt;b&gt;Note:&lt;/b&gt; This code is in the &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/login.spec.ts?ref_type=heads&quot; target=&quot;_blank&quot;&gt;GitLab project bun-create-playwright, under tests/login.spec.ts&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;   
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt;import { test, expect } from &quot;@playwright/test&quot;;
import { LoginPage } from &quot;./pages/LoginPage&quot;;
import { SecurePage } from &quot;./pages/SecureAreaPage&quot;;
import credentials from &quot;./data/credentials.json&quot; with { type: &quot;json&quot; };
import messages from &quot;./data/messages.json&quot; with { type: &quot;json&quot; };&lt;/code&gt;&lt;/pre&gt;We are now importing files into our test and setting up variables to store the information such as:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The &quot;test&quot; and &quot;expect&quot; methods from Playwright.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/pages/LoginPage.ts?ref_type=heads&quot; target=&quot;_blank&quot;&gt;LoginPage&lt;/a&gt; and &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/pages/SecureAreaPage.ts?ref_type=heads&quot; target=&quot;_blank&quot;&gt;SecureAreaPage&lt;/a&gt; page objects we have set up.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/data/credentials.json?ref_type=heads&quot; target=&quot;_blank&quot;&gt;credentials&lt;/a&gt; stored in a JSON file that we have gone over.&lt;/li&gt;&lt;li&gt;A separate json file that stores all &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright/-/blob/main/tests/data/messages.json?ref_type=heads&quot; target=&quot;_blank&quot;&gt;messages&lt;/a&gt; such&amp;nbsp;as &quot;You logged into a secure area!&quot;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Set Up Constants for the Test Suite&lt;/h2&gt; 
&lt;pre&gt;&lt;code&gt;test.describe(&quot;Login&quot;, () =&amp;gt; {
  const validUser = credentials.valid.username;
  const validPassword = credentials.valid.password;
  const invalidUser = credentials.invalid.username;
  const invalidPassword = credentials.invalid.password;
&lt;/code&gt;&lt;/pre&gt;
Here, we are setting up a describe block, one of the &lt;a href=&quot;https://playwright.dev/docs/api/class-test#test-describe&quot; target=&quot;_blank&quot;&gt;methods in Playwright Test&lt;/a&gt;, declaring a group of tests, giving the test the title of &quot;Login&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then, to make the test more readable, instead of passing a three part credentials call, I am storing them in appropriately named variables.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These variables, validUser, validPassword, etc, we are declaring as type &quot;const&quot;, also known as constants. If we accidentally change these values when the test is running, an error will be thrown. (Read more at &lt;a href=&quot;https://playwright.dev/docs/api/class-test#test-describe&quot; target=&quot;_blank&quot;&gt;TypeScript.org / Handbook / Variable Declarations&lt;/a&gt; ).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These constants, since they are set up in the describe block, will be set for ALL of the tests in this test suite.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Set Up the Individual Test&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s set up a test that we can actually log in, and get to the secure area page, and call it &quot;successful login with valid credentials&quot;.&lt;/div&gt;&lt;div&gt;   
  
&lt;pre&gt;&lt;code&gt;  test(&quot;successful login with valid credentials&quot;, {
    tag: &quot;@smoke&quot;,
  }, async ({ page }) =&amp;gt; {
    const loginPage = new LoginPage(page);
    const securePage = new SecurePage(page);

    await loginPage.navigate();
    await loginPage.loginAs(validUser, validPassword);
&lt;/code&gt;&lt;/pre&gt;  
  
  
  We instantiate a new instance of the LoginPage, calling it a constant &quot;loginPage&quot;, and do the same for the Secure Area.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that we declared new LoginPage, we can use the methods we have set up in our page objects, such as loginPage.navigate, and loginPage.loginAs, where we feed in the validUser and validPassword.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;How to Assert Our Test is Working&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We have done the arranging. We have done the acting. Now, it is time for the assertions.&lt;/div&gt;&lt;a href=&quot;https://playwright.dev/docs/test-assertions&quot;&gt;Playwright.dev / Assertions&lt;/a&gt; mention, &quot;Playwright includes test assertions in the form of expect function. To make an assertion, call expect(value) and choose a matcher that reflects the expectation. There are many &lt;a href=&quot;https://playwright.dev/docs/api/class-genericassertions&quot;&gt;generic matchers&lt;/a&gt; like toEqual, toContain, toBeTruthy that can be used to assert any conditions.&lt;br /&gt;&lt;br /&gt;&quot;Playwright also includes web-specific &lt;a href=&quot;https://playwright.dev/docs/api/class-locatorassertions&quot;&gt;async matchers&lt;/a&gt; that will wait until the expected condition is met. &lt;br /&gt;&lt;br /&gt;&quot;By default, the timeout for assertions is set to 5 seconds. Learn more about &lt;a href=&quot;https://playwright.dev/docs/test-timeouts&quot;&gt;various timeouts&lt;/a&gt;&quot;.&lt;br /&gt;&lt;br /&gt;You can assert that an element is attached, a checkbox is checked, an element is disabled, editable, am element is empty, enabled, focused, visible, contains text or has an exact piece of text, contains a CSS class, has an accessible description or name.&lt;br /&gt;&lt;br /&gt;You can also check if it has a specific &lt;a href=&quot;https://www.w3.org/TR/wai-aria-1.2/#roles&quot;&gt;ARIA role&lt;/a&gt; or matches an Aria snapshot, has a certain amount of child elements, has a certain id, css, an option selected, a value. &lt;br /&gt;&lt;br /&gt;With pages, you can expect it to have a certain screenshot (for visual testing), has a title, url, or an OK status.&lt;br /&gt;&lt;br /&gt;All of these elements will be retried if they fail the first time. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also have some test conditions where you do not auto retry, such as expecting a value to be something, close to something, the value is &lt;b&gt;falsy &lt;/b&gt;(false, 0, or null). You can expect the value to be greaterThan, greater than or equal, less than a certain value. You can expect it to be NaN (not a number), null, or &lt;b&gt;truthy&lt;/b&gt; (not false, not 0, and not null).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
    
    
&lt;pre&gt;&lt;code&gt;await expect(page).toHaveURL(/\/secure/);
    expect(await securePage.getHeading()).toBe(&quot;Secure Area&quot;);
    expect(await securePage.getAlertMessage()).toContain(messages.loginSuccessMessage);
  });
&lt;/code&gt;&lt;/pre&gt;
    Now, we are checking that:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;the heading we get from the SecurePage page object has the exact value &quot;Secure Area&quot;.&lt;/li&gt;&lt;li&gt;the alert message matches the messages we have in the messages file...&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;And that&#39;s how you set up Page Objects and Tests using Playwright!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the future, we will go over how to set up CI / CD pipelines with GitLab, but I need a break!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;





&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whew! That was a lot!&lt;div&gt;&lt;br /&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7009343743562552017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7009343743562552017'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7009343743562552017'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html' title='Implementing Page Objects in Playwright'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjdktRcEmjQSmhFeskjFOAzzFpAPjkfj00pfA87GhFl0-Ec95kc4fqhHAc-HJBfrBAZyzF6xVh9Hta_1fqQrX4hYNAA2eWTHyfsJoJit7LonMLT9Wnx5HzEUQEn8eVUjH--OOYW57Zu1S5bKYW4prvgRFgDMw-9SoKEGxesgcvgVtRy950efOCC7OipPCY=s72-w400-h317-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-6127157635073190509</id><published>2026-08-14T22:30:20.303-04:00</published><updated>2026-08-24T22:34:45.668-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>How Playwright Frameworks get configured with playwright.config.ts</title><content type='html'>

When we &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot; target=&quot;_blank&quot;&gt;installed bun&lt;/a&gt;, a new package manager owned by Anthropic, then ran &quot;&lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot; target=&quot;_blank&quot;&gt;bun create playwright&lt;/a&gt;&quot;, a new automation framework was stood up, along with sample tests, and a Playwright configuration file. In this post, we will be examining the file generated: &lt;b&gt;playwright.config.ts&lt;/b&gt;.&amp;nbsp;&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Personally, I find the pre-generated file very hard to scan... there are so many options and documentation in the comments, it is difficult for me to focus on the code. Let&#39;s examine just the code generated below. If you need to see the whole file, you can see it here:&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot; target=&quot;_blank&quot;&gt;https://playwright.dev/docs/test-configuration&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Configuration&lt;/a&gt; mentions, &quot;Playwright has many options to configure how your tests are run. You can specify these options in the configuration file&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is Configured By Default?&amp;nbsp;&lt;/h2&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt;
import { defineConfig, devices } from &#39;@playwright/test&#39;;

export default defineConfig({
  testDir: &#39;./tests&#39;,
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  reporter: &#39;html&#39;,
 
    // baseURL: &#39;http://localhost:3000&#39;,

    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
    trace: &#39;on-first-retry&#39;,
  },

  /* Configure projects for major browsers */
  projects: [
    {
      name: &#39;chromium&#39;,
      use: { ...devices[&#39;Desktop Chrome&#39;] },
    },

    {
      name: &#39;firefox&#39;,
      use: { ...devices[&#39;Desktop Firefox&#39;] },
    },

    {
      name: &#39;webkit&#39;,
      use: { ...devices[&#39;Desktop Safari&#39;] },
    },
});&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I know what you are thinking ...&amp;nbsp; What the heck is process.env.CI ? 2 : 0?&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;This is know as a ternary operator. It is a shorthand for: &quot;If A then B, else C&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;You can run tests two ways: Locally, on your local machine, or through a CI / CD Pipeline like Jenkins, GitHub Actions, or GitLab.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you are running tests on CI / CD, the process.env.CI would automatically get set. Since A is true, the value of retries would be &quot;2&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you are running tests locally, the process.env.CI&amp;nbsp;would NOT get set. Since A is false, the value &quot;0&quot; would be selected.&amp;nbsp;&lt;/li&gt;&lt;li&gt;CI / CD pipelines would get two retries. Locally, it would get no retries and a failed test would remain failed.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Now that that is cleared up, let&#39;s examine the properties:&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;testDir: Points to the home of the tests.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-testconfig#test-config-fully-parallel&quot; target=&quot;_blank&quot;&gt;fullyParallel&lt;/a&gt;: Allows you to set the tests to run all at once across many workers, or by one worker, tests lined up single file. By default, all tests are run all at once with multiple workers.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-testconfig#test-config-forbid-only&quot; target=&quot;_blank&quot;&gt;forbidOnly&lt;/a&gt;:&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Developers debugging a test, will mark that test they are working on &quot;test.only()&quot;. It&#39;s okay to have &quot;test.only()&quot; locally, but you want it to complain, loudly, if you have any test still marked &quot;test.only()&quot; in a CI/CD pipeline.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you are running the test locally, the test run wouldn&#39;t pick up a process.env.CI. The CI/ CD variable would not be set, which means that the variable would be &quot;undefined&quot; which would resolves to false. forbidOnly would be false. No alert would be thrown if an &quot;only&quot; was seen, which is exactly what you wanted.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you were running this in a CI/CD pipeline, you do not want test.only() to appear. Since process.env.CI would fill in a string, or set it to true, this equation would evaluate to &quot;forbidOnly=true&quot;. An alert would be thrown if a test running in the CI/ CD pipeline saw an &quot;only&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-testconfig#test-config-retries&quot; target=&quot;_blank&quot;&gt;retries&lt;/a&gt;: Tests can be fragile when running on a CI/ CD platform. If it is CI/ CD, the process.env.CI would be set, by default retrying a failed test twice. If it is not set, because the test is running locally, we have the second default, which is &quot;0&quot;, meaning failing tests would not be rerun.&amp;nbsp;&lt;/li&gt;&lt;li&gt;workers: How many workers would you like to execute tests for you?&lt;/li&gt;&lt;ul&gt;&lt;li&gt;By default, if you are on a CI / CD pipeline running a test it will run two workers to execute a test. Playwright recommends setting the workers to &quot;1&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Running a test locally? &quot;Undefined&quot; means that Playwright will detect your machines hardware and boot up a number of workers equal to half your logical CPU cores without freezing your operating system.&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Note: GitHub Actions free tier give you virtual machines with limited resources. If you have just one worker tests will run one after another making logs and failures easier to trace.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Read Playwright.dev docs about &lt;a href=&quot;https://playwright.dev/docs/test-parallel&quot; target=&quot;_blank&quot;&gt;running jobs in parallel&lt;/a&gt;, and &lt;a href=&quot;https://playwright.dev/docs/test-parallel#shard-tests-between-multiple-machines&quot; target=&quot;_blank&quot;&gt;dividing tests into shards&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;reporter: How would you like your output? Basic &quot;html&quot;, with a standalone webpage? A &quot;list&quot; printing a detailed line per test showing pass or fail? A &quot;line&quot; displaying execution progress on a single terminal line? A &quot;dot&quot; report where passed tests are dots and failures are &quot;F&quot;? A &quot;json&quot; report? An xml &quot;junit&quot; style? A &quot;blob&quot; of a binary file that can be later merged from multiple machines? Or &quot;github&quot; which creates annotations in GitHub Actions? &lt;a href=&quot;https://playwright.dev/docs/api/class-reporter&quot; target=&quot;_blank&quot;&gt;See Playuwright.dev / Reporter&lt;/a&gt;, and a &lt;a href=&quot;https://app.thetestingacademy.com/blog/playwright-reporters-guide&quot; target=&quot;_blank&quot;&gt;list of reporters on The Testing Academy&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;By default, it has set up to run the Playwright version of Chrome, Firefox, and WebKit Safari.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;But What About Dot Env?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you looked in the pre-generated configuration file, there is code that looks like:&amp;nbsp;&lt;/div&gt;&lt;i&gt;&lt;blockquote&gt; * Read environment variables from file.&lt;br /&gt; * &lt;a href=&quot;https://github.com/motdotla/dotenv&quot;&gt;https://github.com/motdotla/dotenv&lt;/a&gt;&lt;br /&gt; */&lt;br /&gt;// import dotenv from &#39;dotenv&#39;;&lt;br /&gt;// import path from &#39;path&#39;;&lt;br /&gt;// dotenv.config({ path: path.resolve(__dirname, &#39;.env&#39;) });&lt;/blockquote&gt;&lt;/i&gt;Dotenv reads custom variables from a plain text file, injecting them into a Node.js application.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sometimes, settings change depending where your code is running, such as on your local machine vs a production environment.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is a good practice to set up one .env file per environment. .env for your local. .env.production. .env.staging, etc.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are things such as database passwords, third party API keys, server port numbers.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With Dotenv you can create an .env file in the root folder of your project, and write configurations like:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;PORT=3000&lt;/li&gt;&lt;li&gt;DATABASE_URL=mongodb://localhost:27817/myapp&lt;/li&gt;&lt;li&gt;STRIPE_API_KEY=&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Make sure to add the .env file into .gitignore else you might accidently push these secrets into GitLab! ... Or you can encrypt it using&amp;nbsp;&lt;a href=&quot;https://github.com/dotenvx/dotenvx&quot;&gt;https://github.com/dotenvx/dotenvx&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What about the Mobile Viewports and Branded Browsers?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You also may have seen in the boilerplate playwright.config.ts file:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;/* Test against mobile viewports. */&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // {&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // name: &#39;Mobile Chrome&#39;,&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // use: { ...devices[&#39;Pixel 5&#39;] },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // {&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // name: &#39;Mobile Safari&#39;,&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // use: { ...devices[&#39;iPhone 12&#39;] },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // },&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt; /* Test against branded browsers. */&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // {&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // name: &#39;Microsoft Edge&#39;,&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // use: { ...devices[&#39;Desktop Edge&#39;], channel: &#39;msedge&#39; },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // {&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // name: &#39;Google Chrome&#39;,&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // use: { ...devices[&#39;Desktop Chrome&#39;], channel: &#39;chrome&#39; },&lt;/i&gt;&lt;br /&gt;&lt;i&gt; // },&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If you want Playwright to simulate how your website looks and behaves on mobile devices, you can comment out the mobile viewport section. Mobile Chrome simulates a Google Pixel 5 using Chromium, and Mobile Safari simulates an iPhone 12 using Apple&#39;s WebKit engine. ( See the ThinkSys article, &lt;a href=&quot;https://thinksys.com/qa-testing/cross-browser-testing-with-playwright/&quot; target=&quot;_blank&quot;&gt;Cross Browser Testing with Playwright in 2026&lt;/a&gt; )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sometimes, emulations are not enough, and you want to actually test on Microsoft Edge or Google Chrome. With this setup, you can launch the actual browsers.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... The next post, we will dive into setting up actual test and page objects.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;  
  
  
  &lt;div&gt;

Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/6127157635073190509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6127157635073190509'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6127157635073190509'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html' title='How Playwright Frameworks get configured with playwright.config.ts'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7425144707289986013</id><published>2026-08-10T23:00:47.444-04:00</published><updated>2026-08-24T22:35:03.139-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>Running Tests with Playwright Test Explorer and Generating Tests with Codegen</title><content type='html'>&lt;div&gt;Finding the best locator for a web element can be a hassle:&lt;div&gt;&lt;ul&gt;&lt;li&gt;Right clicking on an element in Google Chrome. Inspecting the element. Going to Chrome Developer Tools. Try to decide what to do if there isn&#39;t a clear test id.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Playwright comes with a built in code generator where it can built out a rough draft of a test while you interact with a website. &quot;Playwright will look at your page and figure out the best locator, prioritizing &lt;a href=&quot;https://playwright.dev/docs/locators&quot;&gt;role, text and test id locators&lt;/a&gt;. If the generator finds multiple elements matching the locator, it will improve the locator to make it resilient that uniquely identify the target element&quot;, according to &lt;a href=&quot;https://playwright.dev/docs/codegen&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Test Generator&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Do you have the Integrated Development Environment (IDE) by Microsoft, &lt;a href=&quot;https://code.visualstudio.com/&quot; target=&quot;_blank&quot;&gt;VS Code&lt;/a&gt;? You can get it at the &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright&quot; target=&quot;_blank&quot;&gt;Visual Studio Marketplace&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Playwright Test Explorer&lt;/h2&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Playwright.dev / Getting Started VS Code&lt;/b&gt;: &lt;a href=&quot;https://playwright.dev/docs/getting-started-vscode&quot;&gt;https://playwright.dev/docs/getting-started-vscode&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After installation, you will see a beaker icon in your VS Code left navigation menu. Selecting that, you can see your tests, such as the default ones Playwright automatically adds when it is installed:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjm_Izy-A2MB_fbX_u9LPpBk9k5u0g6gwX5VJmrtuaDegWr_xVntdK_4eYDDBf16l_Or-DshGekqLPiw4c3_z-9ZrDq56gNzgGHZu4GiZBMhGgfNPQIMuHJhdV57wJYxS_Oh5hEvONtj67iA3VcCVdVep85cmnvkNQusWtDA3e_yh0gAJ8rphdJthArWZ0&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;257&quot; data-original-width=&quot;428&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjm_Izy-A2MB_fbX_u9LPpBk9k5u0g6gwX5VJmrtuaDegWr_xVntdK_4eYDDBf16l_Or-DshGekqLPiw4c3_z-9ZrDq56gNzgGHZu4GiZBMhGgfNPQIMuHJhdV57wJYxS_Oh5hEvONtj67iA3VcCVdVep85cmnvkNQusWtDA3e_yh0gAJ8rphdJthArWZ0=w400-h240&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Here you can see that Test Explorer has discovered the test suite &lt;b&gt;example.spec.ts&lt;/b&gt;, along with two tests it created:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;has title&lt;/b&gt;: Verifies that if you go to &lt;a href=&quot;http://playwright.dev&quot;&gt;playwright.dev&lt;/a&gt;, that it has a link titled &quot;Get Started&quot;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;get started link&lt;/b&gt;: Verifies at playwright.dev that after clicking on Get Started link, the heading says &quot;Installation&quot;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;Selecting the green arrow button will open up three browser windows: Chromium, Firefox, and a WebKit browser created by Playwright, mimicking Safari. It will run a total of six tests.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But wait! There&#39;s more! You can:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Run a single test.&lt;/li&gt;&lt;li&gt;Run all tests at different levels.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Run on multiple browsers.&lt;/li&gt;&lt;li&gt;Show a browser.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;You can also debug your tests:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Set breakpoints by clicking on the gutter next to a line number&lt;/li&gt;&lt;li&gt;Right clicking the test and select &quot;Debug test&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Running your test will pause at your breakpoint, allowing you to step through your code.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;You can also:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Fix a test with AI.&lt;/li&gt;&lt;li&gt;Debug tests with Trace Viewer&lt;/li&gt;&lt;li&gt;View DOM inspection, reviewing the Document Object Model snapshots.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;Debugging Playwright tests in VS Code&lt;/u&gt;&lt;/b&gt;&lt;div&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; src=&quot;https://www.youtube.com/embed/tJF7UhA59Gc?si=7Strzjd-UOCmJeta&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=tJF7UhA59Gc&quot;&gt;https://www.youtube.com/watch?v=tJF7UhA59Gc&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Generating Tests with CodeGen&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&quot;CodeGen is Playwright&#39;s powerful test generation tool that automatically creates test code by recording your interactions with a web page. Instead of writing tests from scratch, you can simply navigate through your application while CodeGen captures your actions and converts them into reliable test code with proper locators and assertions&quot;. - &lt;a href=&quot;https://playwright.dev/docs/getting-started-vscode&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;Playwright.Dev / Getting Started VS Code&lt;/i&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;How to Generate Tests in Playwright with the VS Code Extension&lt;/u&gt;&lt;/b&gt;&lt;div&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; src=&quot;https://www.youtube.com/embed/5XIZPqKkdBA?si=EabcjO5xk8DDUYFM&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=5XIZPqKkdBA&quot;&gt;&lt;i&gt;https://www.youtube.com/watch?v=5XIZPqKkdBA&lt;/i&gt;&lt;/a&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Testing The-Internet: Login Page&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Per the instructions, I will start sketching out tests for a Login page application: &lt;a href=&quot;https://the-internet.herokuapp.com/login&quot;&gt;https://the-internet.herokuapp.com/login&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0N__vHU97R2_ZKwu0a9rgMvEMdXkubXtSEFvVVn2pSeGzgJa1JSUUIGWaCmz-w6xgQ0w2T1Z3d9BmQnrx9Dd4uOjq30mJGJZVFpUwTntlx4U280RKUuKwEFOgjnX0-avGU8TbptvqcAc2EGhFsPZ_BIRkJfoNcwpIt9FyiE8V1wn2Rz6HBYunr_wzBWQ&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;405&quot; data-original-width=&quot;737&quot; height=&quot;352&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0N__vHU97R2_ZKwu0a9rgMvEMdXkubXtSEFvVVn2pSeGzgJa1JSUUIGWaCmz-w6xgQ0w2T1Z3d9BmQnrx9Dd4uOjq30mJGJZVFpUwTntlx4U280RKUuKwEFOgjnX0-avGU8TbptvqcAc2EGhFsPZ_BIRkJfoNcwpIt9FyiE8V1wn2Rz6HBYunr_wzBWQ=w640-h352&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;i&gt;&lt;a href=&quot;https://the-internet.herokuapp.com/login&quot;&gt;https://the-internet.herokuapp.com/login&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Test #1: Is Everything Visible?&amp;nbsp;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Playwright / Tools, click on &quot;(+) Record new&quot;, opens up a blank peach colored window.&lt;/li&gt;&lt;li&gt;The red RECORD icon shows that it is recording.&amp;nbsp;&lt;/li&gt;&lt;li&gt;In the browser window, entered the URL:&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://the-internet.herokuapp.com/login&quot;&gt;https://the-internet.herokuapp.com/login&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Generate code to detect a Heading:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;In the menu, I selected the &quot;eye&quot; to assert visibility, and the heading, &quot;Login Page&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Generate code to detect an error message.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Assert visibility of username + password textbox: &quot;eye&quot; + click on username textbox. &quot;eye&quot; + click on password textbox. &quot;eye&quot; + click on Login button.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The code it generated. after some cleanup such as naming it &quot;Checking visibility:&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Checking visibility&#39;&lt;/span&gt;, &lt;span style=&quot;color: #569cd6;&quot;&gt;async&lt;/span&gt; ({ &lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt; }) &lt;span style=&quot;color: #ff7b72;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;https://the-internet.herokuapp.com/login&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Login Page&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Login Page&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Username&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Password&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39; Login&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;);&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;... Not bad! I&#39;d rather use some ids than &quot;getByRole&quot;, but not bad!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Test #2: Negative Test: Invalid User.&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Playwright / Tools, click on &quot;(+) Record new&quot;, opens up a blank peach colored window.&lt;/li&gt;&lt;li&gt;The red RECORD icon shows that it is recording.&amp;nbsp;&lt;/li&gt;&lt;li&gt;In the browser window, entered the URL:&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://the-internet.herokuapp.com/login&quot;&gt;https://the-internet.herokuapp.com/login&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Generate code to enter incorrect username and password:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&quot;Eye&quot; + Login Page to check the heading is there.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Enter &quot;NotAUser&quot; into the username textbox.&lt;/li&gt;&lt;li&gt;Enter &quot;NotAPassword&quot; into the password textbox.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Check the alert message:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Let&#39;s see what happens if we click &quot;Assert Visibility&quot; and the alert message &quot;Your username is invalid&quot;. Or &quot;Assert text&quot; and the error message.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Invalid login&#39;&lt;/span&gt;, &lt;span style=&quot;color: #569cd6;&quot;&gt;async&lt;/span&gt; ({ &lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt; }) &lt;span style=&quot;color: #ff7b72;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;https://the-internet.herokuapp.com/login&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Login Page&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Login Page&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Username&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;fill&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;NotAUser&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Password&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;fill&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;NotAPassword&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39; Login&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Your username is invalid! ×&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;locator&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;#flash&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toContainText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Your username is invalid! ×&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;);&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;... Again, it could use some reformatting, but not bad.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Okay, one more test: Let&#39;s log in correctly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Test #3: Smoke Test: Valid Login&lt;/h2&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Playwright / Tools, click on &quot;(+) Record new&quot;, opens up a blank peach colored window.&lt;/li&gt;&lt;li&gt;The red RECORD icon shows that it is recording.&amp;nbsp;&lt;/li&gt;&lt;li&gt;In the browser window, entered the URL:&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://the-internet.herokuapp.com/login&quot;&gt;https://the-internet.herokuapp.com/login&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Generate code to do a successful login:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&quot;Eye&quot; + Login Page to check the heading is there.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Enter &quot;tomsmith&quot; into username, &quot;SuperSecretPassword!&quot; in password, and click on &quot;Login&quot;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Validate that you are in the secure area:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&quot;Eye&quot; + &quot;Assert Visibility&quot; on title &quot;Login Page&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Let&#39;s see what happens if you assert text, &quot;Login Page&quot;, and then assert &quot;Welcome to the Secure Area&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;Eye&quot; + &quot;Assert Visibility&quot; Logout button.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Successful Login&#39;&lt;/span&gt;, &lt;span style=&quot;color: #569cd6;&quot;&gt;async&lt;/span&gt; ({ &lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt; }) &lt;span style=&quot;color: #ff7b72;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;https://the-internet.herokuapp.com/login&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Username&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;fill&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;tomsmith&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;textbox&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Password&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;fill&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;SuperSecretPassword!&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;     { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Secure Area&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;exact&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;locator&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;h2&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toContainText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Secure Area&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;locator&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;h4&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toContainText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Welcome to the Secure Area. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;       When you are done click logout below.&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;link&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Logout&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;);&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We now have enough to create some tests!&amp;nbsp;&lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;  


&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7425144707289986013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7425144707289986013'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7425144707289986013'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html' title='Running Tests with Playwright Test Explorer and Generating Tests with Codegen'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjm_Izy-A2MB_fbX_u9LPpBk9k5u0g6gwX5VJmrtuaDegWr_xVntdK_4eYDDBf16l_Or-DshGekqLPiw4c3_z-9ZrDq56gNzgGHZu4GiZBMhGgfNPQIMuHJhdV57wJYxS_Oh5hEvONtj67iA3VcCVdVep85cmnvkNQusWtDA3e_yh0gAJ8rphdJthArWZ0=s72-w400-h240-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-2562652151569271850</id><published>2026-08-10T19:23:45.625-04:00</published><updated>2026-08-24T22:35:21.450-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>Checking code with lint, formatting it with prettier</title><content type='html'>&lt;div&gt;Now that we&#39;ve &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot; target=&quot;_blank&quot;&gt;installed bun&lt;/a&gt;, Anthropic&#39;s package manager, s&lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot; target=&quot;_blank&quot;&gt;caffolded a Playwright framework and closely examined the results&lt;/a&gt;, and &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot; target=&quot;_blank&quot;&gt;added typechecking with TypeScript&#39;s compiler&lt;/a&gt;, it&#39;s time to add ways to check the code with &lt;b&gt;lint&lt;/b&gt;, and reformat the code with&amp;nbsp;&lt;b&gt;prettier&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We will be using:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;ESLint&lt;/b&gt;, as the static-analysis tool to review the code without running it. Little bits of fluff -- like syntax errors, structural bugs, anti-patterns, and code style violations -- can collect on your code, so it helps to run a linter to help catch it all, such as &lt;a href=&quot;https://eslint.org/&quot; target=&quot;_blank&quot;&gt;ESLint&lt;/a&gt;. There is also a linter,&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/eslint-plugin-playwright&quot; target=&quot;_blank&quot;&gt;eslint-plugin-playwright&lt;/a&gt;, for Playwright tests.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Prettier &lt;/b&gt;enforces a consistent code style across your entire codebase. Because ESLint and Prettier can conflict, we will be using Prettier&#39;s&amp;nbsp;&lt;a href=&quot;https://github.com/prettier/eslint-config-prettier&quot; target=&quot;_blank&quot;&gt;eslint-config-prettier&lt;/a&gt;, which turns off all rules that are unnecessary or might conflict with ESLint.&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is a Linter?&amp;nbsp;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;According to the &lt;a href=&quot;https://www.wikiwand.com/en/Lint_%28software%29&quot; target=&quot;_blank&quot;&gt;Wikiwand entry for Lint&lt;/a&gt;, &quot;Stephen C. Johnson, a computer scientist at Bell Labs, came up with the term &#39;lint&#39; in 1978 while debugging the &lt;i&gt;yacc&lt;/i&gt; grammar he was writing for C and dealing with portability issues stemming from porting Unix to a 32-bit machine. The term was borrowed from lint, the tiny bits of fiber and fluff shed by clothing, as the command he wrote would act like a lint trap in a clothes dryer, capturing waste fibers while leaving whole fabrics intact. The lint program was released outside of Bell Labs in Unix V7, in 1979.&lt;br /&gt;&lt;br /&gt;&quot;In his 1978 paper, Johnson explained his reasons for creating a new program to detect errors: &#39;...the general notion of having two programs is a good one&#39; because they concentrate on different things, thereby allowing the programmer to &#39;concentrate at one stage of the programming process solely on the algorithms, data structures, and correctness of the program, and then later retrofit, with the aid of lint, the desirable properties of universality and portability&#39; &quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is ESLint?&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Website:&amp;nbsp;&lt;a href=&quot;https://eslint.org/&quot;&gt;https://eslint.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;GitHub:&amp;nbsp;&lt;a href=&quot;https://github.com/eslint/eslint&quot;&gt;https://github.com/eslint/eslint&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;According to &lt;a href=&quot;https://eslint.org/docs/latest/about/&quot; target=&quot;_blank&quot;&gt;ESLint.org / About&lt;/a&gt;,&amp;nbsp;&quot;ESLint is an open source JavaScript linting utility originally created by Nicholas C. Zakas in June 2013. Code &lt;a href=&quot;https://en.wikipedia.org/wiki/Lint_(software)&quot;&gt;linting&lt;/a&gt; is a type of static analysis that is frequently used to find problematic patterns or code that doesn’t adhere to certain style guidelines. There are code linters for most programming languages, and compilers sometimes incorporate linting into the compilation process.&lt;br /&gt;&lt;br /&gt;&quot;JavaScript, being a dynamic and loosely-typed language, is especially prone to developer error. Without the benefit of a compilation process, JavaScript code is typically executed in order to find syntax or other errors. Linting tools like ESLint allow developers to discover problems with their JavaScript code without executing it.&lt;br /&gt;&lt;br /&gt;&quot;The primary reason ESLint was created was to allow developers to create their own linting rules. ESLint is designed to have all rules completely pluggable. The default rules are written just like any plugin rules would be. They can all follow the same pattern, both for the rules themselves as well as tests. While ESLint will ship with some built-in rules to make it useful from the start, you’ll be able to dynamically load rules at any point in time&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is ES Lint for Playwright?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;GitHub:&amp;nbsp;&lt;a href=&quot;https://github.com/mskelton/eslint-plugin-playwright&quot;&gt;https://github.com/mskelton/eslint-plugin-playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;NPM Js:&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/eslint-plugin-playwright&quot;&gt;https://www.npmjs.com/package/eslint-plugin-playwright&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;ESLint for Playwright was initially written by open-source developer &lt;a href=&quot;https://github.com/mskelton&quot; target=&quot;_blank&quot;&gt;Mark Skelton&lt;/a&gt;, a senior staff software engineer at Cursor. It is now maintained by the Playwright Community Organization.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From BrowserStack.com&#39;s &lt;a href=&quot;https://www.browserstack.com/guide/playwright-eslint&quot; target=&quot;_blank&quot;&gt;Setting Up ESLint fpr Playwright Projects&lt;/a&gt;:&amp;nbsp;&lt;br /&gt;&lt;blockquote&gt;Have you ever returned to a Playwright project after a few weeks and felt the tests were suddenly unstable or difficult to trust?&lt;br /&gt;&lt;br /&gt;In most cases the problem isn’t Playwright. It comes from small issues that slip in unnoticed.&lt;br /&gt;&lt;br /&gt;Missing awaits. Inconsistent patterns. Promise errors that never surface. Test files that grow without any structure.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.browserstack.com/guide/playwright-tutorial&quot;&gt;Playwright&lt;/a&gt; ESLint is a linting setup that helps ESLint understand Playwright’s testing patterns and catch issues that commonly appear in UI automation.&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is Prettier?&lt;/h2&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Website:&amp;nbsp;&lt;a href=&quot;https://prettier.io/&quot;&gt;https://prettier.io/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Prettier Playground:&amp;nbsp;&lt;a href=&quot;https://prettier.io/playground/&quot;&gt;https://prettier.io/playground/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;GitHub:&amp;nbsp;&lt;a href=&quot;https://github.com/prettier/prettier&quot;&gt;https://github.com/prettier/prettier&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;According to James Long&#39;s January 2017 blog entry, &lt;a href=&quot;https://archive.jlongster.com/A-Prettier-Formatter&quot;&gt;A Prettier Script Formatter&lt;/a&gt;, &quot;Prettier gets rid of all original styling and guarantees consistency by parsing JavaScript into an AST and pretty-printing the AST. Unlike eslint, there aren&#39;t a million configuration options and rules. But more importantly:&amp;nbsp;everything is fixable [...]&quot;&lt;br /&gt;&lt;br /&gt;In JavaScript, an Abstract Syntax Tree (AST) is a nested object structure that maps out the semantic meaning of your code -- such as identifying variable declarations, function calls, and loops -- while ignoring visual styling. Because Prettier is strictly a code formatter, it parses your source code into an AST and then regenerates entirely new text based on its own style rules. Since Prettier only modifies surface-level elements like indentation, line breaks, quotes, and semicolons, the underlying logic remains untouched, resulting in an identical AST before and after formatting&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Installing ESLint&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According &lt;a href=&quot;https://eslint.org/docs/latest/use/getting-started&quot; target=&quot;_blank&quot;&gt;to ESLint.org&lt;/a&gt;, you can install it with NPM, Yarn, PNPM (package managers we saw that Playwright all have listed in their installation documentation. They also mention one we have seen already... bun. To install ESLint with bun, they suggest running the command:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun create @eslint/config@latest&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It then asked me a series of questions:&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;What do you want to lint? ... I selected Markdown.&amp;nbsp;&lt;/li&gt;&lt;li&gt;How would you like to use ESLint? ... To check syntax and find problems.&amp;nbsp;&lt;/li&gt;&lt;li&gt;What type of modules does your project use? ... I selected &quot;JavaScript modules&quot; since we seem to use import/ export, and not require/ exports anywhere.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Which framework does your project use? ... None of these.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Does your project use TypeScript? ... Yes.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Where does your code run? Browser? Node? ... it actually runs in both, so let&#39;s check off both.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Which language do you want your configuration file to be written in? ... JavaScript.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Why did I pick JavaScript? If I picked TypeScript, I would then have to install a library called &lt;a href=&quot;https://github.com/unjs/jiti&quot; target=&quot;_blank&quot;&gt;Jiti&lt;/a&gt; to load the TypeScript Config file. Keeping it as a JavaScript file would make it easier.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then it asked:&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The config that you&#39;ve selected requires the following dependencies: eslint, @eslint/js, globals, typescript-eslint.&lt;/li&gt;&lt;li&gt;Would you like to install them now? ... Yes.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It continued:&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Which package manager do you want to use? ... npm, yarn, pnpm, bun ... I selected &quot;bun&quot;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Finally, it installed everything. When it was finished, it set up a new file...&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;eslint.config.mjs&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;js&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;@eslint/js&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;globals&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;globals&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;tseslint&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;typescript-eslint&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{ defineConfig }&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint/config&quot;&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;defineConfig&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;([&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;**/*.{js,mjs,cjs,ts,mts,cts}&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;plugins&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;js&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;js/recommended&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;languageOptions&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;node&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;} } &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;tseslint&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;configs&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;recommended&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;])&lt;/span&gt;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;js/recommended&lt;/b&gt; gives us ESLint’s standard default rules for JavaScript catching mistakes like using variables before they’re defined, using undeclared variables, unreachable code, confusing or invalid syntax patterns, some common logic and scope problems.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;tseslint.configs.recommended&lt;/b&gt; adds the recommended rules for TypeScript. It catches stuff like: unsafe or incorrect type usage, confusing any usage, unnecessary type assertions, some patterns that are likely to cause bugs in TypeScript code.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Installing ESLint for Playwright&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to the &lt;a href=&quot;https://www.npmjs.com/package/eslint-plugin-playwright&quot; target=&quot;_blank&quot;&gt;NPMJS.com entry on eslint-plugin-playwright&lt;/a&gt;,&amp;nbsp;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun add -D eslint-plugin-playwright&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;This adds eslint-plugin-playwright to your package.json.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The docs mention that eslint-plugin-playwright,&amp;nbsp;&quot;The recommended setup is to use the files field to target only Playwright test files. In the examples below, this is done by targeting files in the tests directory and only applying the Playwright rules to those files. In your project, you may need to change the files field to match your Playwright test file patterns&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Following their directions, our &lt;b&gt;eslint.config.jts&lt;/b&gt; now looks like:&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;js&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;@eslint/js&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;globals&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;globals&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;tseslint&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;typescript-eslint&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{ defineConfig }&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint/config&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;playwright&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint-plugin-playwright&quot;&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;defineConfig&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;([&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;**/*.{js,mjs,cjs,ts,mts,cts}&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;plugins&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;js&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;js/recommended&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;languageOptions&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;globals&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;node&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;tests/**&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;playwright&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;configs&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;flat/recommended&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]]&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;tseslint&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;configs&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;recommended&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;])&lt;/span&gt;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... If we wanted to pick and choose which rules to follow, we could add a rules block, but let&#39;s leave it as is for now.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To run the linter:&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bunx eslint . --ext .ts,.mts,.js,.mjs&lt;/li&gt;&lt;/ul&gt;... No output? No problems detected!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;ESLint for Prettier&lt;/h2&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;GitHub:&amp;nbsp;&lt;a href=&quot;https://github.com/prettier/eslint-config-prettier&quot; target=&quot;_blank&quot;&gt;https://github.com/prettier/eslint-config-prettier&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;We are using ESLint for our code linter, ESLint for Playwright as our Playwright linter.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both of these packages would step on the toes of our code formatter, Prettier, so Prettier came up with &lt;a href=&quot;https://github.com/prettier/eslint-config-prettier&quot; target=&quot;_blank&quot;&gt;eslint-config-prettier&lt;/a&gt;, which had some Prettier rules that would conflict turned off.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We are going to add Prettier and eslint-config-prettier at the same time with:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun add -D prettier eslint-config-prettier&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;To check if Prettier installed:&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bunx prettier --version&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Check with Prettier if there are any errors:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bunx prettier --check .&lt;/li&gt;&lt;/ul&gt;... And it looks like there are four warnings.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What are they?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bunx prettier --list-different .&lt;/li&gt;&lt;li&gt;bunx prettier --check . --log-level debug&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Okay, they are minor spacing issues. Let&#39;s fix them:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bunx prettier --write .&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Want to see more options?&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Check out Prettier&#39;s Command Line Interface (CLI) commands at&amp;nbsp;&lt;a href=&quot;https://prettier.io/docs/cli&quot; target=&quot;_blank&quot;&gt;https://prettier.io/docs/cli&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Add Scripts to the Package.json&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You know, &quot;bunx eslint .&quot; and all the rest is kinda complicated.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s add some more scripts that are lint related to our package.json, which already has our test script and typecheck script where we added the TypeScript compiler.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div style=&quot;line-height: 19px;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;scripts&quot;&lt;/span&gt;: {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint:ci&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint . --max-warnings 0&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lint:fix&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;eslint . --fix&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --write .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:check&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --check .&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:debug&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --check . --log-level debug&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;format:diff&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;prettier --list-different&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;typecheck&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;tsc --noEmit&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; },&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... All we need to do is run &quot;bun run test&quot;, &quot;bun run format&quot;, or &quot;bun run typecheck&quot; to run tests, format the code, or run typecheck.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, I added &lt;b&gt;lint:ci&lt;/b&gt;, for our CI/CD pipeline we will be adding later, so it does not allow any warnings with lint.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;  

&lt;br /&gt;&lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/2562652151569271850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2562652151569271850'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2562652151569271850'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html' title='Checking code with lint, formatting it with prettier'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-8167333771863877031</id><published>2026-08-07T23:10:43.830-04:00</published><updated>2026-08-24T22:37:48.310-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>Add Type Checking and TSConfig to Bun-Create-Playwright</title><content type='html'>&lt;div&gt;&lt;div&gt;Now that we have&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot; target=&quot;_blank&quot;&gt;installed bun&lt;/a&gt;, Anthropic&#39;s package manager, and &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot; target=&quot;_blank&quot;&gt;scaffolded a Playwright framework and closely examined the results&lt;/a&gt;, we are going to explore with our &lt;b&gt;Bun-Create-Playwright&lt;/b&gt; project ways to check if our code is correct.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first method we will be exploring is&amp;nbsp;&lt;b&gt;typechecking&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why Typechecking? As the &lt;a href=&quot;https://playwright.dev/docs/test-typescript#introduction&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Node.js Introduction&lt;/a&gt; mentions:&lt;/div&gt;&lt;blockquote&gt;&quot;[...] Playwright does not check the types and will run tests even if there are non-critical TypeScript compilation errors. We recommend you run TypeScript compiler alongside Playwright.&lt;br /&gt;&lt;br /&gt;&quot;[...]  Note that Playwright only supports the following tsconfig options: allowJs, baseUrl, paths, references and extends.&lt;br /&gt;&lt;br /&gt;&quot;[...] By default, Playwright will look up a closest tsconfig for each imported file by going up the directory structure and looking for tsconfig.json or jsconfig.json. This way, you can create a tests/tsconfig.json file that will be used only for your tests and Playwright will pick it up automatically&quot;.&lt;/blockquote&gt;Before we go further down this road...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is Type Checking?&amp;nbsp;&lt;/h2&gt;&lt;br /&gt;According to &lt;a href=&quot;https://zerotomastery.io/blog/typescript-type-checking/&quot; target=&quot;_blank&quot;&gt;Type Checking in TypeScript: A Beginners Guide&lt;/a&gt;, every piece of data in TypeScript is given a &quot;type&quot;, and this &quot;type&quot; determines what properties the data has, and what methods are available to it. The types can be things like a Number, String, Enum, Boolean, Array, Object, Type assertions, or others.&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since all data in TypeScript is given a type, it means that the TypeScript compiler, tsc, can check every property to make sure it is being used correctly. It makes sure that the expected properties exist and that the methods and functions are all compatible.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And best of all, you can run these checks in your IDE as you are writing the code!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To run typechecking against our code, all we have to do is execute from the Terminal:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;tsc --noEmit&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Since we are just kicking the tires of our code to see what happens, we don&#39;t need to emit &quot;compiler output files like JavaScript source code, source-maps or declarations. This makes room for another tool like &lt;a href=&quot;https://babeljs.io/&quot;&gt;Babel&lt;/a&gt;, or &lt;a href=&quot;https://github.com/swc-project/swc&quot;&gt;swc&lt;/a&gt; to handle converting the TypeScript file to a file which can run inside a JavaScript environment. You can then use TypeScript as a tool for providing editor integration, and as a source code type-checker&quot;. ( &lt;a href=&quot;https://www.typescriptlang.org/tsconfig/#noEmit&quot; target=&quot;_blank&quot;&gt;TypeScriptLang.org / noEmit&lt;/a&gt; )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The only problem? We need a TypeScript configuration file added to our project before we do that, and as you could see when we &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot; target=&quot;_blank&quot;&gt;examined what &quot;bun create playwright&quot; produced&lt;/a&gt;, we don&#39;t have one.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you try to run the &quot;tsc --noEmit&quot; command without a tsconfig.json, you get the message:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;i&gt;Version 6.0.3&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;tsc: The TypeScript Compiler - Version 6.0.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;TS COMMON COMMANDS&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc: Compiles the current project (tsconfig.json in the working directory.)&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc app.ts util.ts: Ignoring tsconfig.json, compiles the specified files with default compiler options.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc -b: Build a composite project in the working directory.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc --init: Creates a tsconfig.json with the recommended settings in the working directory.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc -p ./path/to/tsconfig.json: Compiles the TypeScript project located at the specified path.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc --help --all: An expanded version of this information, showing all possible compiler options&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc --noEmit&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; tsc --target esnext&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; Compiles the current project, with additional settings.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;COMMAND LINE FLAGS&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; --help, -h&amp;nbsp; Print this message.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; ...&lt;/i&gt;&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --outFile&amp;nbsp; Specify a file that bundles all outputs into one JavaScript file. If &#39;declaration&#39; is true,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; also designates a file that bundles all .d.ts output.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--outDir&amp;nbsp; Specify an output folder for all emitted files.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;You can learn about all of the compiler options at &lt;a href=&quot;https://aka.ms/tsc&quot;&gt;https://aka.ms/tsc&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;So, how do we create with bun a tsconfig.json file?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun init&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What does Bun Init Do?&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;According to the &lt;a href=&quot;https://bun.com/docs/runtime/templating/init&quot; target=&quot;_blank&quot;&gt;Bun.com / Init Templating docs&lt;/a&gt;, It creates:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;a package.json file with a name that defaults to the current directory name&lt;/li&gt;&lt;li&gt;a tsconfig.json or jsconfig.json file, depending on whether the entry point is a TypeScript file&lt;/li&gt;&lt;li&gt;an entry point, which defaults to index.ts unless any of index.{tsx, jsx, js, mts, mjs} exist or the package.json specifies a module or main field&lt;/li&gt;&lt;li&gt;a README.md file&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;It also creates AI Agent rules (disable with $BUN_AGENT_RULE_DISABLED=1):&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;a CLAUDE.md file when Claude CLI is detected (disable with CLAUDE_CODE_AGENT_RULE_DISABLED env var)&lt;/li&gt;&lt;li&gt;a .cursor/rules/*.mdc file when Cursor is detected, which tells &lt;a href=&quot;https://cursor.sh/&quot;&gt;Cursor AI&lt;/a&gt; to use Bun instead of Node.js and npm&lt;/li&gt;&lt;/ul&gt;But we already scaffolded a Playwright project! Do we have to start from scratch and do everything all over again?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No, but we do need to make some modifications:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Does your package.json in your root folder of the project have&amp;nbsp;&quot;main&quot; to be &quot;index.js&quot;? Change that JavaScript extension to &quot;.ts&quot;.&lt;/li&gt;&lt;li&gt;Do you have a &quot;jsconfig.json&quot; file? Delete it.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Do you have an index.html file? Delete it.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Then run: bun init&amp;nbsp;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;TSConfig.json Achieved! First version!&lt;/h2&gt;&lt;div&gt;The resulting&lt;b&gt; tsconfig.json&lt;/b&gt; file produced by &quot;bun init&quot;, according to Google AI, &quot;configures TypeScript to act strictly as a type-checker while offloading the actual bundling, compiling, and running of your JavaScript/TypeScript code to Bun&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;{
  &quot;compilerOptions&quot;: {
    // Environment setup &amp;amp; latest features
    &quot;lib&quot;: [&quot;ESNext&quot;],
    &quot;target&quot;: &quot;ESNext&quot;,
    &quot;module&quot;: &quot;Preserve&quot;,
    &quot;moduleDetection&quot;: &quot;force&quot;,
    &quot;jsx&quot;: &quot;react-jsx&quot;,
    &quot;allowJs&quot;: true,
    &quot;types&quot;: [&quot;bun&quot;],

    // Bundler mode
    &quot;moduleResolution&quot;: &quot;bundler&quot;,
    &quot;allowImportingTsExtensions&quot;: true,
    &quot;verbatimModuleSyntax&quot;: true,
    &quot;noEmit&quot;: true,

    // Best practices
    &quot;strict&quot;: true,
    &quot;skipLibCheck&quot;: true,
    &quot;noFallthroughCasesInSwitch&quot;: true,
    &quot;noUncheckedIndexedAccess&quot;: true,
    &quot;noImplicitOverride&quot;: true,

    // Some stricter flags (disabled by default)
    &quot;noUnusedLocals&quot;: false,
    &quot;noUnusedParameters&quot;: false,
    &quot;noPropertyAccessFromIndexSignature&quot;: false
  }
}
&lt;/code&gt;&lt;/pre&gt;
  
  
  &lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;&lt;strong&gt;Environment setup &amp;amp; latest features&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;These settings ensure TypeScript understands the latest syntax and runtime environment variables.&lt;/p&gt;
&lt;ul class=&quot;[li_&amp;amp;]:mb-0 [li_&amp;amp;]:mt-1 [li_&amp;amp;]:gap-1 [&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3 print:block print:space-y-1&quot; dir=&quot;ltr&quot;&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;lib&quot;: [&quot;ESNext&quot;]&lt;/code&gt; -- includes type definitions for the newest JavaScript standard library features (Promise, Array methods, etc.).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;target&quot;: &quot;ESNext&quot;&lt;/code&gt; -- compiles/type-checks against the latest ECMAScript syntax rather than downleveling to an older version.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;module&quot;: &quot;Preserve&quot;&lt;/code&gt; -- keeps your import/export statements as written (doesn&#39;t rewrite ESM to CommonJS or vice versa); left for Bun to handle at runtime.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;moduleDetection&quot;: &quot;force&quot;&lt;/code&gt; -- treats every file as a module (adds import/export scoping) even if it has no import/export statements itself.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;jsx&quot;: &quot;react-jsx&quot;&lt;/code&gt; -- compiles JSX using the React 17+ automatic runtime (no need to &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;import React&lt;/code&gt; in every file that uses JSX).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;allowJs&quot;: true&lt;/code&gt; --&amp;nbsp; lets &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;.js&lt;/code&gt; files be included and type-checked alongside &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;.ts&lt;/code&gt; files.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;types&quot;: [&quot;bun&quot;]&lt;/code&gt; -- only loads Bun&#39;s global type definitions (e.g. &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;Bun.serve&lt;/code&gt;), instead of auto-including every &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;@types/*&lt;/code&gt; package found in &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;node_modules&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;&lt;strong&gt;Bundler mode&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;These rules match how modern build tools resolve file paths and handle module definitions.&lt;/p&gt;
&lt;ul class=&quot;[li_&amp;amp;]:mb-0 [li_&amp;amp;]:mt-1 [li_&amp;amp;]:gap-1 [&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3 print:block print:space-y-1&quot; dir=&quot;ltr&quot;&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;moduleResolution&quot;: &quot;bundler&quot;&lt;/code&gt; -- resolves imports the way modern bundlers do, closer to Node&#39;s ESM resolution but more permissive (works with &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;paths&lt;/code&gt;, package &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;exports&lt;/code&gt;, etc.).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;allowImportingTsExtensions&quot;: true&lt;/code&gt; -- permits writing &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;import &#39;./foo.ts&#39;&lt;/code&gt; with the explicit extension (normally disallowed).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;verbatimModuleSyntax&quot;: true&lt;/code&gt; -- requires type-only imports to be explicitly marked (&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;import type { Foo }&lt;/code&gt;), so the compiler doesn&#39;t have to guess what to strip at build time.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noEmit&quot;: true&lt;/code&gt; -- TypeScript only type-checks; it doesn&#39;t output compiled &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;.js&lt;/code&gt; files (Bun runs the &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;.ts&lt;/code&gt; files directly).&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;&lt;strong&gt;Best practices&lt;/strong&gt;&lt;/p&gt;These options activate strict type-safety rules to catch potential bugs early.
&lt;ul class=&quot;[li_&amp;amp;]:mb-0 [li_&amp;amp;]:mt-1 [li_&amp;amp;]:gap-1 [&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3 print:block print:space-y-1&quot; dir=&quot;ltr&quot;&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;strict&quot;: true&lt;/code&gt; -- turns on TypeScript&#39;s full strict type-checking mode (&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;strictNullChecks&lt;/code&gt;, &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;noImplicitAny&lt;/code&gt;, etc. all at once).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;skipLibCheck&quot;: true&lt;/code&gt; -- skips type-checking inside &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;.d.ts&lt;/code&gt; declaration files (faster builds, avoids errors in third-party type definitions you don&#39;t control).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noFallthroughCasesInSwitch&quot;: true&lt;/code&gt; -- errors if a &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;switch&lt;/code&gt; case falls through to the next case without a &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;break&lt;/code&gt;/&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;return&lt;/code&gt;.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noUncheckedIndexedAccess&quot;: true&lt;/code&gt; -- accessing an object/array by index (e.g. &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;arr[i]&lt;/code&gt;) returns &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;T | undefined&lt;/code&gt; instead of just &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;T&lt;/code&gt;, forcing you to handle the &quot;might not exist&quot; case. Useful in test code that reads array/object results.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noImplicitOverride&quot;: true&lt;/code&gt; -- requires the &lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;override&lt;/code&gt; keyword when a subclass method overrides a parent class method (relevant if you&#39;re using Page Object classes with inheritance).&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;&lt;strong&gt;Stricter flags (disabled here)&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;font-claude-response-body break-words whitespace-normal&quot; dir=&quot;ltr&quot;&gt;These are options explicitly turned off to keep the development experience smoother and less strict during early coding phases.&lt;/p&gt;
&lt;ul class=&quot;[li_&amp;amp;]:mb-0 [li_&amp;amp;]:mt-1 [li_&amp;amp;]:gap-1 [&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3 print:block print:space-y-1&quot; dir=&quot;ltr&quot;&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noUnusedLocals&quot;: false&lt;/code&gt; -- won&#39;t error on declared-but-unused local variables.&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noUnusedParameters&quot;: false&lt;/code&gt; -- won&#39;t error on unused function parameters (common in test fixtures/callbacks where you don&#39;t use every argument).&lt;/li&gt;
&lt;li class=&quot;font-claude-response-body whitespace-normal break-words pl-2&quot;&gt;&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;&quot;noPropertyAccessFromIndexSignature&quot;: false&lt;/code&gt; -- allows dot notation (&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;obj.foo&lt;/code&gt;) even on objects typed with an index signature, instead of forcing bracket notation (&lt;code class=&quot;bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]&quot;&gt;obj[&#39;foo&#39;]&lt;/code&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;... This is what &quot;bun init&quot; produced. Let&#39;s investigate with Claude.ai or Google AI to see if we should now be all set with our Bun + Playwright + TypeScript project...&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;TSConfig.json: Take Two!&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After I ran it by GitHub Copilot, it suggested to change the tsconfig like so...&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;compilerOptions&quot;&lt;/span&gt;: {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #8b949e;&quot;&gt;// Environment setup &amp;amp; latest features&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;lib&quot;&lt;/span&gt;: [&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;ES2022&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;DOM&quot;&lt;/span&gt;],&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;target&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;ES2022&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;module&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;ESNext&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;moduleDetection&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;force&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;types&quot;&lt;/span&gt;: [&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;node&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;bun&quot;&lt;/span&gt;],&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But Why, Claude?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&quot;These choices are better because they match the runtime and tooling you actually have, rather than using the most generic defaults.target: &quot;ES2022&quot;: this targets a modern JavaScript version that is broadly supported and a good default for current Node/Bun environments. It is more practical than ESNext because it gives a stable, explicit baseline.&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;lib: [&quot;ES2022&quot;, &quot;DOM&quot;]: this tells TypeScript about modern JavaScript features plus browser APIs like window, document, and fetch. That matters for Playwright tests, which often interact with browser-like environments.&lt;/li&gt;&lt;li&gt;module: &quot;ESNext&quot;: this matches modern ESM-style projects and works well with current Bun/Node tooling. It is a better fit than older module systems when you are using modern package resolution.&lt;/li&gt;&lt;li&gt;types: [&quot;node&quot;, &quot;bun&quot;]: this makes the compiler aware of both Node and Bun globals/types. That is useful because your project is using Bun as the package runner while also relying on Node-compatible APIs.&lt;/li&gt;&lt;/ul&gt;&quot;In short, the new config is more explicit, more compatible with current tooling, and less likely to surprise you later when you add scripts, browser APIs, or ESM-style imports&quot;.&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Add the TypeScript Checking to a Script&lt;/h2&gt;&lt;div&gt;Okay, let&#39;s add the &quot;tsc --noEmit&quot; command to our package.json script:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;scripts&quot;&lt;/span&gt;: {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;test&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;playwright test&quot;&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7ee787;&quot;&gt;&quot;typecheck&quot;&lt;/span&gt;: &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;tsc --noEmit&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; },&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Now, when you run &quot;bun run typecheck&quot;, the TypeScript Compiler will test out your code.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No errors? No output. No problem!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With our next post, we will see other ways to add ways to review our code.&amp;nbsp;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;
  &lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  
  &lt;/div&gt;Until then... Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/8167333771863877031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/8167333771863877031'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/8167333771863877031'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html' title='Add Type Checking and TSConfig to Bun-Create-Playwright'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-684749975742149467</id><published>2026-08-06T13:37:06.209-04:00</published><updated>2026-08-24T22:38:46.993-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>What happens when you scaffold a Playwright framework and run installed tests using bun?</title><content type='html'>We covered &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot; target=&quot;_blank&quot;&gt;in the last blog post &lt;/a&gt;how to install &lt;b&gt;bun&lt;/b&gt;, a new package manager.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this blog post, we will look into using bun to install a new Playwright framework.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Create the Playwright Framework&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once I installed bun on my Windows PC and was up and running I created a new folder, &quot;bun-create-playwright&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I opened up that folder in VS Code, along with a new PowerShell terminal. In that terminal I entered:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;bun create playwright&amp;nbsp;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;This activated the interactive Playwright installer that Playwright comes with.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;I selected I wanted it to create for me a &lt;b&gt;TypeScript&lt;/b&gt; project, placing the tests in the default folder, &lt;b&gt;tests&lt;/b&gt;, but I decided &lt;b&gt;not &lt;/b&gt;to add a GitHub Actions workflow. I wanted to experiment with using &lt;a href=&quot;https://gitlab.com/&quot; target=&quot;_blank&quot;&gt;GitLab&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;I chose it to set up and install all the browsers for me... which it did... using NPX, part of Node.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Wait a second, when it comes to our Playwright framework, doesn&#39;t bun replace node?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No. Bun might be a JavaScript runtime, a package manager, and a bundler shipped as a single software tool, but in our case we are simply using it as a package manager in our Playwright framework.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bun works alongside Node.js in the Playwright project. We still use Playwright&#39;s test runner, a Node.js program. Bun handles installations and run tasks.&lt;/div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Alert: Windows Bug!&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Initially, that wasn&#39;t enough to install Playwright&#39;s internal browsers. There is a bug with bun + Playwright Windows where we also need to:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;bun add --dev @playwright/test&lt;/li&gt;&lt;li&gt;bunx playwright install&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;That was enough for the browsers to install.&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Create the Bun Lock File&lt;/h3&gt;&lt;div&gt;After the browsers are installed, we need to install bun in our project, to create from the package.json a bun installation.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Run in the Terminal: &lt;/b&gt;bun install&lt;/li&gt;&lt;li&gt;Review the newly created file bun.lock.file in the root directory of the project.&lt;/li&gt;&lt;li&gt;Delete the &lt;b&gt;package-lock.json&lt;/b&gt; file.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Add the test script to the Package.json&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;If you look in the package.json file, you can see that the scripts code block is currently empty.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;scripts&quot;: {}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;Inside this code block, we will be adding:&lt;/div&gt;&lt;br /&gt;
  
  &lt;pre&gt;&lt;code&gt;&quot;scripts&quot;: {    
    &quot;test&quot;: &quot;playwright test&quot;  
  },
    &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Examine the Included Tests&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Two tests will automatically be set up for you:&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;has title&lt;/b&gt;: Navigates to &lt;a href=&quot;http://playwright.dev&quot; target=&quot;_blank&quot;&gt;playwright.dev&lt;/a&gt; and expects the title of the page to have the word &quot;Playwright&quot;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;get started&lt;/b&gt;: Navigates to &lt;a href=&quot;http://playwright.dev&quot; target=&quot;_blank&quot;&gt;playwright.dev&lt;/a&gt; and checks the &quot;Get started&quot; link.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;tests/ example.spec.ts&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{ test, expect }&lt;/span&gt; &lt;span style=&quot;color: #c586c0;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;has title&#39;&lt;/span&gt;, &lt;span style=&quot;color: #569cd6;&quot;&gt;async&lt;/span&gt; ({ &lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt; }) &lt;span style=&quot;color: #ff7b72;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;https://playwright.dev/&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;// Expect a title &quot;to contain&quot; a substring.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toHaveTitle&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/Playwright/&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;);&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;get started link&#39;&lt;/span&gt;, &lt;span style=&quot;color: #569cd6;&quot;&gt;async&lt;/span&gt; ({ &lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt; }) &lt;span style=&quot;color: #ff7b72;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;https://playwright.dev/&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;// Click the get started link.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;link&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Get started&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; }).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;// Expects page to have a heading with the name of Installation.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffa657;&quot;&gt;page&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getByRole&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;heading&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&#39;Installation&#39;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; })).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toBeVisible&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;);&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;There are three stages you want to follow when you are designing an automated test:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Arrange&lt;/b&gt;: Setup things like opening up a browser page.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Act&lt;/b&gt;: Go to a web site and see if you can get a link and click on it.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Assert&lt;/b&gt;: Expect that the conditions of the tests are met, failing the test if the expected results and actual results do not match up.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;import &lt;/b&gt;pulls code that lives in another file or package so you can use it in your project. We import two specific named functions, &lt;i&gt;test &lt;/i&gt;and &lt;i&gt;expect&lt;/i&gt;, from the @playwright/test package (the Playwright Test framework&#39;s core library). &lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;test is a function used to define an individual test case. &lt;/li&gt;&lt;li&gt;expect is a function used to create assertions (checks that something is true, and fail the test if it isn&#39;t). [ &lt;i&gt;See &lt;a href=&quot;https://playwright.dev/docs/test-assertions&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Assertions&lt;/a&gt;&lt;/i&gt; ]&lt;/li&gt;&lt;/ul&gt;The { test, expect } syntax is called a &quot;named import&quot;, getting specific things out of the package rather than the whole package as one object.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;test blocks&lt;/b&gt; set up two Playwright tests. Strings such as &quot;has title&quot; sets up the name of the test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;async &lt;/b&gt;sets up this test function to be asynchronous, with many tests allowed to be executed at the same time as this one. The browser to run the first &quot;has title&quot; test might not be able to navigate to the page right away. The aync keyword allows the test to pause and wait for any slower actions to be completed before moving to the next part of the test. Once we set up async, we can use await later in the test. Meanwhile, it returns a &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&quot; target=&quot;_blank&quot;&gt;JavaScript Promise&lt;/a&gt;, a placeholder container until we determine the success or failure of the action, when it actually will contain a value. This promise will be either pending, fulfilled, or rejected.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;page &lt;/b&gt;sets up the pre-defined Playwright page fixture [ See &lt;a href=&quot;https://playwright.dev/docs/test-fixtures&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Fixtures&lt;/a&gt; ]. With this call, before the individual test starts, a fresh isolated page is launched just for this test, so the &quot;has title&quot; test does not interfere with the &quot;get started&quot; test. This page fixture has automatic setup and teardown.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;=&amp;gt;&lt;/b&gt; is a &quot;hash rocket&quot;, representing the &quot;arrow function&quot;, separating the earlier parameters of the test with the coming body of the test function.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;await&lt;/b&gt;&amp;nbsp;returns a Promise, a placeholder, so if we can&#39;t do something like go to a page right away, the test won&#39;t automatically go to the next line of code and possibly fail. Playwright by default waits 30 seconds for a goto to complete, 30 seconds for an action to happen, but only 5 seconds on an assertion like &quot;expect&quot;. If it goes over that timeout, the test will fail.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;goto&lt;/b&gt; is part of the &lt;a href=&quot;https://playwright.dev/docs/api/class-page#page-goto&quot; target=&quot;_blank&quot;&gt;Page fixture&lt;/a&gt;, that automatically handles page navigation.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;expect&lt;/b&gt; is an assertion. By default, the test expects this condition to be met within five minutes, else the test fails.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;toHaveTitle &lt;/b&gt;is a built in &lt;a href=&quot;https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-title&quot; target=&quot;_blank&quot;&gt;Playwright page assertion&lt;/a&gt;. It allows regular expressions such as /Playwright/ to let the test know that having the word &quot;Playwright&quot; in the title is acceptable. Playwright has many assertions, &lt;a href=&quot;https://playwright.dev/docs/api/class-pageassertions&quot; target=&quot;_blank&quot;&gt;such as the PageAssertions&lt;/a&gt; toHaveTitle, toHaveURL, toHaveScrreenshot(name).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;getByRole&lt;/b&gt; is &lt;a href=&quot;https://playwright.dev/docs/api/class-locator#locator-get-by-role&quot; target=&quot;_blank&quot;&gt;a Playwright Locator&lt;/a&gt;, that helps you find a web element on the page. Are you looking for a certain alert, alertDialog, banner, button, checkbox, heading, img, link, listbox, menu, menubar, list, listbox, progressbar, searchbox, table, or textbox, tooltip, amongst others? You can try to getByRole. With this you are locating elements by their &lt;a href=&quot;https://www.w3.org/TR/wai-aria-1.2/#roles&quot;&gt;ARIA role&lt;/a&gt;, &lt;a href=&quot;https://www.w3.org/TR/wai-aria-1.2/#aria-attributes&quot;&gt;ARIA attributes&lt;/a&gt; and &lt;a href=&quot;https://w3c.github.io/accname/#dfn-accessible-name&quot;&gt;accessible name&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... Note that with locators, you can also getByTestId, getByAltText, getByText, getByTitle, etc.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;.click&lt;/b&gt; is a &lt;a href=&quot;https://playwright.dev/docs/input&quot;&gt;Playwright action&lt;/a&gt; you can perform.&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Once you found an element by a locator, you can .click or .dblclick it, .click({ button: &#39;right&#39; }) or .click({ modifiers: [&#39;Shift&#39;]}), and .hover.&lt;/li&gt;&lt;li&gt;You can .check a checkbox or .selectOption on a radio button, and expect it .toBeChecked.&amp;nbsp;&lt;/li&gt;&lt;li&gt;You can drag and drop an item.&amp;nbsp;&lt;/li&gt;&lt;li&gt;You can fill a textbox, input field, or text area.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;.toByVisible&lt;/b&gt; is a &lt;a href=&quot;https://playwright.dev/docs/api/class-locatorassertions&quot; target=&quot;_blank&quot;&gt;Playwright Locator Assertion&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Once you found an element by a &lt;a href=&quot;https://playwright.dev/docs/api/class-locator&quot; target=&quot;_blank&quot;&gt;Playwright locator&lt;/a&gt;, you can in the test expect it .toBeChecked, .toBeDisabled, .toBeEditable, .toBeEmpty, .toBeEnabled, .toBeFocused, .toBeHidden, .toBeInViewport, .toBeVisible, .toContainClass, .toContainText, /toHavaAccessibleDescription, .toHaveAttribute, .toHaveId, .toHaveRole, .toHaveText, .toHaveValue.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Each of these methods can be negated chaining a &quot;not&quot; value. Expect a text box .not.toBeEmpty.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Execute the Playwright Tests: Bun Run Test&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we should be able to run the tests that come with the initial Playwright scaffolding:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun run test&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;The Playwright tests, are automatically run in Chromium, Firefox, and WebKit / Safari, and should pass.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can see the results if you open up the &lt;b&gt;bun-create-playwright&lt;/b&gt; folder in an IDE such as VS Code:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Go to the playwright-report folder&lt;/li&gt;&lt;li&gt;Right click on the index.html file that was produced.&lt;/li&gt;&lt;li&gt;Select &quot;Open with Live Server&quot;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiXctKCd4pvQbwjsbEHO8s0z3slVGJdvPXcJnOi5kY64GDzY0fDp5oBkCSuJNycXgS3RziW_kGXLB0q5iMwI79QxuRDJJ3-08T0mGt4evCqlMBzhZa8KB-w31DIOf_OsspME2rJrWI3YltGuJm1JYHljma6JsWxtjJZBGGFVsnedk4P80W45tJH01wOV6c&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;414&quot; data-original-width=&quot;549&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiXctKCd4pvQbwjsbEHO8s0z3slVGJdvPXcJnOi5kY64GDzY0fDp5oBkCSuJNycXgS3RziW_kGXLB0q5iMwI79QxuRDJJ3-08T0mGt4evCqlMBzhZa8KB-w31DIOf_OsspME2rJrWI3YltGuJm1JYHljma6JsWxtjJZBGGFVsnedk4P80W45tJH01wOV6c=s1600&quot; title=&quot;Playwright test results&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can drill down into the test to see more information about the tests.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEitA1iq8y_stUm8mfoEKFSwUlgy_gPeD5qC1LFi2q0VWzdZLiZlTupEW72bg0KkeHoNSWpLpXrZe02dPWGNPjPZyuAQTyBpr1ewtBMiJxb-GKrG0jFKEfZzt89Br0HDyWIHBZi5CEzVxywqNupP-OvwhpVl7LU8LuCCG91soltvdVOqHcDIFlll0giy_Dg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;931&quot; data-original-width=&quot;701&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEitA1iq8y_stUm8mfoEKFSwUlgy_gPeD5qC1LFi2q0VWzdZLiZlTupEW72bg0KkeHoNSWpLpXrZe02dPWGNPjPZyuAQTyBpr1ewtBMiJxb-GKrG0jFKEfZzt89Br0HDyWIHBZi5CEzVxywqNupP-OvwhpVl7LU8LuCCG91soltvdVOqHcDIFlll0giy_Dg=w482-h640&quot; width=&quot;482&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;What Does Playwright Install?&amp;nbsp;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;The Playwright scaffolder installs:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b style=&quot;text-decoration-line: underline;&quot;&gt;node_modules&lt;/b&gt; folder:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Created by a package manager (npm, yarn, bun, pnpm) when you install dependencies. Contains the actual source code of every package your project depends on, plus the dependencies of those dependencies (transitive dependencies), recursively. It&#39;s populated by running an install command (npm install, bun install, etc.), and never edited by hand. &lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Node&#39;s module resolution algorithm looks inside node_modules when you import/require a package by name.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Contains .bin, @playwright, @types. bun-types, playwright, playwright-core, typescript, undici-types. According to Claude.ai:&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;br /&gt;&lt;b&gt;.bin&lt;/b&gt;: Executable scripts for installed packages. This is where npm/bun puts symlinks (&lt;i&gt;symbolic links&lt;/i&gt;) to CLI (&lt;i&gt;Command Line Interface&lt;/i&gt;) tools so you can run them via npx playwright or through package.json scripts, instead of needing global installation of every executable. &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;@playwright&lt;/b&gt;: Scoped npm namespace. Typically contains @playwright/test, the Playwright Test runner package (test runner, assertions, fixtures, config handling — what you import when you write import { test, expect } from &#39;@playwright/test&#39;). &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;b&gt;@types&lt;/b&gt;: Folder that Bun creates to hold TypeScript type declaration packages published under the @types scope on npm. These packages come from &lt;a href=&quot;http://DefinitelyTyped.org&quot;&gt;DefinitelyTyped.org&lt;/a&gt;, a large community-maintained repository on GitHub where volunteers write and publish TypeScript type declarations for JavaScript libraries that don&#39;t include their own. When a package doesn&#39;t ship built-in types (common for older libraries or runtime built-ins like Node.js itself), DefinitelyTyped contributors write a separate package describing that library&#39;s functions, arguments, and return values, then publish it to npm as @types/&amp;lt;library-name&amp;gt;These give you IntelliSense and type-checking for JS APIs.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;bun-types&lt;/b&gt;: Type declarations for Bun&#39;s runtime APIs (Bun.file, Bun.serve, etc.), letting TypeScript understand Bun-specific globals if you&#39;re running/building with Bun instead of Node. &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;playwright&lt;/b&gt;: The full Playwright package, including the browser automation driver and CLI. This is distinct from @playwright/test: playwright is the core library (browser launching, contexts, pages), while @playwright/test builds the test runner on top of it. &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;playwright-core&lt;/b&gt;: The stripped-down core of Playwright without the browser-download step. playwright depends on this internally; you&#39;d typically only see it listed as a top-level dependency if something needs Playwright&#39;s automation APIs without auto-downloading browser binaries. &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;typescript&lt;/b&gt;: The TypeScript compiler (tsc) itself, used for type-checking and/or transpiling .ts files. &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;undici-types&lt;/b&gt;: type declarations for undici, Node&#39;s HTTP client, pulled in automatically by @types/node.&lt;/blockquote&gt; &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;text-decoration-line: underline;&quot;&gt;playwright-report&lt;/b&gt; folder:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;A folder to store HTML Reports produced after a test run.&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&amp;nbsp;According to &lt;a href=&quot;https://playwright.dev/docs/test-reporters#html-reporter&quot; target=&quot;_blank&quot;&gt;Playwright.dev / HTML Reporter&lt;/a&gt;, &quot;HTML reporter produces a self-contained folder that contains report for the test run that can be served as a web page.&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&quot;[...] By default, HTML report is opened automatically if some of the tests failed. You can control this behavior via the open property in the Playwright config or the PLAYWRIGHT_HTML_OPEN environmental variable. The possible values for that property are always, never and on-failure (default)&quot;.&lt;/p&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;test-results&lt;/u&gt;&lt;/b&gt; folder:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;After running the test, it contains .last-run.json which contains &quot;status: passed&quot; with an empty array of failedTests.&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;tests&lt;/u&gt;&lt;/b&gt; folder:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;example.spec.ts&lt;/b&gt; contains the pre-installed Playwright tests we have already covered.&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;.gitignore&lt;/u&gt;&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Want something to not be checked in, committed, and merged to an outside source? Place it here.&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Playwright automatically has it so node_modules, local test-results, local playwright-reports, and things in the local .cache and .auth do not get committed.&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;bun.lock&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This lockfile is produced by &quot;bun install&quot;. Why have a lockfile? According to &lt;a href=&quot;https://lock-file-in-programming-why-does-it-matter.pages.dev/&quot; target=&quot;_blank&quot;&gt;Code Protection Hub&lt;/a&gt;,&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&quot;The entire philosophy of lock file programming revolves around a concept called Semantic Versioning (SemVer). In a manifest file (like package.json), developers specify acceptable version ranges using caret (^) or tilde (~) symbols. For example, ^2.4.1 allows the package manager to download minor updates and bug fixes (up to version 3.0.0).&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&quot;While this allows projects to automatically receive security patches, it introduces a severe risk: Dependency Drift.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&quot;Imagine Developer A runs npm install on Monday and receives version 2.4.1. On Friday, the package author publishes version 2.5.0 containing a subtle bug. When Developer B joins the team and runs npm install, they receive the buggy 2.5.0 version. The application breaks for Developer B, but works perfectly for Developer A. This is the classic &quot;it works on my machine&quot; nightmare.&lt;br /&gt;The lock file acts as a historical snapshot. It records the exact version, the registry URL, and the cryptographic hash (SHA-512) of the code downloaded on Monday. When Developer B installs the project, the package manager ignores the flexible package.json ranges and strictly enforces the exact tree defined in the lock file&quot;.&amp;nbsp;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;package.json:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;From &lt;a href=&quot;https://heynode.com/tutorial/what-packagejson/&quot; target=&quot;_blank&quot;&gt;HeyNode / What is Package.json&lt;/a&gt;: &lt;br /&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&quot;If you’ve worked with Node.js before, you have likely encountered a package.json file. It is a &lt;a href=&quot;http://www.json.org/&quot;&gt;JSON&lt;/a&gt; file that lives in the root directory of your project. Your package.json holds important information about the project. It contains human-readable metadata about the project (like the project name and description) as well as functional metadata like the package version number and a list of dependencies required by the application.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&quot;Your project’s package.json is the central place to configure and describe how to interact with and run your application. It is used by the npm CLI (and yarn) to identify your project and understand how to handle the project’s dependencies. It’s the package.json file that enables npm to start your project, run scripts, install dependencies, publish to the NPM registry, and many other useful tasks. The npm CLI is also the best way to manage your package.json because it helps generate and update your package.json file throughout a project’s life.&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&quot;Your package.json fills several roles in the lifecycle of your project, some of which only apply for packages published to NPM. If you’re not publishing your project to the NPM registry or otherwise making it publicly available to others, your package.json is still essential to the development flow.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&quot;The &lt;b&gt;name &lt;/b&gt;field defines the name of the package. When publishing to the NPM registry, this is the name the package will be listed under. It must be no more than 214 characters, only lowercase letters, and it must be URL-safe (hyphens and underscores allowed, but no spaces or other characters disallowed in URLs).&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&quot;The &lt;b&gt;version &lt;/b&gt;field is very important for any published package, and required before publishing. It is the current version of the software that the package.json is describing.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&quot;You are not required to use &lt;a href=&quot;https://docs.npmjs.com/about-semantic-versioning&quot;&gt;SemVer&lt;/a&gt;, but it is the standard used in the Node.js ecosystem and highly recommended. For an unpublished package, this property isn’t strictly required. Typically, the version number is bumped according to SemVer before publishing new versions to NPM. &lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&quot;The &lt;b&gt;license &lt;/b&gt;field lets us define what license applies to the code the package.json is describing. Again, this is very important when publishing a project to the NPM registry, as the license may limit the use of your software by some developers or organizations. Having a clear license in place helps clearly define what terms the software is able to be used under&quot;.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;
{
  &quot;name&quot;: &quot;bun-create-playwright&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
    &quot;test&quot;: &quot;playwright test&quot;
  },
  &quot;keywords&quot;: [],
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;type&quot;: &quot;commonjs&quot;,
  &quot;devDependencies&quot;: {
    &quot;@playwright/test&quot;: &quot;^1.62.1&quot;,
    &quot;@types/bun&quot;: &quot;latest&quot;,
    &quot;@types/node&quot;: &quot;^26.1.2&quot;
  },
  &quot;private&quot;: true,
  &quot;peerDependencies&quot;: {
    &quot;typescript&quot;: &quot;^5&quot;
  }
}      
      &lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;playwright.config.ts:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;This &lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot; target=&quot;_blank&quot;&gt;Playwright Configuration file&lt;/a&gt; is the central configuration file for a Playwright test project. It lives at the root of your project and tells Playwright how to run your tests: which browsers to use, where to find test files, how to handle failures, what reports to generate, etc. Instead of passing a dozen command-line flags every time you run tests, you define the settings once here.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;div&gt;
&lt;pre&gt;&lt;code&gt;
import { defineConfig, devices } from &#39;@playwright/test&#39;;

/**
 * Read environment variables from file.
 * https://github.com/motdotla/dotenv
 */
// import dotenv from &#39;dotenv&#39;;
// import path from &#39;path&#39;;
// dotenv.config({ path: path.resolve(__dirname, &#39;.env&#39;) });

/**
 * See https://playwright.dev/docs/test-configuration.
 */
export default defineConfig({      &lt;/code&gt;
&lt;/pre&gt;      
      &lt;br /&gt;Breakdown of the main components&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;testDir&lt;/b&gt;: points Playwright to the folder containing your spec files.&lt;/li&gt;&lt;li&gt;&lt;b&gt;fullyParallel&lt;/b&gt;: controls whether tests within a single file run in parallel workers rather than sequentially.&lt;/li&gt;&lt;li&gt;&lt;b&gt;forbidOnly&lt;/b&gt;: a safety check, usually enabled only in CI, that fails the build if test.only was left in the code.&lt;/li&gt;&lt;li&gt;&lt;b&gt;retries&lt;/b&gt;: how many times a failed test is retried before being marked as failed. Commonly set higher in CI than locally.&lt;/li&gt;&lt;li&gt;&lt;b&gt;workers&lt;/b&gt;: how many tests run concurrently. CI environments often limit this to avoid resource contention.&lt;/li&gt;&lt;li&gt;&lt;b&gt;reporter&lt;/b&gt;: determines the output format for test results (HTML report, list in the terminal, JUnit XML for CI integration, etc). You can specify multiple reporters at once.&lt;/li&gt;&lt;li&gt;&lt;b&gt;use&lt;/b&gt;: shared defaults inherited by every test, unless overridden at the project or test level. Common settings here:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;baseURL for relative navigation &lt;/li&gt;&lt;li&gt;trace for capturing a debuggable trace of the test run &lt;/li&gt;&lt;li&gt;screenshot and video for failure artifacts &lt;/li&gt;&lt;li&gt;headless to control whether the browser UI is shown &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;projects: defines the different browser/device combinations to run the same test suite against. Each project can also override anything in use. This is how you get cross-browser coverage without duplicating test code.&lt;/li&gt;&lt;/ul&gt;With the next post, we are going to make some changes to the project per Playwright Ambassador Butch Mayhew&#39;s recommendation.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
  &lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  
  &lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/684749975742149467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/684749975742149467'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/684749975742149467'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html' title='What happens when you scaffold a Playwright framework and run installed tests using bun?'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEiXctKCd4pvQbwjsbEHO8s0z3slVGJdvPXcJnOi5kY64GDzY0fDp5oBkCSuJNycXgS3RziW_kGXLB0q5iMwI79QxuRDJJ3-08T0mGt4evCqlMBzhZa8KB-w31DIOf_OsspME2rJrWI3YltGuJm1JYHljma6JsWxtjJZBGGFVsnedk4P80W45tJH01wOV6c=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-1210964296227663634</id><published>2026-08-05T21:58:25.754-04:00</published><updated>2026-08-24T22:35:38.371-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bun-create-playwright"/><title type='text'>Introducing bun, a new package manager and JavaScript runtime environment</title><content type='html'>&lt;div&gt;New job? New toolset to explore! In this post I&#39;ll be investigating a new JavaScript package manager and runtime environment called &lt;a href=&quot;http://bun.sh&quot; target=&quot;_blank&quot;&gt;bun.sh&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You may have noticed on Playwright.Dev&#39;s &lt;a href=&quot;https://playwright.dev/docs/intro&quot; target=&quot;_blank&quot;&gt;Getting Started / Installation section&lt;/a&gt; there are three different ways to install a ui or api test automation framework with the latest version of Playwright:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;npm init playwright@latest&lt;/li&gt;&lt;li&gt;yarn create playwright&lt;/li&gt;&lt;li&gt;pnpm create playwright&lt;/li&gt;&lt;/ul&gt;For this blog post I&#39;ll be investigating a fourth way, the new toolset they just started using at work,&amp;nbsp;&lt;a href=&quot;http://bun.sh&quot; target=&quot;_blank&quot;&gt;bun.sh&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;bun create playwright&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is npm, yarn, pnpm, and bun? These are called&lt;b&gt; package managers&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;What is a package&lt;/b&gt;? Developing a project, you don&#39;t have to figure out how to code everything yourself. You can include in your projects outside libraries, or &quot;packages&quot; of code from from the public JavaScript registry &lt;a href=&quot;http://npmjs.com&quot; target=&quot;_blank&quot;&gt;npmjs.com&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem is that these packages then need to be downloaded, installed, managed, and updated whenever they are updated. JavaScript projects can use a package manager, such as bun, to help this process.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When putting together a Playwright automation framework based around JavaScript and TypeScript, Playwright uses the Node.js JavaScript runtime environment, to run its test runner, execute automation scripts, and manage its browser instances.(See &lt;a href=&quot;https://nodejs.org/en/about&quot; target=&quot;_blank&quot;&gt;Nodejs.org / About&lt;/a&gt; )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a division of labor: Node.js runs these internal functions like running tests. NPM, Yarn, PNPM, and now Bun handle the packages.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why are there so many package managers? Each has its own specialization. The original NPM is bundled already with Node.js. Yarn is a Facebook toolset that was created when NPM was found to work too slow. PNPM was created to be smaller and therefore faster. And bun was built for quick startup and installation speed, good especially if you have a CI/ CD pipeline that has a LOT of packages to install each time the tests run.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;NPM&lt;/b&gt;, released in 2010, is the Node Package Manager for Node.js, a JavaScript Runtime Environment. According to NodeJS.org&#39;s&amp;nbsp;&lt;a href=&quot;https://nodejs.org/learn/getting-started/an-introduction-to-the-npm-package-manager#an-introduction-to-the-npm-package-manager&quot;&gt;An introduction to the npm package manager&lt;/a&gt;, &quot;The npm installs, updates and manages downloads of dependencies of your project. Dependencies are pre-built pieces of code, such as libraries and packages, that your Node.js application needs to work&quot;. NPM comes with &lt;b&gt;NPX &lt;/b&gt;(Node Package eXecute) is a command-line tool that runs third-party code, known as packages or dependencies, such as Playwright.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Yarn&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;a href=&quot;https://yarnpkg.com/&quot; target=&quot;_blank&quot;&gt;https://yarnpkg.com/&lt;/a&gt;, released in 2016,&amp;nbsp;is Facebook&#39;s answer to NPM. Facebook needed a lot of JavaScript packages downloaded at the same time. NPM downloaded them only sequentially, one after another, causing it to be very slow the bigger the project became. According to the Engineering at Meta blog article &lt;a href=&quot;https://engineering.fb.com/2016/10/11/web/yarn-a-new-package-manager-for-javascript/&quot;&gt;Yarn: A new package manager for JavaScript&lt;/a&gt;, &quot;As the size of [Facebook&#39;s] codebase and the number of engineers grew, we ran into problems with consistency, security, and performance&quot;.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Pnpm &lt;/b&gt;(Performant npm) is another JavaScript package manager, released in 2017. It uses symbolic links to organize the node_modules, increasing performance by decreasing the number of files needed.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Bun &lt;/b&gt;&lt;a href=&quot;https://bun.sh &quot; target=&quot;_blank&quot;&gt;https://bun.sh&amp;nbsp;&lt;/a&gt;released in 2021 and purchased by Anthropic in 2025, isn&#39;t just a package manager like NPM. It is a JavaScript runtime environment that was built to replace Node.js.&amp;nbsp;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In spite of the differences, there are many similarities between these package managers:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Package Registry&lt;/b&gt;: All tools fetch packages from the official&amp;nbsp;&lt;a href=&quot;http://npmjs.com&quot; target=&quot;_blank&quot;&gt;npmjs.com&lt;/a&gt;&amp;nbsp;site.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Manifest File&lt;/b&gt;: They all rely on &lt;b&gt;package.json&lt;/b&gt; to read and write project dependencies and scripts. They show the name, version, package manager, license, and more (See &lt;a href=&quot;https://docs.npmjs.com/cli/v11/configuring-npm/package-json&quot; target=&quot;_blank&quot;&gt;NPM Docs / Package.json&lt;/a&gt; or&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://yarnpkg.com/configuration/manifest&quot; target=&quot;_blank&quot;&gt;Yarn Package / Manifest&lt;/a&gt; )&lt;/li&gt;&lt;li&gt;&lt;b&gt;Dependency Folders&lt;/b&gt;: Each tool downloads packages into a local &lt;b&gt;node_modules&lt;/b&gt; folder inside your project directory.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Lockfiles&lt;/b&gt;: They use &lt;b&gt;lockfiles &lt;/b&gt;to ensure reproducible builds across different environments, such as package-lock.json. (See &lt;a href=&quot;https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json&quot; target=&quot;_blank&quot;&gt;NPM Docs / package-lock.json&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is also one main difference between the others and bun. NPM, Yarn, and PNMP are all built on top of Node.js. Bun is built using an entirely new language interacting with Apple&#39;s JavaScriptCore engine, developed by Apple for Safari.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h2&gt;NPM with V8 vs Apple&#39;s JavaScriptCore&lt;/h2&gt;&lt;div&gt;NPM is built with V8 and Bun is built on JavaScriptCore... But what is V8 and JavaScriptCore?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;According to the Codeverse Chronicle article,&amp;nbsp;&lt;a href=&quot;https://codeverse-chronicles.vercel.app/blogPost/6509b9c36106ed74e339811a&quot; target=&quot;_blank&quot;&gt;JavaScriptCore vs V8 Engine&lt;/a&gt;, &quot;JavaScriptCore [...] , is the JavaScript engine developed by Apple. It powers the JavaScript execution within Apple&#39;s Safari browser and is also utilized in various macOS and iOS applications. JavaScriptCore is an open-source project, making its codebase accessible to developers and allowing for contributions from the community.&lt;/div&gt;&lt;br /&gt;&quot;JavaScriptCore is deeply integrated into the Apple ecosystem, which means it&#39;s optimized for Safari and other Apple products. This tight integration ensures excellent performance and compatibility within the Apple ecosystem.&lt;br /&gt;&lt;br /&gt;&quot;[The] V8 Engine is developed by Google and is widely known for powering the Chrome browser. It&#39;s also used in other projects like Node.js and various server-side applications&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;About Bun&lt;/h2&gt;&lt;div&gt;Attempting to construct a Minecraft-like game, Jarred Sumner found Next.js painfully slow when trying to save and test his work. Bun initially interacted with the JavaScriptCore engine using the &lt;a href=&quot;https://ziglang.org/&quot; target=&quot;_blank&quot;&gt;Zig programming language&lt;/a&gt;, but converted it to the &lt;a href=&quot;https://rust-lang.org/&quot; target=&quot;_blank&quot;&gt;Rust programming language&lt;/a&gt; in 2026.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Installing Bun:&amp;nbsp;&lt;a href=&quot;https://bun.com/docs/installation&quot;&gt;https://bun.com/docs/installation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Creating a project:&amp;nbsp;&lt;a href=&quot;https://bun.com/docs/runtime/templating/create&quot;&gt;https://bun.com/docs/runtime/templating/create&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Running a project:&amp;nbsp;&lt;a href=&quot;https://bun.com/docs/runtime&quot;&gt;https://bun.com/docs/runtime&lt;/a&gt;&lt;/li&gt;&lt;li&gt;GitHub site:&amp;nbsp;&lt;a href=&quot;https://github.com/oven-sh/bun&quot;&gt;https://github.com/oven-sh/bun&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;According to the &lt;a href=&quot;https://github.com/oven-sh/bun&quot; target=&quot;_blank&quot;&gt;GitHub README for Bun&lt;/a&gt;, &quot;At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It&#39;s written in Rust and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.&lt;br /&gt;&lt;br /&gt;&quot;The bun command-line tool also implements a test runner, script runner, and Node.js-compatible package manager. Instead of 1,000 node_modules for development, you only need bun. Bun&#39;s built-in tools are significantly faster than existing options and usable in existing Node.js projects with little to no changes&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is one more thing about Bun... it was purchased by Anthropic to be used in Claude Code.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;From the press release,&amp;nbsp;&lt;a href=&quot;https://www.anthropic.com/news/anthropic-acquires-bun-as-claude-code-reaches-usd1b-milestone&quot; target=&quot;_blank&quot;&gt;Anthropic acquires Bun as Claude Code reaches $1B milestone&lt;/a&gt;:&lt;/div&gt;&lt;div&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&quot;Bun is redefining speed and performance for modern software engineering and development. Founded by Jarred Sumner in 2021, Bun is dramatically faster than the leading competition. As an all-in-one toolkit—combining runtime, package manager, bundler, and test runner—it&#39;s become essential infrastructure for AI-led software engineering, helping developers build and test applications at unprecedented velocity.&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&quot;Bun has improved the JavaScript and TypeScript developer experience by optimizing for reliability, speed, and delight. For those using Claude Code, this acquisition means faster performance, improved stability, and new capabilities. Together, we’ll keep making Bun the best JavaScript runtime for all developers, while building even better workflows into Claude Code.&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&quot;[...] Bun represents exactly the kind of technical excellence we want to bring into Anthropic,&quot; said Mike Krieger, Chief Product Officer of Anthropic. &quot;Jarred and his team rethought the entire JavaScript toolchain from first principles while remaining focused on real use cases. Claude Code reached $1 billion in run-rate revenue in only 6 months, and bringing the Bun team into Anthropic means we can build the infrastructure to compound that momentum and keep pace with the exponential growth in AI adoption.&quot;&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&quot;As developers increasingly build with AI, the underlying infrastructure matters more than ever—and Bun has emerged as an essential tool. Bun gets more than 7 million monthly downloads, has earned over 82,000 stars on GitHub, and has been adopted by companies like Midjourney and Lovable to increase speed and productivity.&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&lt;/p&gt;&lt;p class=&quot;Body-module-scss-module__z40yvW__reading-column body-2 serif post-text&quot; style=&quot;background-color: #faf9f5; box-sizing: inherit; color: #141413; font-family: anthropicSerif, &amp;quot;anthropicSerif Fallback&amp;quot;, serif; font-feature-settings: &amp;quot;pnum&amp;quot;, &amp;quot;lnum&amp;quot;, &amp;quot;liga&amp;quot;; font-size: 17px; letter-spacing: 0px; line-height: 26.35px; margin: 1rem auto; max-width: 640px; width: 640px;&quot;&gt;&quot;The decision to acquire Bun is in line with our strategic, disciplined approach to acquisitions: we will continue to pursue opportunities that bolster our technical excellence, reinforce our strength as the leader in enterprise AI, and most importantly, align with our principles and mission&quot;.&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;How to Install Bun&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to the&amp;nbsp;&lt;a href=&quot;https://github.com/oven-sh/bun#install&quot; target=&quot;_blank&quot;&gt;GitHub README for Bun&lt;/a&gt;, you can install Bun on your MacBook using HomeBrew, with Curl, with NPM, or pulling down an image from Docker.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On Windows, you can use PowerShell. Since I use a Windows PC at home, I&#39;ll install it that way:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;pre style=&quot;background-color: #f6f8fa; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; min-height: 52px; overflow-wrap: normal; overflow: auto; padding: 16px; tab-size: 4; word-break: normal;&quot;&gt;powershell -c &lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #0a3069;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;irm bun.sh/install.ps1 | iex&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Restarting my PowerShell Terminal, checking that bun was installed correctly:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;pre style=&quot;background-color: #f6f8fa; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; min-height: 52px; overflow-wrap: normal; overflow: auto; padding: 16px; tab-size: 4; word-break: normal;&quot;&gt;bun -version&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;... And it replied I am using version 1.3.14. Wonderful! It&#39;s alive! It&#39;s .... alive! Had the installation not gone successfully, it would have errored out.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the next blog post, we will figure out how to use bun to create a Playwright framework.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Bun Create Playwright:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html&quot;&gt;Introducing bun, a new package manager and JavaScript runtime environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html&quot;&gt;What happens when you scaffold a Playwright framework and run installed tests using bun?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/add-type-checking-and-tsconfig-to-bun.html&quot;&gt;Add Type Checking and TSConfig to Bun-Create-Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/checking-code-with-lint-formatting-it.html&quot;&gt;Checking code with lint, formatting it with prettier&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/running-tests-with-playwright-test.html&quot;&gt;Running Tests with Playwright Test Explorer and Generating Tests with Codegen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Six:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html&quot;&gt;&amp;nbsp;How Playwright Frameworks get configured with playwright.config.ts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Seven:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/implementing-page-objects-in-playwright.html&quot;&gt;Implementing Page Objects in Playwright&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Eight:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/08/how-to-configure-playwright-test-to-run.html&quot;&gt;How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/08/setting-up-ci-cd-pipeline-with-gitlab.html&quot;&gt;Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab:&lt;/b&gt; &lt;a href=&quot;https://gitlab.com/tjmaher/bun-create-playwright&quot;&gt;https://gitlab.com/tjmaher/bun-create-playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;  

&lt;/div&gt;&lt;div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/1210964296227663634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/1210964296227663634'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/1210964296227663634'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/08/introducing-bun-new-package-manager-and.html' title='Introducing bun, a new package manager and JavaScript runtime environment'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7158269457034519702</id><published>2026-06-29T20:51:55.895-04:00</published><updated>2026-06-29T20:51:55.896-04:00</updated><title type='text'>Does giving a presentation via Zoom to the Sydney Testers Meetup make me an international speaker? </title><content type='html'>If I presentation to the Sydney Testers Meetup in Australia, from my home in the Massachusetts, through Zoom, does that make me an international speaker? [ &lt;a href=&quot;https://www.linkedin.com/posts/tjmaher1_if-i-presentation-to-the-sydney-testers-meetup-ugcPost-7477520117329747968-1REI/?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAAAA8wfYBpAyZ0pTDZvsInQZl3dpfWfJ_riU&quot;&gt;Vote in the New Poll, on LinkedIn&lt;/a&gt; ]&lt;br /&gt;&lt;br /&gt;There is still time to sign up for the event at: &lt;a href=&quot;https://www.meetup.com/sydney-testers/events/315166776&quot;&gt;https://www.meetup.com/sydney-testers/events/315166776&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&quot;T.J. Maher, the former organiser at Ministry of Testing Boston, blogger and speaker, will be presenting from the US on using the Detox framework to create effective test automation frameworks for React Native applications.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;&lt;b&gt;Building a React Mobile Automated Test Framework using Detox + TypeScript by T.J. Maher&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&quot;Writing automated tests for a React Native mobile application is notoriously difficult. Mobile components display on the page, but are not fully loaded. Lengthy animations and slow-loading components take a while to finish. Timing issues cause your automated tests to error out giving the appearance of flaky tests.&lt;br /&gt;&lt;br /&gt;&quot;T.J. Maher will be sharing his experience tackling these problems using the open-source mobile testing framework, Wix&#39;s Detox, designed specifically for testing React Native applications.&lt;br /&gt;&lt;br /&gt;* &quot;Setting up a mobile test automation framework.&lt;br /&gt;&lt;br /&gt;* &quot;Vibe-coding a toy React Mobile Login page app to test against ( &lt;a href=&quot;https://tinyurl.com/detox-demo&quot;&gt;tinyurl.com/detox-demo&lt;/a&gt; ).&lt;br /&gt;&lt;br /&gt;* &quot;How to reduce timing issues and flakiness in automated tests.&lt;br /&gt;&lt;br /&gt;* &quot;Refactoring code into tests, page objects &amp;amp; base pages, separating out credentials and message strings for easier maintainability.&lt;br /&gt;&lt;br /&gt;* &quot;Setting up automated tests in CI / CD for iOS simulators and Android emulators with GitHub Action Workflows.&lt;br /&gt;&lt;br /&gt;* &quot;How developers can test their code before they push it into the main branch.&lt;br /&gt;&lt;br /&gt;&quot;About T. J. Maher:&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;&quot;A former organizer of the now defunct Ministry of Testing - Boston, T.J. Maher is a Senior Software Development Engineer in Test (SDET), based in the Boston/South Shore area of Massachusetts, with a decade of experience building web + mobile test automation frameworks. His recent work includes architecting a mobile automation framework from the ground up using Detox and TypeScript for a React Native application at SELF ID, a decentralized identity startup. Prior roles include MassMutual, Verily (Google Health), Threat Stack, Fitbit, and Intralinks. &lt;br /&gt;&lt;br /&gt;&quot;T.J. Maher is @tjmaher1 on LinkedIn, Twitter and BlueSky. His software testing blog is &lt;a href=&quot;https://tjmaher.com&quot;&gt;tjmaher.com&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&quot;Follow him on LinkedIn!&quot;&lt;br /&gt;&lt;br /&gt;... And I am now a Senior SDET at AAA Life Insurance!&lt;br /&gt;&lt;br /&gt;Slide Deck is at &lt;a href=&quot;https://tinyurl.con/detox-demo-sydney&quot;&gt;https://tinyurl.con/detox-demo-sydney&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7158269457034519702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/does-giving-presentation-via-zoom-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7158269457034519702'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7158269457034519702'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/does-giving-presentation-via-zoom-to.html' title='Does giving a presentation via Zoom to the Sydney Testers Meetup make me an international speaker? '/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-9017584170872000696</id><published>2026-06-17T19:26:28.021-04:00</published><updated>2026-06-21T08:03:37.317-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sqgne"/><title type='text'>Achievement Unlocked: T.J. Maher Elected to the Board of Directors of the Software Quality Group of New England - SQGNE.org</title><content type='html'>&lt;div&gt;I&#39;ve been elected to be on the Board of Directors of the &lt;b&gt;Software Quality Group of New England&lt;/b&gt; (&lt;a href=&quot;http://sqgne.org&quot;&gt;sqgne.org&lt;/a&gt;) on the volunteer leadership committee!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The Software Quality Group of New England (SQGNE) is an all-volunteer, nonprofit professional community in New England dedicated to software quality. Since its founding, SQGNE has brought together QA engineers, SDETs, and software quality professionals for monthly educational presentations, discussions, and networking -- covering everything from testing techniques and process improvement to the latest tools and industry trends.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I also have founded and moderate an online monthly &lt;b&gt;SDET Lean Coffee &lt;/b&gt;discussion group, bringing together software development engineers in test, quality engineers, and automation practitioners to exchange ideas, challenges, and emerging practices.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After our hiatus during the summer, we will be meeting monthly up in Burlington, MA. &lt;a href=&quot;https://sqgne.org&quot; target=&quot;_blank&quot;&gt;Check us out&lt;/a&gt;!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/9017584170872000696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/achievement-unlocked-volunteer-director.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/9017584170872000696'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/9017584170872000696'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/achievement-unlocked-volunteer-director.html' title='Achievement Unlocked: T.J. Maher Elected to the Board of Directors of the Software Quality Group of New England - SQGNE.org'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-4332974255761416044</id><published>2026-06-12T14:10:14.954-04:00</published><updated>2026-06-12T14:40:41.474-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI"/><category scheme="http://www.blogger.com/atom/ns#" term="James Bach"/><category scheme="http://www.blogger.com/atom/ns#" term="Rapid Software Testing"/><category scheme="http://www.blogger.com/atom/ns#" term="RST"/><title type='text'>Testing and AI Workshop by James Bach of Rapid Software Testing - Notes</title><content type='html'>&lt;div&gt;Last week, I saw that there was a new half day workshop by one of the creators of Rapid Software Testing, &lt;b&gt;James Bach&lt;/b&gt;, &lt;a href=&quot;https://www.satisfice.com/events/testing-and-ai-workshop&quot; target=&quot;_blank&quot;&gt;Testing and AI Workshop&lt;/a&gt;, and that they were offering a 50% discount for anyone who was unemployed, so I just had to attend.&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Visit James Bach&#39;s &lt;a href=&quot;https://www.satisfice.com/downloads&quot; target=&quot;_blank&quot;&gt;Satisfice.com Download Page&lt;/a&gt; to download PDFs on topics such as &lt;a href=&quot;https://www.satisfice.com/download/responsible-work-2&quot;&gt;Responsible Work&lt;/a&gt; (May 2026), &lt;a href=&quot;https://www.satisfice.com/download/responsible-work&quot; target=&quot;_blank&quot;&gt;AI Writing Policy&lt;/a&gt; (April 2026),&amp;nbsp;&lt;a href=&quot;https://www.satisfice.com/download/heuristic-test-strategy-model&quot; target=&quot;_blank&quot;&gt;Heuristic Test Strategy Model&lt;/a&gt; (December 2024), &lt;a href=&quot;https://www.satisfice.com/download/rst-appendices&quot; target=&quot;_blank&quot;&gt;Rapid Software Testing Explored Class Appendices&lt;/a&gt; (December 2024) &lt;a href=&quot;https://www.satisfice.com/download/why-testers&quot; target=&quot;_blank&quot;&gt;Why Testers?&lt;/a&gt; (Oct 2024) and &lt;a href=&quot;https://www.satisfice.com/download/appendix-chatgpt-sucks-at-being-a-testing-expert&quot; target=&quot;_blank&quot;&gt;ChatGPT Sucks at Being a Testing Expert&lt;/a&gt; (August 2023)&lt;/li&gt;&lt;li&gt;&lt;b&gt;YouTube Channel&lt;/b&gt;: &lt;a href=&quot;https://www.youtube.com/@rapid_software_testing&quot; target=&quot;_blank&quot;&gt;Rapid Software Testing&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Check out &lt;b&gt;James Bach&#39;s&lt;/b&gt; &lt;b&gt;Classes&lt;/b&gt; at&amp;nbsp;&lt;a href=&quot;https://www.satisfice.com/classes&quot;&gt;https://www.satisfice.com/classes&lt;/a&gt;&amp;nbsp;(50% discount if unemployed)&lt;/li&gt;&lt;li&gt;The next &lt;a href=&quot;https://www.satisfice.com/events/testing-and-ai-workshop-usa&quot; target=&quot;_blank&quot;&gt;Testing and AI Workshop&lt;/a&gt; will be July 6, 2026&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&quot;In each session, the instructors will first perform a live &#39;testopsy.&#39; This is a demonstration of AI-assisted testing (using both assistive and agentic modes of AI) on a real product, accompanied by an analysis and explanation of what happened during the demo. During this part of the workshop, you may ask questions or offer critique.&lt;br /&gt;&lt;br /&gt;&quot;Next the instructors will challenge you to perform a similar process or solve a similar problem with the help of AI. You will have two hours. You will be able to work alone or in groups, as you like.&lt;br /&gt;&lt;br /&gt;&quot;Finally, the instructors will review and critique your work, if you choose to share it. At the end of the event, you will get to keep the videos&quot;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I really enjoyed the class! It involved an hour-and-a-half webinar, where James Bach walks people though how he uses AI, a few hours where you can work on your own project for the course, then another hour-and-a-half webinar where course attendees could review what they came up with to analyze a site.&amp;nbsp;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My only problem with the course was that my rambunctious seven year old was home sick, and I wasn&#39;t able to dedicate a few hours to come up with how to use AI to test a website, since I was busy making lunch and chatting with my kiddo.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What Is the Rapid Software Testing Approach?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a software tester, I&#39;m familiar with some of Michael Bolton and James Bach&#39;s work on the &lt;a href=&quot;https://rapid-software-testing.com/&quot; target=&quot;_blank&quot;&gt;Rapid Software Testing&lt;/a&gt; and &lt;a href=&quot;https://www.satisfice.com/&quot;&gt;Satisfice&lt;/a&gt; websites:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://developsense.com/blog/2009/08/testing-vs-checking&quot; target=&quot;_blank&quot;&gt;Testing vs Checking&lt;/a&gt; (2009) and &lt;a href=&quot;https://www.satisfice.com/blog/archives/856&quot; target=&quot;_blank&quot;&gt;Testing vs Checking Refined&lt;/a&gt; (2024)&lt;/li&gt;&lt;li&gt;Michael Bolton&#39;s &lt;a href=&quot;https://developsense.com/blog/2010/05/testers-get-out-of-the-quality-assurance-business&quot; target=&quot;_blank&quot;&gt;Testers: Get Out of the Quality Assurance Business&lt;/a&gt;&lt;/li&gt;&lt;li&gt;James Bach&#39;s &lt;a href=&quot;https://www.satisfice.com/download/test-automation-snake-oil&quot;&gt;Test Automation Snake Oil&lt;/a&gt;&amp;nbsp;(2021)&lt;/li&gt;&lt;li&gt;Cem Kaner, James Bach, and Bret Pettichord&#39;s &lt;a href=&quot;https://www.amazon.com/Lessons-Learned-Software-Testing-Context-Driven/dp/0471081124/&quot; target=&quot;_blank&quot;&gt;Lessons Learned in Software Testing: A Context-Driven Approach&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;...&amp;nbsp; Back when I was a Meetup Organizer of the Ministry of Testing - Boston, I had many fans of RST try to convince me to no longer say &quot;Automated Testing&quot;, and say only &quot;Automated Checking&quot;, since computer programs can&#39;t think or test. And not to say &quot;Quality Assurance&quot; ever, since software testers are not product owners, managers, or developers, and cannot set the schedule, assuring any quality.&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Although I have never taken any of Rapid Software Testing&#39;s classes before, but I did just purchase their newly released book, &lt;a href=&quot;https://www.amazon.com/Taking-Testing-Seriously-Software-Approach/dp/1394253192&quot; target=&quot;_blank&quot;&gt;Taking Testing Seriously: The Rapid Software Testing Approach&lt;/a&gt;&amp;nbsp;(2025), though.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not familiar with Rapid Software Testing? Watch Michael Bolton give a talk at Quality Jam 2017,&amp;nbsp;&lt;/div&gt;&lt;div&gt;&quot;&lt;b&gt;A Ridiculously Rapid Introduction to Rapid Software Testing&lt;/b&gt;&quot;&lt;br /&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; src=&quot;https://www.youtube.com/embed/AS2kuD--z44?si=abz3MeOOs5TpGtGa&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;&lt;i&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=AS2kuD--z44&amp;amp;t=3018s&quot;&gt;https://www.youtube.com/watch?v=AS2kuD--z44&amp;amp;t=3018s&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Or you can take a look at James Bach &amp;amp; Michael Bolton&#39;s presentation to CAST2020 (The Conference for the Association for Software Testing 2020) in Austin, TX, &lt;br /&gt;&lt;b&gt;Testopsies Dissecting Your Testing&lt;/b&gt;.&lt;/div&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; src=&quot;https://www.youtube.com/embed/dz2g_LUt2Wk?si=kt7h3apwifCUNe14&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;  
  
  
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James Bach, during the class, shared some documentation:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Satisfice / Download /&amp;nbsp;&lt;a href=&quot;https://www.satisfice.com/download/rst-appendices&quot;&gt;RST Appendices&lt;/a&gt;, which lists more about Rapid Software Testing, and the difference between it and &quot;Factory Style&quot; testing such as ISTQB, Six Sigma, TQM, or RUP. It also has some sample test plans.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082&quot; target=&quot;_blank&quot;&gt;Responsibility is the Human Moat&lt;/a&gt;, covering his &lt;b&gt;Principles of Responsible Work v 2.0&lt;/b&gt;, detailing how it is the person who is prompting the AI is responsible for the work of the AI, and have the power to reject or remediate the work the AI produces.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James Bach and his brother John ran the workshop session. It turns out that James&#39; brother is also a software tester!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James has been experimenting with LLMs since Chat GPT came out. This experimental workshop is to help unemployed people who are trying to reskill. It isn&#39;t exactly like his three day AI and Testing class. James and John tailored this workshop to be taken in one day.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Testing is a Human activity. AI is not testing. AI can not do professional testing. AI can do exploratory analysis. But the human needs to review and validate the result. AI is just another tool a software tester can use.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;An LLM can make up stories that are partially true, but it can not tell what it was thinking when exploring, since LLMs do not think.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Application under test we would be exploring with AI? &lt;b&gt;The Online Gantt Chart&lt;/b&gt; at &lt;a href=&quot;https://www.onlinegantt.com/&quot; target=&quot;_blank&quot;&gt;https://www.onlinegantt.com/&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Principles of Responsible Work&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James &amp;amp; John Bach and Michael Bolton just released the above listed&amp;nbsp;&lt;b&gt;Principles of Responsible Work &lt;/b&gt;paper in May 2026. In spite of all their experience, they are always trying to see how they can make things better, which resulted in these principles. Some of the principles they cover are:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&quot;&lt;b&gt;Every non-trivial business comprises some set of services that enable it to function&lt;/b&gt;. Examples include sales, accounting, R&amp;amp;D, customer support, etc. These services must be sufficiently reliable or else the business will collapse.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&quot;&lt;b&gt;Every service entails the risk of failure&lt;/b&gt;. When failures occur, the business must be able to recognize them and recover. In regulated industries, risk management may be subject to specific process mandates.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&quot;&lt;b&gt;A &#39;responsible person&#39; is a natural person in a business who is reasonably competent, prepared, and accountable for some service that sustains or defines that business&lt;/b&gt;. No matter what tools or processes are used within a business, someone must be responsible for them. To bear responsibility, a person must have sufficient capacity. For instance, neither a child nor a tool (such as AI) has the capacity (either legally or socially) to bear responsibility. Even adult humans may lack capacity, such as when an airline pilot has had insufficient sleep or is under the influence of drugs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&quot;&lt;b&gt;A &#39;responsible service&#39; is one that is performed in good faith by a responsible person&lt;/b&gt;. This may include interpreting and following procedures, improving skills, anticipating problems, and reporting to relevant authorities or clients, both inside and outside the business&quot;. &lt;i&gt;( See James Bach&#39;s&amp;nbsp;&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082&quot; target=&quot;_blank&quot;&gt;Responsibility is the Human Moat&lt;/a&gt;&amp;nbsp;for more )&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;This begs the question... what is the &lt;b&gt;Responsible Operation of AI&lt;/b&gt;? &lt;br /&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Responsible Operation of AI&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;&lt;b&gt;AI cannot bear responsibility&lt;/b&gt;.&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082#_ftn1&quot;&gt;[1]&lt;/a&gt; AI is not a responsible person, and it would be meaningless to speak of a tool that operates in “good faith.” Therefore, it cannot provide a responsible service, nor can responsibility be delegated to it.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;An “AI agent” is always a tool operated by a natural person, irrespective of whether the person is monitoring it in real-time&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Thus, the operator of an AI agent always bears responsibility for the behavior of that agent&lt;/b&gt;.&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082#_ftn2&quot;&gt;[2]&lt;/a&gt; This includes anticipating availability issues, such as outages, token rationing, or poor performance.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;The responsible operator must assure adequate quality of the work&lt;/b&gt;; they cannot merely prompt and pray.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&quot;Therefore, the operator must…&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&quot;be sufficiently skilled in the use of the AI tool&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;be sufficiently prepared to operate the tool in that context&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;be sufficiently alert to risks, anomalies, or defects that may occur in the work.&lt;/b&gt;&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082#_ftn3&quot;&gt;[3]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;reasonably anticipate restrictions or interruptions of the services on which the work depends&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;feel empowered (and actually have the power) to reject or remediate any work done by AI&lt;/b&gt;. Otherwise, the operator becomes a scapegoat, a “moral crumple zone.”&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082#_ftn4&quot;&gt;[4]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;avoid or mitigate the special hazards of AI operation&lt;/b&gt;&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;i&gt;( See James Bach&#39;s&amp;nbsp;&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082&quot; target=&quot;_blank&quot;&gt;Responsibility is the Human Moat&lt;/a&gt; for more )&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Special Hazards of AI Operation&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;https://www.satisfice.com/blog/archives/488082&quot; target=&quot;_blank&quot;&gt;Responsibility is the Human Moat&lt;/a&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;details the &lt;b&gt;Special Hazards of AI Operation&lt;/b&gt;, with categories such as:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Technological&lt;/b&gt;: Service Outage, Service Adulteration&lt;/li&gt;&lt;li&gt;&lt;b&gt;Interactional&lt;/b&gt;: Cognitive Overload, Cognitive Debt, Cognitive Atrophy, Cognitive Surrender, Anthropomorphism and Anthropomorphizing, Automation Bias, Chronic Stress&lt;/li&gt;&lt;li&gt;&lt;b&gt;Managerial&lt;/b&gt;: Data Negligence, Reckless Spending, Violations of Law, Moral Crumple Zone, Business Disruption.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;What is the &lt;b&gt;Moral Crumple Zone&lt;/b&gt;? As James Bach puts it, &quot;This can occur in an automated system that has a human operator or supervisor (such as a self-driving car with a safety driver, or an ordinary user of ChatGPT). It happens when a failure of the system is routinely and carelessly blamed on the human. The human functions as a sort of &#39;crumple zone&#39; in the moral sense: a component designed to assume blame in order to deflect it from the automation&quot;.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What can you do with AI in Testing?&lt;/h2&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Product Analysis, identifying testable elements&lt;/li&gt;&lt;li&gt;Risk Analysis, identifying potential problems&lt;/li&gt;&lt;li&gt;Test Design, generating test ideas&lt;/li&gt;&lt;li&gt;Test Data Synthesis&lt;/li&gt;&lt;li&gt;Test Oracles, analyzing output&lt;/li&gt;&lt;li&gt;Static Analysis, analyzing code and data structures&lt;/li&gt;&lt;li&gt;Test Tool Implementation&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;This is what James finds most interesting using AI in Testing... AI can actually allow you to create your own test tools with Claude Code. You can experiment with tools to help you test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you point AI at a software product, and ask it to come up with a list of features. AI is slow, clunky, expensive, and misses a lot of stuff, so it is not quite there yet.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not sure if AI can do something? Just try it out. Ask if it can do something. Experiment.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Heuristics for Evaluating GenAI Work&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To use AI responsibility, it isn&#39;t enough to ask the right questions. James Bach and Michael Bolton prepared a checklist for being critical operators of GenAI. Some of the topics on the checklist are...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&quot;What did you do?&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;&lt;b&gt;How did you select the tool?&lt;/b&gt; What is your familiarity with the tool you used? Did you use GenAI directly or is it some tool that imposes a certain structure on your work? If the latter, what do you know about the role GenAI plays in that tool?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;How did you approach the problem?&lt;/b&gt; Be prepared to tell the story of your strategy for involving AI in this work. What problem specifically were you trying to solve? How did you prepare to use the AI? What part of the problem did you present to the AI? Did you use an interactive assistive approach or an agentic autonomous approach?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;How did you construct your prompts?&lt;/b&gt; How much and what kinds of context did you provide? Did you start simple and refine? Or did you submit a complicated one-shot prompt with explanations, supporting data, or examples?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;How did you follow-up your original prompt to shape the AI response?&lt;/b&gt; Were you in charge of the process? Did you control the refinement or were you constrained by the tool? Did you try the same question, or variations thereof, multiple times, or was it one connected conversation? If there were autonomous agents involved, how did you review what they did?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;How did you preserve the record of what happened?&lt;/b&gt; Was it stored automatically? Is any of it lost? Can you reproduce it? Can you access the logs in case you need to report in detail or perform follow-up work?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&quot;How did it go?&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;&lt;b&gt;Do you fully understand what the AI produced?&lt;/b&gt; If challenged, can you explain and defend (or critique) each part of the work?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;What did you learn while doing this work? &lt;/b&gt;Did the AI surprise you in any way? Did you try a new technique? Did you learn anything important about the AI tool’s ability to handle this kind of problem? Did you get any new ideas for how you could be either more productive or else more careful with AI?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Do you feel it gave helpful responses to your prompts?&lt;/b&gt; How was the first response? Were your efforts to refine that response rewarded? Did it ultimately solve the problem?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;In what way was it worth the effort and cost to solve this problem using this AI tool?&lt;/b&gt; Or was it not helpful? Could you have solved it in a simpler way with a web search, FAQ, or some other traditional tool?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;What is your assessment of the efficacy and reliability of this AI tool for this kind of work?&lt;/b&gt; Should users be on their guard, or is the worst-case scenario either not severe or else very improbable?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&quot;Did you notice any specific problems with the AI responses?&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&quot;Incorrectness&lt;/b&gt;. Did it hallucinate, give erroneous output, or contradict the data available to it?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Corrections&lt;/b&gt;. Did it ever claim to correct itself? If so, did it in fact correct itself, or did it make a new error?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Ungrounded&lt;/b&gt;. Did it fail to acquire the full details of your problem? Did it make silent, risky assumptions?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Unnecessary&lt;/b&gt;. Did it provide anything that was unhelpful or wasteful?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Omission&lt;/b&gt;. Could something important be missing from its output? Were there any important matters that it only acknowledged after you prompted it to do so?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Bias&lt;/b&gt;. In what ways might it have been biased? To detect bias, you might need to consider other methods of solving the problem, including solving it yourself and comparing your assumptions to the AI.&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Incongruence or Self-Repudiation&lt;/b&gt;. Did it make claims and later repudiate them? Did it say it would follow a procedure and then fail to follow it?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Awkward Interaction&lt;/b&gt;. If the process was conversational, did you feel rushed or overwhelmed during it? Did the AI lose track of questions or forget the state of the interaction? Were you in control during the process? Was the AI too accommodating, sycophantic, or placating?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Required Intervention&lt;/b&gt;. What part of its helpful responses depended on you to guide or correct it? If you had not been vigilant and provided only blank encouragement, would it have given a poor solution? Could a complete novice with no education or training have reached a good result using this AI tool?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&quot;How specifically did you evaluate the responses?&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&quot;Thoroughness&lt;/b&gt;. How closely and carefully did you study what the AI did? What evidence do you have that it performed acceptably? This can be a time-consuming process, so it’s common for users to perform only minimal checking of the output. However, GenAI is very good at creating credible and confident responses that are completely wrong. Never trust your first impression of GenAI responses.&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Testable Output&lt;/b&gt;. Did the tool provide supporting data or any other feature that helped you evaluate its output? What references did it provide? What indications of its thinking? What kind of metadata? How helpful was its formatting of the response? How did it guide you to help you understand the output?&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Possible Blind Spots&lt;/b&gt;. In what way could the AI have given you an erroneous or otherwise problematic response without you knowing it? Are there plausible-seeming facts in the response that you didn’t check and about which you have no personal knowledge? Is there any content that might be incomplete? If GenAI performs any operations or transformations on data, could it have dropped some of that data?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&quot;Now what?&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;&lt;b&gt;Double down on this approach?&lt;/b&gt; Maybe this experience showed promise, and you want to go further with it and complete the work.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Drop it and try something else? &lt;/b&gt;Maybe the journey was the reward. Maybe you’ve already gotten what you need from this without needing to preserve any of the specific results that the AI gave you. Maybe this approach to solving the problem didn’t work and you should try something else.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Consult with co-workers or clients about it?&lt;/b&gt; Remember that your reputation could depend on how others feel about your work. You might to run it by them and see what they think. They may have ideas for improving it, or concerns to share with you about it.&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Raise concerns about using AI for this kind of work?&lt;/b&gt; Did the AI do anything that scared you or represented a specific hazard that you should escalate?&lt;/li&gt;&lt;li&gt;&quot;&lt;b&gt;Test it more?&lt;/b&gt; Maybe you’re not sure what you’ve got and need more information to have an opinion. You can analyze what you’ve got or gather more information so you CAN analyze it.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Define or modify a protocol for using AI to do this&lt;/b&gt;? Maybe you know enough to make decisions about how you or your company will apply AI to problems of this kind&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Using AI to Test: Demo&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James Bach demoed testing &lt;b&gt;The Online Gantt Chart&lt;/b&gt; at &lt;a href=&quot;https://www.onlinegantt.com/&quot; target=&quot;_blank&quot;&gt;https://www.onlinegantt.com/&lt;/a&gt;&amp;nbsp;with prompts using Chat GPT and Claude Code.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James kept track of his work in a worksheet based on his &quot;Session Based Test Management&quot; worksheet ( &lt;a href=&quot;https://www.satisfice.com/download/session-based-test-management&quot; target=&quot;_blank&quot;&gt;Download PDF&lt;/a&gt; ) he and his brother developed at Hewlett Packard, he tracks time testing, metrics, etc.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;During the first part, a &lt;b&gt;Survey Session&lt;/b&gt;, James was trying to see what he can manually explore and discover. How can you use this tool?&amp;nbsp; What are the boundaries for text boxes? James did a preliminary analysis on what you can start exploring with AI.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James, after exploring for a bit, went to the setting screen, took the raw Document Object Model code of the web app, and add it to Chat GPT:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Prompt: &quot;Analyze the settings for onlinegannt and list them for me&quot;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Chat GPT then created an outline of all the settings.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Could you have told ChatGPT and get the information itself? Yes, but Chat GPT cannot press buttons. It might not have been able to go to the Settings screen. Sometimes, you don&#39;t want to &quot;Prompt and Pray&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Prompt: &quot;I would like to do combinatorial testing on the factors in this settings panel. What combinations do you suggest?&quot;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James is doing what he calls &quot;step back prompting&quot;. Start with a general prompt to see what information he can get, a soft prompt.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &quot;hardened prompt&quot; is very specific. James doesn&#39;t start off with this because he is worried what the biases of the LLM are.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James also doesn&#39;t want to experience cognitive overload, receiving more information that he can process. He is exploring the app using AI to find subtle bugs he might miss.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Ask Yourself: What Is The Main Thing We Need to Test?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;With the Online Gannt chart, the main thing we need to test is the display. If information is corrupted, if task get dropped, this product is useless.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Focus on: Is it usable? Reasonably charismatic?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James notices that as input, it accepts GANTT Files. If you want to enter a lot of data to see how the app handles it, you don&#39;t want to do it by hand. You can use AI to help you out.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Using AI To Create Tools&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;How can you generate a lot of data? You can use &lt;b&gt;Claude Code&lt;/b&gt; to create a tool.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James took a GANTT file, saved it to an empty directory.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Prompt: &quot;The file onlineganntt.gantt is a json that describes schedule data for a gantt chart. I need a Pythin program that generates random schedules that will enable me to test gantt charting software. The program must produce random schedules with N tasks (N is specific on the command line). The task should be between 1 and 10 days in length and connected using various dependency relations including no relation. Give the tasks generic self-descriptive names. The tool should process properly formatted JSON file with the suffix &#39;.gantt&#39; plus a csv table listing the details for each different task (for use as an oracle).&quot;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is an oracle?&amp;nbsp;It is a principle or mechanism by which you recognize a problem. Rather than being a rigid, absolute tool that delivers binary &quot;pass&quot; or &quot;fail&quot; checkmarks, Rapid Software Testing treats an oracle as a heuristic -- a fallible, experience-based guideline that points you in the right direction but can occasionally fail or mislead you.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If this prompt is successful, James would get a data file he would be able to input into Online Gantt.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With the CSV file, we will be able to check for accuracy in case the AI had messed up generating the file. Testing the Import functionality is part of our tests.&amp;nbsp;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Setting Claude protocols using Claude.md&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James has in his claude.md file for Claude Code, where it has been told to push back and ask questions on any prompts&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;&lt;b&gt;Critical Working Protocol:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;When I ask you do do something for me, or produce text, code, or anything else, ask questions to get more information about any ambiguous and critical matters.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;During any task, identify any risky or critical assumptions that either you or I may be making. Declare those assumptions.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;Present a plan and get approval before taking action. Write the plan to a file called &quot;plan-[project]-[date]-[ordinal value].md&quot;. The plans file should be stored in a plans directory that is located in the project directory. The plan file MUST include the full text of my prompt that immediately precipitated that plan.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;Before writing new code, always inform me of existing tools (command-line utilities, libraries, or open-source projects) that could fulfill the need. I want a detailed analysis. Include a section called &#39;Existing Solutions&#39; that includes this information when asking clarifying questions or presenting plans.&lt;/li&gt;&lt;li&gt;&quot;If multiple approaches exist (built-in tools vs writing code), present all options with trade-offs so I can choose.&lt;/li&gt;&lt;li&gt;&quot;If I ask for analysis, always put it into a file. If I don&#39;t say otherwise, perform a detailed analysis with high effort&quot;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;&quot;Testing:&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;DO NOT TEST anything you write for me, unless I ask you to.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;When you write code and it is ready to try, let me try it first and I will report any problems&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&quot;Git Style:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;.&quot;I want to be able to revert to earlier versions if I don&#39;t like the current version.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;Do not commit anything to Git unless the file is already being tracked.&quot;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When Claude started thinking about the problem, it then pushed back asking about task hierarchy, and alignment of subtasks, what resources to use, what the output filename should be, etc. James was then able to fine tune the prompt.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why tell Claude not to test? James thinks it wastes tokens. Also, anything Claude claims to have tested, James does not believe it. He wants to test things out for himself. James does not want to be lulled into a false sense of security.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Ask Claude to keep a file of what you are doing&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everything you asked Claude to do will go into a file, as a record of what you were working on with Claude. Because this information is going into a file, when an employer asks, &quot;What did you do?&quot; you as a tester can give an answer.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It also gives you a record you can review when you are done experimenting. James needs to piece it together for an article or a blog post or in the class material.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The other day, James asked Claude to use an MCP that was connected to Playwright, and use Playwright to explore Online Gantt. It took a few days to figure out how to do it, but it worked. Claude was slow, but it did explore it and give an analysis. When James said, give me the analysis, it gave the analysis. When asked to put the analysis in a file, it churned out for five minutes a new analysis in the file, three times larger that what it gave James.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James asked, what are you doing? Why is there so much more in the file? Claude said, well, it gave on screen only an overview of the analysis.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Don&#39;t Accept Any Tool Claude Generates. Test the Tool.&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After a lot of back and forth, Claude generated a tool in Python, generate_gantt.py.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Two files were produced: The file that was meant to be imported to Online Gantt, and the CSV file that had a copy of the data that could be examined in Microsoft Excel.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When the import file was uploaded, you could see that a lot of records were now showing... but were they correct?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Only by comparing the Online Gantt chart with the CSV could you see if the upload was interpreted correctly.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Careful Not To Have The AI Get Too Ahead of You!&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Working with AI, James was reminded of the western trope of the cowboy being dragged by horses across the desert.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are being given too much data by the AI for you to process, you might want to shrug without reviewing it all, and think that if the first few results were fine, the rest of the results were fine.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is best to work iteratively, one step at a time. Manage your cognitive load carefully.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Remember: You Need To Explain What You Are Doing With AI!&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once you finish a test session, ask yourself (and take notes on):&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;What did you do?&lt;/li&gt;&lt;li&gt;How did it go?&lt;/li&gt;&lt;li&gt;Did you notice any specific problems with the AI responses?&lt;/li&gt;&lt;li&gt;How specifically did you evaluate the responses?&lt;/li&gt;&lt;li&gt;Now what?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;These are discussed above with the &lt;b&gt;Heuristics for Evaluating GenAI Work&lt;/b&gt; by James Bach.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These reports you are having AI generate are good as a reference for yourself. It still might have hallucinations, but might be good enough for you. Recognize it might not be good enough for your employer. Do not give your employer any AI sloppiness that would waste their time. You need to do your due diligence.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;People will need to trust you, trust your work, and trust you are using AI well, James mentioned. If you do not review the work, you are responsible for any mistakes the AI might have made.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you practice using AI with testing, James predicts that one of the skills will be how to be efficient and effective in your use of tokens.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James relayed a time when a prompt he was doing was set up to retry on a failure. The AI then retried the same prompt 500 times in an hour. It didn&#39;t cost much, only ten dollars, but he just burned through ten dollars because of the tooling he was using.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are some things that the current generation of AI does really well, such as figuring out data formats. Before, he would try to figure it out first, then give it to the AI. Now? He doesn&#39;t have to do that. Most of the time it figures it out and does it well. His default approach is give it the raw file it needs and stand back. If it fails, then step in.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some things AI does not do well. If you ask it directly on questions you should ask when putting together a test plan, it may list out the fifteen things you need to ask yourself. But, if it starts &quot;testing&quot;, it will not do that. This is because AI is not a good tester, since it gets its information from the internet, and most people on the internet are not a good testers.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can try to make AI to be a better tester, by giving it such as James Bach&#39;s &lt;b&gt;Heuristic Test Strategy Model&lt;/b&gt; (&lt;a href=&quot;https://www.satisfice.com/download/heuristic-test-strategy-model&quot; target=&quot;_blank&quot;&gt;Download PDF&lt;/a&gt;). James was thinking about creating a file which details &quot;What is Rapid Software Testing&quot;?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... James said that maybe by then next time this session is run, he can create a skill for Claude that has this skill?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Be cautious when analyzing long lists of results&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James mentioned that when you are reviewing the list of what was examined by AI, you need to ask yourself, &quot;&lt;b&gt;What&#39;s not here&lt;/b&gt;? What did the AI not tell me&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a certain cognitive bias called the &lt;b&gt;part-set cuing effect&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the &lt;a href=&quot;https://en.wikipedia.org/wiki/Memory_inhibition&quot; target=&quot;_blank&quot;&gt;Wikipedia page, under &quot;Memory Inhibition&quot;&lt;/a&gt;, &quot;The &#39;part-set cuing effect&#39; was initially discovered by Slamecka (1968), who found that providing a portion of to-be-remembered items as test cues often impairs retrieval of the remaining un-cued items compared with performance in a no-cue (free-recall) control condition&quot;.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;James described it as such, &quot;If someone said, I need you to think about all the fruits that you can, for instance, apples, bananas, pineapples, lemons, oranges&quot;, it&#39;s harder to think of other types of fruit, since your brain says, &quot;Yep, those are fruit!&quot;. If you weren&#39;t given anything, your brain can think of more things. To protect yourself, before you see what AI comes up with, scribble down your ideas first.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;New Podcast: Humans in the Way&lt;/h2&gt;&lt;div&gt;James Bach mentioned that he started a new podcast on the &lt;a href=&quot;https://www.youtube.com/@rapid_software_testing&quot; target=&quot;_blank&quot;&gt;Rapid Software Testing YouTube&lt;/a&gt; channel, called Humans in the Way. He takes things that AI can do, breaks it down and analyze it.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Humans in the Way #1 &lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
  &lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; src=&quot;https://www.youtube.com/embed/X1dWeqYlF74?si=Y3cqz2KphJZ0IObq&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;&lt;a href=&quot;https://youtu.be/X1dWeqYlF74?si=JWcSDS6bBhtJL6iT&quot;&gt;&lt;i&gt;https://youtu.be/X1dWeqYlF74?si=JWcSDS6bBhtJL6iT&lt;/i&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Testing!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  
  
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/4332974255761416044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/testing-and-ai-workshop-by-james-bach.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4332974255761416044'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4332974255761416044'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/testing-and-ai-workshop-by-james-bach.html' title='Testing and AI Workshop by James Bach of Rapid Software Testing - Notes'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/AS2kuD--z44/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-4950204584584763411</id><published>2026-06-03T22:16:39.326-04:00</published><updated>2026-06-03T22:17:13.391-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AAA Life"/><category scheme="http://www.blogger.com/atom/ns#" term="sqgne"/><title type='text'>New Position Unlocked: Senior SDET at AAA Life Insurance, starting Monday, June 15th, 2026! </title><content type='html'>I have two announcements: I&#39;ve accepted a job offer as a &lt;b&gt;Senior SDET role&lt;/b&gt; at &lt;a href=&quot;https://www.linkedin.com/company/aaa-life-insurance-company/&quot;&gt;AAA Life Insurance Company&lt;/a&gt;, and will be starting &lt;b&gt;Monday, June 15th&lt;/b&gt;! And I have been nominated to be one of the volunteer Directors on the leadership board of the &lt;a href=&quot;https://sqgne.org&quot;&gt;Software Quality Group of New England&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Man, the job market is brutal! It took me four months of job searching in 2025 to find SELF Id when MassMutual outsourced its technology department. And it took me four months of near constant job searching in 2026 to find AAA Life when I was caught up in the second round of SELF&#39;s layoffs in the end of January.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;After throwing countless resumes into the void, submitting post after post on LinkedIn, experimenting with countless automation frameworks and programming projects on &lt;a href=&quot;http://tjmaher.com&quot;&gt;tjmaher.com&lt;/a&gt;, and spamming my entire LinkedIn Network (sorry about that!), and everyone I have worked with in the past twenty years as a software tester, desperately looking for job leads, it was a staffing firm working for AAA Life who found me. Thank you, &lt;a href=&quot;https://www.linkedin.com/company/refactortalent/&quot;&gt;Refactor Talent&lt;/a&gt;! Rewriting my LinkedIn Resume to make sure that I was using proper keywords in my &quot;About&quot; section of my LinkedIn Profile seems to have done the trick! &lt;br /&gt;&lt;br /&gt;I&#39;d also like to announce that I found another awesome software testing community to be a part of: The &lt;a href=&quot;https://sqgne.org&quot;&gt;Software Quality Group of New England&lt;/a&gt;, a local non-profit meeting monthly in Burlington, MA. Come join us! And we are always looking for in-person speakers. &lt;br /&gt;&lt;br /&gt;I&#39;ve been missing being part of a software testing community! I was Meetup Organizer for the now defunct Ministry of Testing - Boston group from 2016 to 2024, loving every minute I was trying to find speakers, sponsors and hosts. I made so many great connections during my tenure. It&#39;s sad the Meetup group was shut down by the Ministry of Testing UK a few months ago, but I am glad to be part of a new software testing group!&lt;br /&gt;&lt;br /&gt;In the past month as a new member of the SQGNE, I have: &lt;br /&gt;* Given a talk to the group on building a mobile automation test framework&lt;br /&gt;* Set up a monthly lunchtime discussion group that I&#39;m planning to have meet the first Tuesday of each month. &lt;br /&gt;* Been nominated to be one of the three Directors on the SQGNE leadership committee. &lt;br /&gt;&lt;br /&gt;Check us out at &lt;a href=&quot;https://SQGNE.org&quot;&gt;SQGNE.org&lt;/a&gt;! &lt;br /&gt;&lt;br /&gt;If you are in Massachusetts and are looking for a software testing group to present to, we are building out our calendar for the 2026 - 2027 right season now. &lt;br /&gt;&lt;br /&gt;Join the SQGNE LinkedIn Group! &lt;a href=&quot;https://www.linkedin.com/safety/go/?url=https%3A%2F%2Flnkd%2Ein%2FeNYUMG24&amp;amp;urlhash=u03Z&amp;amp;mt=Rgcf4KJ9LSuxNt6jh9kWNJT6uBROs-fNkCO4qGZ8ee_Wsa2yb0H3tAdVe2Qtd5T9rcGuHKRclUY_ma9zJhUDuC513cvtI3yorRZ1LREoI2kBVTxNpahpDus&amp;amp;isSdui=true&quot;&gt;https://lnkd.in/eNYUMG24&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thank you so much, everyone, for all of your support during my job search. It is really appreciated!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Testing!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/4950204584584763411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/new-position-unlocked-senior-sdet-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4950204584584763411'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4950204584584763411'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/new-position-unlocked-senior-sdet-at.html' title='New Position Unlocked: Senior SDET at AAA Life Insurance, starting Monday, June 15th, 2026! '/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-5483053217235577220</id><published>2026-06-02T16:35:29.876-04:00</published><updated>2026-06-02T16:35:29.877-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sqgne"/><title type='text'>SDET Lean Coffee #1: With AI, what is useful testing and what is workslop? SQGNE, June 2, 2026</title><content type='html'>With AI, what is useful when it comes to testing and what is workslop? How do you create workflows in AI? With AI producing massive amounts of code, how can a tester keep up?&lt;br /&gt;&lt;br /&gt;These are some of the topics attendees decided to talk about in our first ever SDET Lean Coffee, as part of the Software Quality Group of New England ( sqgne.org ). We exchanged war stories, horror stories, shared insights, and provided a bit of group therapy as we talked about the stress involved being the main support role of the software development team.  &lt;br /&gt;&lt;br /&gt;A surprise guest was Lisa Crispin (&lt;a href=&quot;http://LisaCrispin.com&quot;&gt;LisaCrispin.com&lt;/a&gt;), author of &quot;&lt;b&gt;Agile Testing: A Practical Guide for Testers and Agile Teams&lt;/b&gt;&quot;. Lisa has been working with &lt;b&gt;DORA&lt;/b&gt;, Google Cloud&#39;s DevOps Research and Assessment division. &lt;br /&gt;&lt;br /&gt;Recently, Lisa gave a talk teaming up with the &quot;Beyond Quality&quot; podcast, sharing what she has been doing &quot;&lt;b&gt;AI, testing, and the DORA AI Capabilities Model&lt;/b&gt;&quot; at Lisa&#39;s site at &lt;a href=&quot;https://lisacrispin.com/2026/04/20/ai-testing-and-the-dora-ai-capabilities-model/ &quot;&gt;https://lisacrispin.com/2026/04/20/ai-testing-and-the-dora-ai-capabilities-model/ &lt;/a&gt;discussing:&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The Dora AI Capabilitues Model&lt;/li&gt;&lt;li&gt;How we need to test AI agents since AI agents can degrade over time&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is a &quot;Lean Coffee&quot;?&lt;/h2&gt;&quot;Lean Coffee is a structured, but agenda-less meeting. Participants gather, build an agenda, and begin talking. Conversations are directed and productive because the agenda for the meeting was democratically generated&quot;. This format arose over fifteen years ago, when &quot;Jim Benson and Jeremy Lightsmith wanted to start a group that would discuss Lean techniques in knowledge work – but didn’t want to start a whole new cumbersome organization with steering committees, speakers, and such. They wanted a group that did not rely on anything other than people showing up and wanting to learn or create&quot;, according to &lt;a href=&quot;http://LeanCoffee.org&quot;&gt;LeanCoffee.org&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;When Is The Next SDET Lean Coffee?&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;SDET Lean Coffees for the SQGNE will (usually) be held the first Tuesday of each month at 12:00 pm to 1:00 pm EDT.&lt;br /&gt;&lt;br /&gt;Interested in attending the next session Tuesday, July 7th? &lt;br /&gt;&lt;br /&gt;Register at the Software Quality Group of New England website at &lt;a href=&quot;https://www.sqgne.org/&quot;&gt;https://www.sqgne.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Testing!&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/5483053217235577220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/sdet-lean-coffee-1-with-ai-what-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/5483053217235577220'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/5483053217235577220'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/sdet-lean-coffee-1-with-ai-what-is.html' title='SDET Lean Coffee #1: With AI, what is useful testing and what is workslop? SQGNE, June 2, 2026'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7532288977203917251</id><published>2026-06-01T22:34:08.323-04:00</published><updated>2026-06-01T22:34:08.323-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sqgne"/><title type='text'>Come join us at the next SQGNE Meeting! Open-Source Malware: Defending Your Software Supply Chain From Evolving Threats - June 17, 2026</title><content type='html'>&quot;&lt;b&gt;Open-Source Malware: Defending Your Software Supply Chain From Evolving Threats&lt;/b&gt;&quot; will be the topic of the next Software Quality Group of New England (&lt;a href=&quot;http://sqgne.org&quot;&gt;sqgne.org&lt;/a&gt;) meeting.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Speaker&lt;/b&gt;: Bryan Whyte, CISSP Director, Solutions Engineering @Sonatype&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Date&lt;/b&gt;: June 17, 2026 @ 6:00 pm&lt;/div&gt;&lt;br /&gt;Join us on Zoom or in person at Burlington, MA ( &lt;a href=&quot;https://us02web.zoom.us/meeting/register/5tzjYWWNSFiv_zYZK3-guw#/registration&quot;&gt;Register Here&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;&quot;Bryan Whyte breaks down the latest wave of open source malware, explains how these threats diverge from traditional vulnerabilities, and shares actionable steps for organizations to defend mission-critical software.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;As organizations deepen their reliance on open-source software, evolving security threats are reshaping the landscape at an unprecedented pace.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;Threat actors are now increasingly targeting development pipelines and trusted ecosystems like npm to orchestrate supply chain attacks with significant downstream impact. Incidents such as the 2025 Shai-Hulud npm campaign, the XZ Utils backdoor, and the widespread compromise of over 23,000 GitHub repositories illustrate how open-source malware has quickly become a critical, top-tier threat built to evade legacy scanning and exploit trust woven into modern delivery pipelines.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;--The shifting tactics of threat actors targeting npm, PyPi, GitHub, and development pipelines&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;--Key differences between open-source malware and traditional malware or vulnerabilities&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;--The most prevalent malware types and tactics driving today&#39;s software supply chain attacks&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&quot;After spending 20 years in software development, Bryan started his journey into Application Security in 2015 with the AppScan tool suite for Static, Dynamic and Mobile Application Security Testing. In 2018, he expanded his Cybersecurity proficiency, earning the Certified Information Systems Security Professional (CISSP). In 2019, he was excited to join Sonatype due to the explosive growth of open-source software, which has made Software Composition Analysis (SCA) a critical aspect of Application Security&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;See you there!&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt; -T.J. Maher&lt;br /&gt; Software Engineer in Test&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7532288977203917251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/06/come-join-us-at-next-sqgne-meeting-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7532288977203917251'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7532288977203917251'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/06/come-join-us-at-next-sqgne-meeting-open.html' title='Come join us at the next SQGNE Meeting! Open-Source Malware: Defending Your Software Supply Chain From Evolving Threats - June 17, 2026'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-4949536437573943228</id><published>2026-05-29T20:22:04.090-04:00</published><updated>2026-05-29T20:22:04.091-04:00</updated><title type='text'>Need a speaker at your Software Testing Meetup? How about a talk about putting together a React Native mobile testing framework? </title><content type='html'>Are any software testing Meetups looking for a speaker? I have a talk, all ready to go!&lt;br /&gt;&lt;br /&gt;After surviving the first round of layoffs last December, I scrambled to organize my research notes on building a mobile automation framework into a presentation. I managed to finish it days before I was hit by the second round of layoffs at the end of this January. &lt;br /&gt;&lt;br /&gt;So far, I have given my presentation, &lt;b&gt;Building a React Mobile Automated Test Framework Using Detox + TypeScript&lt;/b&gt; to:&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://testguild.com&quot;&gt;TestGuild.com&lt;/a&gt; Automation Guild 2026 via Zoom (4/6/2026)&lt;/li&gt;&lt;li&gt;Software Quality Group of New England ( SQGNE ) @ &lt;a href=&quot;https://scrum.org&quot;&gt;SCRUM.org&lt;/a&gt;, Burlington, MA - &lt;a href=&quot;https://tinyurl.com/detox-demo-sqgne&quot;&gt;https://tinyurl.com/detox-demo-sqgne&lt;/a&gt; (5/20/2026)&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.meetup.com/sydney-testers/&quot; target=&quot;_blank&quot;&gt;Sydney Testers Meetup&lt;/a&gt; via Zoom (scheduled on 6/30/2026)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Two Questions:&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;If I give a talk to a software testing Meetup in Australia via Zoom, even though I never left my home office in Massachusetts, would I be considered an &quot;International Speaker&quot;?&lt;/li&gt;&lt;li&gt;Does anyone else want me to volunteer to speak at their software testing meetup? The SQGNE season is ending for the summer, so I will have some time available.&lt;/li&gt;&lt;/ul&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/4949536437573943228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/need-speaker-at-your-software-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4949536437573943228'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4949536437573943228'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/need-speaker-at-your-software-testing.html' title='Need a speaker at your Software Testing Meetup? How about a talk about putting together a React Native mobile testing framework? '/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-3771241641970308362</id><published>2026-05-27T22:20:30.432-04:00</published><updated>2026-06-04T12:33:53.954-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Practicing Playwright: API Testing, Intercepting Network Requests, and Mocking APIs</title><content type='html'>&lt;div&gt;&lt;div&gt;How would you intercept a network request and use the data for assertions? Mock a network request using those assertions? And make sure that all data is loaded in the UI before making your assertions, and that all tests can pass when run?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We will be walking through &lt;b&gt;Butch Mayhew&lt;/b&gt;&#39;s code that answers all of these questions, part of his LinkedIn Learning course: &lt;a href=&quot;https://www.linkedin.com/learning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios/challenge-mocking-and-emulation-in-playwright?resume=false&quot; target=&quot;_blank&quot;&gt;Playwright Essential Training&lt;/a&gt;. We will be examining the shopping cart test site &lt;a href=&quot;http://PracticeSoftwareTesting.com&quot;&gt;PracticeSoftwareTesting.com&lt;/a&gt;&amp;nbsp;and looking at code on Butch&#39;s &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224&quot; target=&quot;_blank&quot;&gt;companion GitHub site&lt;/a&gt;&amp;nbsp;on how to mock out the API and use them in the UI tests.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Playwright has a lot of features when it comes to API testing. You can intercept network requests, aborting, modifying, and mocking network requests. You can also simulate a slow network. This is all done through the Playwright methods:&amp;nbsp;&amp;nbsp;&lt;b&gt;page.route&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;route &lt;/b&gt;is the specific path or URL a client uses to request data or trigger a function on a server.&amp;nbsp; GET /product would be an API call that gets everything from the address string called products, which then retrieves all products from the API endpoint called &quot;products&quot;. The endpoint is &quot;products&quot; and the route is the name that accesses the endpoint.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;b&gt;Playwright API&lt;/b&gt;&amp;nbsp;has a method called &lt;b&gt;route&lt;/b&gt;, which allows Playwright to monitor and modify browser network traffic.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Playwright.dev / Docs / Network&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/network&quot;&gt;https://playwright.dev/docs/network&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Playwright and page.route&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/api/class-route&quot;&gt;https://playwright.dev/docs/api/class-route&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Playwright Mocking API Guide&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/mock&quot;&gt;https://playwright.dev/docs/mock&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Adding &lt;b&gt;page.route&lt;/b&gt; to your test allows you to do things such as:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;abort &lt;/b&gt;the route request with route.abort(), simulating various error codes such as accessdenied, addressunreachable, blockedbyclient, blockedbyresponse, connection aborted, connectionclosed, timedout, etc.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;continue &lt;/b&gt;sending the route&#39;s request with optional overrides such as changing the request URL, the headers, the method such as GET or POST, and the post data of the request.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;fetch &lt;/b&gt;the request without yet fulfilling it, so the response can be saved, modified, and fulfilled later. You can also change the HTTP headers, follow redirects automatically, etc.&lt;/li&gt;&lt;li&gt;&lt;b&gt;fulfill &lt;/b&gt;the route&#39;s request.&lt;/li&gt;&lt;li&gt;&lt;b&gt;request &lt;/b&gt;that the request is routed.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;About Our Site Under Test&lt;/h2&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;PracticeSoftwareTesting.com &lt;/b&gt;is &lt;a href=&quot;https://practicesoftwaretesting.com&quot; target=&quot;_blank&quot;&gt;a shopping cart&lt;/a&gt; with a web-based front-end pulling data from a web-based back end. Tools can be filtered out by &lt;b&gt;category&lt;/b&gt;, such as hand tools (hammer, hand saw, wrench), and power tools ( grinder, sander, saw ) and by &lt;b&gt;brand&lt;/b&gt;, such as ForgeFlex Tools and MightyCraft Hardware. Check the appropriate check box, and cards are display in a grid fashion of products.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These products can also be &lt;b&gt;sorted&lt;/b&gt;, such as by &quot;Name (A - Z)&quot; and &quot;&quot;Name (Z - A)&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Explore the HTML of the site by opening up Google Chrome, right clicking on the first product in the grid to &quot;Inspect&quot; to open &lt;b&gt;Chrome Dev Tools&lt;/b&gt; and look at the &lt;b&gt;Elements&lt;/b&gt; tab to find locators:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Product Grid&lt;/b&gt;: Class col-md-9&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;This class can be used as a locator to find the product grid.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;About the Products API&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s see an example product returned by the Products API Endpoint:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Go to&amp;nbsp;&lt;a href=&quot;https://practicesoftwaretesting.com/&quot;&gt;https://practicesoftwaretesting.com/&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Under the Filters category, check the checkbox &quot;Saw&quot; under &quot;Power Tools&quot;. You will see one item display: a circular saw.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;But where did the product information come from?&amp;nbsp;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Under Chrome Developer Tools, select the &quot;Network&quot; tab&lt;/li&gt;&lt;li&gt;Uncheck and then check the &quot;Saw&quot; checkbox, and you will see a new products query at the bottom looking like &lt;i&gt;products?page=page=0&lt;/i&gt;... select that.&lt;/li&gt;&lt;li&gt;Select the &quot;Response&quot; tab.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
&lt;pre&gt;&lt;code&gt;  
&quot;current_page&quot;: 1,
    &quot;data&quot;: [
        {
            &quot;id&quot;: &quot;01KSMVRWS80N7909CZTE7ACJQS&quot;,
            &quot;name&quot;: &quot;Circular Saw&quot;,
            &quot;description&quot;: &quot;Portable circular saw powered by a robust ...&quot;,
            &quot;price&quot;: 80.19,
            &quot;is_location_offer&quot;: false,
            &quot;is_rental&quot;: false,
            &quot;co2_rating&quot;: &quot;D&quot;,
            &quot;in_stock&quot;: true,
            &quot;is_eco_friendly&quot;: false,
            ...
            &quot;category&quot;: {
                &quot;id&quot;: &quot;01KSMVRWMQCBR9XDQ5TGC47MS6&quot;,
                &quot;name&quot;: &quot;Saw&quot;,
                &quot;slug&quot;: &quot;saw&quot;
            },
            &quot;brand&quot;: {
                &quot;id&quot;: &quot;01KSMVRW6HT9HQZ2E113FQEFX7&quot;,
                &quot;name&quot;: &quot;ForgeFlex Tools&quot;
            }
        }
&lt;/code&gt;&lt;/pre&gt;  
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All this data was returned in a JSON format when the web app took the information in the filter and made the call to the product API&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;https://api.practicesoftwaretesting.com/products?page=0&amp;amp;between=price,1,100&amp;amp;by_category=01KSMVRWMQCBR9XDQ5TGC47MS6&amp;amp;is_rental=false&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;All these parameters can be used to test out how your UI behaves under various conditions.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;

How to Intercept Network Responses  
&lt;/h2&gt;&lt;div&gt;We can intercept the information coming back from the API using &lt;a href=&quot;https://playwright.dev/docs/api/class-route#route-fetch&quot;&gt;route.fetch&lt;/a&gt;&amp;nbsp;and then using&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/api/class-route#route-continue&quot;&gt;route.continue&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;await page.route(
  &quot;https://api.practicesoftwaretesting.com/products**&quot;
  async (route) =&amp;gt; {
    const response = await route.fetch();
    products = await response.json();
    route.continue();
  }
};&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;glob&lt;/b&gt;, or &quot;global command&quot;,&lt;b&gt;&amp;nbsp;&lt;/b&gt;is a pattern of characters used to find files, folders, or web addresses. The &quot;**&quot; is a globbing wildcard that matches all the nested folders which come after it. Had Butch used only one &quot;*&quot; it would have only returned the next level in the folder hierarchy.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What does this code do?&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;await page.route&lt;/b&gt;: Tells Playwright to listen to network requests that match this URL pattern.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;async (route)&lt;/b&gt;: Creates a callback function that triggers each time a call is made.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;const response&lt;/b&gt;: Declares a new constant variable called &quot;response&quot; where we will store the HTTP response retrieved.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;await route.fetch()&lt;/b&gt;: Performs the actual network request and retrieve the reponse.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;products = await response.json&lt;/b&gt;: Extracts the reponse payload as a JavaScript Object (JSON) and assigns it to a variable named &quot;products&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;route.continue&lt;/b&gt;: Proceed with the original request.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;
How to Abort API Requests  
&lt;/h2&gt;&lt;div&gt;Why would we want to abort a certain network call? Butch mentions in his LinkedIn Learning class how a certain pop up was interfering with a UI test he was writing.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also use &lt;a href=&quot;https://playwright.dev/docs/api/class-route#route-abort&quot;&gt;route.abort&lt;/a&gt; in order to simulate the Product API being down, and check to see that the UI is behaving as it should.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sample code Butch listed:&amp;nbsp;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;await page.route(
  &quot;https://api.practicesoftwaretesting.com/products**&quot;
  (route) =&amp;gt; route.abort()
};
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With this code, we are seeking to intercept anything from the Products API, and when the match is found, cancel the network request before it ever reaches the server.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;  
How to Mock a Product  
&lt;/h2&gt;&lt;div&gt;Let&#39;s say we want to see how our UI behaves with product names that are quite long, prices with many digits, or if a product is in stock. We can add these test products to the database and then search for them, or we can:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Capture the response&lt;/li&gt;&lt;li&gt;Alter any of the fields returned&lt;/li&gt;&lt;li&gt;Submit that mock data as if coming from the API itself.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;await page.route(
  &quot;https://api.practicesoftwaretesting.com/products**&quot;
  async (route) =&amp;gt; {
    const response = await route.fetch();
    const json = await response.json();
    json.data[0][&quot;name&quot;] = &quot;Mocked Product&quot;;
    json.data[0][&quot;price&quot;] = 100000.01;
    json.data[0][&quot;in_stock&quot;] = false;

    await route.fulfill({ response, json }  ))
  }
};
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... For this, we are editing the name, price, and the variable to see if the item is in stock or out of stock.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;json.data[0] represents the very first product listed.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;  
How to Mock API Requests with HAR files&lt;/h2&gt;&lt;div&gt;If you want to capture all HTTP traffic and store it, you can store it in an &lt;b&gt;HTTP Archive Record&lt;/b&gt;, or &lt;b&gt;HAR file&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;a href=&quot;https://playwright.dev/docs/mock#mocking-with-har-files&quot;&gt;According to Playwright.dev&lt;/a&gt;, a &quot;HAR file is an &lt;a href=&quot;http://www.softwareishard.com/blog/har-12-spec/&quot;&gt;HTTP Archive&lt;/a&gt; file that contains a record of all the network requests that are made when a page is loaded. It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests. You&#39;ll need to: 1) Record a HAR file. 2) Commit the HAR file alongside the tests. 3) Route requests using the saved HAR files in the tests.&lt;br /&gt;&lt;br /&gt;&quot;To record a HAR file we use &lt;a href=&quot;https://playwright.dev/docs/api/class-page#page-route-from-har&quot;&gt;page.routeFromHAR()&lt;/a&gt; or &lt;a href=&quot;https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har&quot;&gt;browserContext.routeFromHAR()&lt;/a&gt; method. This method takes in the path to the HAR file and an optional object of options. The options object can contain the URL so that only requests with the URL matching the specified glob pattern will be served from the HAR File. If not specified, all requests will be served from the HAR file.&lt;br /&gt;&lt;br /&gt;&quot;Setting update option to true will create or update the HAR file with the actual network information instead of serving the requests from the HAR file. Use it when creating a test to populate the HAR with real data&quot;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;await page.routeFromHAR(&quot;.hars/product.har&quot;, {
  url: &quot;https://api.practicesoftwaretesting.com/products**&quot;
  update: false,
});
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;With this code we are:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Telling Playwright to intercept all network traffic for the current page using a recorded HAR file and store it in the root directory folder we are calling &quot;.hars&quot; in the file &quot;product.har&quot;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Update: false runs the test in playback mode. We can run the test once with &quot;update: true&quot; to capture and store the information, then reset it to &quot;update: false&quot; to not have the data overwritten.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The problem with this approach is that sensitive data such as passwords might be part of the HAR file. To sanitize sensitive data, see the Medium article:&amp;nbsp; &lt;a href=&quot;https://medium.com/@sdgroup/harmageddon-is-cancelled-how-we-taught-playwright-to-replay-har-with-dynamic-parameters-efc4cc24894e&quot; target=&quot;_blank&quot;&gt;HARmageddon is cancelled: how we taught Playwright to replay HAR with dynamic parameters&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt; 
Simulating Slow API Requests
&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say we want to see how the UI responds when it takes a good 4 seconds (4000 milliseconds) for the API to respond.&amp;nbsp;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;await page.route(
  &quot;https://api.practicesoftwaretesting.com/products**&quot;
  async (route) =&amp;gt; {
    await page.waitForTimeout(4000)
    await route.continue();
  }
};
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;We can then add a bit of lag into the system, then continue as normal.&amp;nbsp;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Write a Test: Validating Brands&lt;/h2&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Putting together Butch&#39;s lessons above, Butch had an exercise listed: How can you validate the brands listed in the Filter on the web site matches the ones listed in the brand endpoint? And how can you do it by intercepting network data?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you go to&amp;nbsp;&lt;a href=&quot;https://practicesoftwaretesting.com/&quot;&gt;https://practicesoftwaretesting.com/&lt;/a&gt;&amp;nbsp;you can see that under the Filters, there are two major brands: ForgeFlexTools and MightyCraft Hardware.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;As mentioned earlier, these products can be &lt;b&gt;sorted&lt;/b&gt;, such as by &quot;Name (A - Z)&quot; and &quot;&quot;Name (Z - A)&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Explore the HTML of the site by opening up Google Chrome, right clicking on the first product in the grid to &quot;Inspect&quot; to open &lt;b&gt;Chrome Dev Tools&lt;/b&gt; and look at the &lt;b&gt;Elements&lt;/b&gt; tab to find locators:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Product Grid&lt;/b&gt;: Class col-md-9&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;This class can be used as a locator to find the product grid.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We can get the information about the brands from the API, which Butch stored in the .env file as API_URL.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using this information, we can write an end-to-end test to verify that the dynamic brand data loads correctly on a web page.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This test verifies that the web application displays a list of product brands on its front end by intercepting the backend API network responses.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;home.spec.ts&lt;/u&gt;&lt;/b&gt;&lt;pre&gt;&lt;code&gt;test(&quot;validate brands by intercepting network data&quot;, async ({ page }) =&amp;gt; {
  let brands: any;
  const apiUrl = process.env.API_URL;
  await test.step(&quot;intercept /brands&quot;, async () =&amp;gt; {
    await page.route(apiUrl + &quot;/brands&quot;, async (route) =&amp;gt; {
      const response = await route.fetch();
      brands = await response.json();
      route.continue();
    });
  });
  await page.goto(&quot;/&quot;);

  const productGrid = page.locator(&quot;.col-md-9&quot;);
  await expect(productGrid).toBeVisible();
  await expect(page.locator(&quot;.skeleton&quot;).first()).not.toBeVisible();

  const brandFilterSection = page.getByText(&quot;SortName (A - Z)Name (Z - A)&quot;);

  for (const brand of brands) {
    await expect(brandFilterSection).toContainText(brand.name);
  }
});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/tests/homepage/home.spec.ts#L162&quot;&gt;&lt;i&gt;tests/homepage/home.spec.ts&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;let brands: any&lt;/b&gt;: Declaring an empty variable to store all the brands found when they are fetched from the network. It is declared outside the test step so we can use it later on. It is set to &quot;any&quot; in order to keep it undefined for now.&lt;/li&gt;&lt;li&gt;&lt;b&gt;const apiUrl &lt;/b&gt;gets the API URL from the .env folder.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;await test.step(&quot;intercept /brands&lt;/b&gt;: This time, instead of products, we are registering a handler that fires whenever a request matches the URL pattern of &quot;/brands&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;route.fetch makes the real network request on behalf of the browser.&lt;/li&gt;&lt;li&gt;response.json parses and captures the response body into the variable, &quot;brands&quot;.&lt;/li&gt;&lt;li&gt;route.continue forwards the original response to the browser unchanged, so the UI renders normally.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The UI is getting the real data, with the test getting a copy of it.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then we are doing:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;page.goto(&quot;/&quot;): Loads the page and the browser makes the call, including GET /brands.&lt;/li&gt;&lt;li&gt;When the page loads and the browser calls GET /brands, the handler executes and the &quot;brands&quot; variable we set up is populated.&amp;nbsp;&lt;/li&gt;&lt;li&gt;page.locator: Sets up the contant variable productGrid as a locator for the product grid.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We expect the product grid to be visible, showing that the page is now loaded, and that the initial skeleton element placeholders PracticeSoftwareTesting.com has is no longer visible.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Finally, we are validating the UI data against the API data we have captured:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;We locate the Brand Filter Section web element by text, where we can sort the filter.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We then loop through every single brand object that was captured in the &quot;brand&quot; variable.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We confirm that each brand name provided in the backend API is accurately printed as text inside the frontend filter sidebar.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Write a Test: Validating Categories By Mocking&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say we want to write a test that the Categories API correctly adds mocked categories and subcategories to the left side index. Butch shows an example:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;home.spec.ts&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;test(&quot;validate categories render in UI by mocking&quot;, async ({ page }) =&amp;gt; {
  let categories: any;
  const apiUrl = process.env.API_URL;

  await test.step(&quot;intercept /categories&quot;, async () =&amp;gt; {
    await page.route(apiUrl + &quot;/categories/tree&quot;, async (route) =&amp;gt; {
      const response = await route.fetch();
      const json = await response.json();
      categories = json.data;

      json[0].name = &quot;Mocked Category&quot;;
      if (json[0].sub_categories &amp;amp;&amp;amp; json[0].sub_categories.length &amp;gt; 0) {
        json[0].sub_categories[0].name = &quot;Mocked Subcategory&quot;;
      }
      await route.fulfill({ response, json });
    });
  });
  await page.goto(&quot;/&quot;);

  const productGrid = page.locator(&quot;.col-md-9&quot;);
  await expect(productGrid).toBeVisible();
  await expect(page.locator(&quot;.skeleton&quot;).first()).not.toBeVisible();

  const categoryFilterSection = page.getByText(&quot;SortName (A - Z)Name (Z - A)&quot;);

  await expect(categoryFilterSection).toContainText(&quot;Mocked Category&quot;);
  await expect(categoryFilterSection).toContainText(&quot;Mocked Subcategory&quot;);
});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/tests/homepage/home.spec.ts#L162&quot;&gt;&lt;i&gt;tests/homepage/home.spec.ts&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Walking through this code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Create a new test:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;A new Playwright &lt;b&gt;test &lt;/b&gt;case is defines, using a &lt;b&gt;page &lt;/b&gt;fixture.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We declare the undefined variable &quot;categories&quot; and add the API URL into a constant variable.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We create a new &lt;b&gt;test step&lt;/b&gt;, letting readers know we are going to intercept the /categories data.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Intercept the response:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;With page.route(apiUrl + &quot;/categories/tree&quot; we tell the browser to watch for and pause any outgoing requests matching /categories/tree.&lt;/li&gt;&lt;li&gt;Route.fetch allows the real request to fetch the real response, and store it in the variable called &quot;response&quot;.&lt;/li&gt;&lt;li&gt;We then take that response in json format and place it in a variable we are calling &quot;json&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Edit that response so the first item has &quot;Mocked Category&quot; and &quot;Mocked Subcategory&quot;:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;We are going to take that first name, [0] and assign it the string &quot;Mocked Category&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;If there are subcategories in that intercepted response, and the sub_categories length is greater than zero, we will assign the string to it: &quot;Mocked Subcategory&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;route.fulfill will send this modified JSON response back to the frontend application instead of the original server data.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Hopefully, in the left hand side panel of PracticeSoftwareTesting.com, under &quot;Category&quot; we will see &quot;Mocked Category&quot; and &quot;Mocked Subcategory&quot;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;u&gt;Load the Page, Wait for the Product Grid to Appear:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;We set up productGrid as a web element, using the class we found .col-md-9 as a locator.&lt;/li&gt;&lt;li&gt;We expect the productGrid to be visible and the .skeleton to not be shown.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Expect the &quot;Mocked Category&quot; to appear!&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;We declare a new web element, categoryFilterSection, using the SortName as a locator.&lt;/li&gt;&lt;li&gt;Can we verify that the phrase &quot;Mocked Category&quot; appears? It passes!&lt;/li&gt;&lt;li&gt;Can we verify that the phrase &quot;Mocked subcategory&quot; appears? It passes!&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whew! And this is just a taste on what Playwright can do to test at the API level. You can read more in the Playwright.dev Docs which covers&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/api-testing&quot;&gt;API Testing&lt;/a&gt;, and the classes&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/api/class-apirequest&quot; target=&quot;_blank&quot;&gt;API Request&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs/api/class-apirequestcontext&quot; target=&quot;_blank&quot;&gt;API Request Context&lt;/a&gt;, and &lt;a href=&quot;https://playwright.dev/docs/api/class-apiresponse&quot; target=&quot;_blank&quot;&gt;API Response&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Practicing Playwright:&lt;/b&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/05/time-to-practice-playwright.html&quot; target=&quot;&quot;&gt;Time to Practice Playwright!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/06/new-playwright-course-playwright.html&quot; target=&quot;&quot;&gt;New Playwright Course: Playwright Essential Training by Butch Mayhew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/01/hands-on-automated-testing-with.html&quot; target=&quot;&quot;&gt;Hands on Automated Testing with Playwright by Butch Mayhew is the start of a wonderful conversation with the Playwright community!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/04/what-happens-when-you-pair-playwright.html&quot; target=&quot;&quot;&gt;What happens when you pair Playwright with something other than TypeScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html&quot; target=&quot;&quot;&gt;Logging in by Storing and Using an Authentication Cookie in Your Automated Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Six&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html&quot; target=&quot;&quot;&gt;How to Detect Broken Images On Your Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Seven&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html&quot; target=&quot;&quot;&gt;Dynamically Creating Test Data with a DataFactory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Eight&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html&quot; target=&quot;&quot;&gt;Visual Testing With Playwright&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html&quot; target=&quot;&quot;&gt;API Testing, Intercepting Network Requests, and Mocking APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Source Code&lt;/b&gt;: &lt;a href=&quot;https://github.com/tjmaher/practicing-playwright&quot; target=&quot;_blank&quot;&gt;https://github.com/tjmaher/practicing-playwright&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;&lt;br&gt;

Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/3771241641970308362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/3771241641970308362'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/3771241641970308362'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html' title='Practicing Playwright: API Testing, Intercepting Network Requests, and Mocking APIs'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7527065130424874917</id><published>2026-05-21T08:46:54.520-04:00</published><updated>2026-06-04T12:36:51.366-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Practicing Playwright: Visual Testing With Playwright</title><content type='html'>&lt;div&gt;If you want to do some basic visual checking to see if there has been any deviation from your baseline of images, you can use Playwright. It&#39;s built in! Playwright can take a snapshot of a web element, a visible viewport, or a full page, and save it in your Git repository as a baseline, failing the test if the image, page, or viewport does not match up.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Caution:&lt;/u&gt;&lt;/b&gt;&amp;nbsp;From what I have been reading, this can quickly cause your code repository to balloon in size, since Chrome, Firefox, and WebKit would each store its own golden screenshot in your repo. Also, images on Mac, Windows, and Linux all appear different pixel-by-pixel. If using a CI platform, it might be best to run visual tests only on a standard Playwright Docker image, to generate and compare snapshots. According to &lt;a href=&quot;https://testquality.com/playwright-visual-regression-guide/&quot;&gt;TestQuality&lt;/a&gt;, &quot;Once a suite passes 50–100 visual tests, teams need a layer that tracks run history, surfaces flaky-test patterns across cycles, and routes confirmed defects into the team&#39;s tracker — none of which lives inside the test runner itself&quot;... I wonder if you can store images in an Amazon S3 bucket and hook that up as a virtual drive? ... no matter. That will be a blog post for another time...&amp;nbsp;&lt;/div&gt;&lt;br /&gt;Right now, we will be walking through &lt;b&gt;Butch Mayhew&lt;/b&gt;&#39;s code he wrote for his LinkedIn Learning course, &lt;a href=&quot;https://www.linkedin.com/learning/learning-playwright&quot; target=&quot;_blank&quot;&gt;Learning Playwright&lt;/a&gt;, found on &lt;a href=&quot;https://www.linkedin.com/learning/learning-playwright&quot; target=&quot;_blank&quot;&gt;his companion GitHub site&lt;/a&gt;.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While the test is in a certain state you can a screenshot of the page or certain elements of the page and save them as a snapshot. The snapshots an be used as a baseline images to compare your current site against. This baseline can be periodically updated as the site evolves.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;How does this happen? With Playwright&#39;s &lt;b&gt;.toHaveScreenshot( ) &lt;/b&gt;to take a screenshot and the &lt;b&gt;mask&amp;nbsp;&lt;/b&gt;method that you want to leave out of the comparisons between the expected and actual screenshots.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;toHaveScreenshot(name)&lt;/b&gt;: &lt;a href=&quot;https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1&quot; target=&quot;_blank&quot;&gt;Playwright.dev / Page Assertions&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Our Test Site: PracticeSoftwareTesting.com&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Butch has a series of tests for the test site &lt;b&gt;Practice Software Testing&lt;/b&gt;&amp;nbsp;(&amp;nbsp;&lt;a href=&quot;https://practicesoftwaretesting.com&quot;&gt;practicesoftwaretesting.com&lt;/a&gt;&amp;nbsp;).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you go to the site, you can see that there is an ever moving logo, &quot;Toolshop Demo&quot; which has the title &quot;Practice Software Testing - Toolshop&quot; . Let&#39;s write a test capturing an image of the page, leaving out the moving logo.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Butch also suggested waiting for everything to be fully loaded with &quot;&lt;b&gt;networkidle&lt;/b&gt;&quot;. But, according to the Playwright.dev &lt;a href=&quot;https://playwright.dev/docs/next/api/class-page#page-wait-for-load-state&quot; target=&quot;_blank&quot;&gt;waitForLoadState documentation&lt;/a&gt;, it says &quot;Don&#39;t use this method for testing, rely on web assertions to assess readiness instead&quot;. Hrm. Let&#39;s go with that he has for now.&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Writing the Visual Test&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;home.spec.ts&lt;/u&gt;&lt;/b&gt;&lt;pre&gt;&lt;code&gt;  test(&quot;visual test&quot;, async ({ page }) =&amp;gt; {
    await page.waitForLoadState(&quot;networkidle&quot;);
    await expect(page).toHaveScreenshot(&quot;home-page-no-auth.png&quot;, {
      mask: [page.getByTitle(&quot;Practice Software Testing - Toolshop&quot;)],
    });
  });
&lt;/code&gt;&lt;/pre&gt;&lt;a href=&quot;https://github.com/LinkedInLearning/learning-playwright-5911873/blob/f2bbe9ea3f079ca2cb9fb27b2c9f8bbbf06a1a99/tests/homepage/home.spec.ts#L8&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;
tests / homepage / homepage.spec.ts&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first time you run this test, it fails, since there are not yet any snapshots saved. There is no &lt;b&gt;golden file&lt;/b&gt;. The second time you run it, it will pass. If you wanted to bypass this step, and just update the snapshots for this page, you can run. This regenerates any snapshots for the assertions:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;npx playwright test tests/home.spec.ts --update-snapshots&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Did a snapshot not match up with the one saved?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can investigate it in the built-in Playwright reports, showing differences outlined in red, the actual snapshot, the expected snapshots, and see them side-by-side. It also have a feature where you can move slider back and forth horizontally across the image investigating actual and expected snapshots.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice that the mask shows that image in an array. Need to mask a bunch of items on the page? You can add them all to the array.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also grab screenshots not just of whatever is in the viewport, or the full page beyond the fold, but also compare individual images, or elements such as popup windows.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Visual Comparisons&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;From &lt;a href=&quot;https://playwright.dev/docs/test-snapshots&quot;&gt;Playwright.dev Docs / Test Snapshots&lt;/a&gt;: &quot;Playwright Test includes the ability to produce and visually compare screenshots using await expect(page).toHaveScreenshot(). On first execution, Playwright test will generate reference screenshots. Subsequent runs will compare against the reference&quot;.&lt;h2 style=&quot;text-align: left;&quot;&gt;The ToHaveScreenshot Method&lt;/h2&gt;&lt;div&gt;This is all part of Playwright.dev&#39;s &lt;b&gt;PageAssertions&lt;/b&gt; class, where we are expecting the page for the actual viewable screenshot of the app to match the saved expected viewable screenshot.&amp;nbsp; ( &lt;a href=&quot;https://playwright.dev/docs/api/class-pageassertions#methods&quot;&gt;See all Options&lt;/a&gt; ). Options you can use:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;fullPage&lt;/b&gt;: You can decide to capture the entire scrollable page, setting it as &quot;true&quot;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;mask&lt;/b&gt;: You can tell Playwright to ignore certain areas, such as headers or footers if you are just interested in the main area of the site, finding the locators of those areas and mask them. Normally, it will be a pink box in the report to show what is masks, but you can change the &lt;b&gt;maskColor&lt;/b&gt; in &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/color_value&quot; target=&quot;_blank&quot;&gt;CSS color format&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;threshold:&lt;/b&gt; How strict should colors match? Should it be strict (0) or lax (1) or somewhere in between? The default is 0.2.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;omitBackground&lt;/b&gt;: When you want to hide the default white background and capture it as transparent.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;maxDiffPixels&lt;/b&gt; &amp;amp; &lt;b&gt;maxDiffPixelRatio&lt;/b&gt;: Shows the acceptable amount of pixels that could be different and a ratio of different pixels between 0 and 1. We can configure both using TestConfig.expect. These are turned off by default.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Matching Pixels With Pixelmatch&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Playwright uses the &lt;b&gt;pixelmatch&lt;/b&gt;&amp;nbsp;JavaScript library (&amp;nbsp;&lt;a href=&quot;https://github.com/mapbox/pixelmatch&quot;&gt;https://github.com/mapbox/pixelmatch&lt;/a&gt; ) which is used to compare actual and expected images.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Configure Visual Checking In Playwright Config&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Want to fine tune the above variables? You can update the global configuration in your &lt;b&gt;playwright.config.ts&lt;/b&gt; file:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;import { defineConfig } from &#39;@playwright/test&#39;;

export default defineConfig({
  expect: {
    toHaveScreenshot: {
      // Allow up to 2% of total pixels to change 
      // (handles layout shifts/dynamic content)
      maxDiffPixelRatio: 0.02, 
      
      // Increase pixel color tolerance 
      // (0.2 blends strict pixel match with visual difference)
      threshold: 0.2,          
      
      // Automatically mask dynamic elements like blinking text cursors
      caret: &#39;hide&#39;,           
      
      // Ensure CSS animations are frozen on the first frame
      animations: &#39;disabled&#39;,  
    },
  },
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;How to Compare Product Cards?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say on the PracticeSoftwareTesting.com site, you wanted to create a visual comparison of the first product card. The code could look something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;

  test(&#39;product card matches snapshot&#39;, async ({ page }) =&amp;gt; {
    await page.goto(&#39;https://practicesoftwaretesting.com&#39;);

    // Locate a specific element -- here, the first product card
    const productCard = page.locator(&#39;[data-test=&quot;product&quot;]&#39;).first();

    // Wait for the image inside the card to fully load before snapping
    await productCard.locator(&#39;img&#39;).waitFor({ state: &#39;visible&#39; });

    // Compare element screenshot against stored baseline
    await expect(productCard).toHaveScreenshot(&#39;product-card.png&#39;);
  });

});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;How To Mask Changing Elements Such As Prices?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Prices for a Shopping Cart will never remain stagnant. They are always changing.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say you just want to do visual checking on the basic layout. Every time the prices change, you don&#39;t want the visual test to fail. What you can do is just mask out all the prices, which are with the ids &quot;product-price&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;// tests/full-page-screenshot.spec.ts
import { test, expect } from &#39;@playwright/test&#39;;

test(&#39;homepage layout matches snapshot, prices masked&#39;, async ({ page }) =&amp;gt; {
  await page.goto(&#39;https://practicesoftwaretesting.com&#39;);

  await expect(page).toHaveScreenshot(&#39;homepage.png&#39;, {
    // Mask elements whose content changes between runs
    mask: [
      page.locator(&#39;[data-test=&quot;product-price&quot;]&#39;),
    ],
    // Pixel-level tolerance -- useful when anti-aliasing differs
    maxDiffPixelRatio: 0.02,
  });
});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... And if you wanted even more fine tuning, you could choose to &lt;a href=&quot;https://applitools.com/docs/eyes/playwright&quot; target=&quot;_blank&quot;&gt;Integrate Applitools with Playwright&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Running Visual Testing in CI Platforms&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s say you are running visual testing in a CI environment: Make sure you generate the snapshots against what is in CI, and not your local environment or there will be pixel differences.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are using Playwright&#39;s pre-built Docker Image (&lt;a href=&quot;https://playwright.dev/docs/docker&quot; target=&quot;_blank&quot;&gt;see docs&lt;/a&gt; ) make sure to update the images in the container you are using.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;According top&amp;nbsp;&lt;b&gt;TestQuality.com&lt;/b&gt;: &lt;a href=&quot;https://testquality.com/playwright-visual-regression-guide/&quot; target=&quot;_blank&quot;&gt;Playwright Visual Regression Testing: A Production Guide to Baselines, Flake, and CI&lt;/a&gt;,&amp;nbsp;&quot;Native Playwright visual regression is free to start and expensive to scale. The cost shows up in CI, not on day one&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The problem&lt;/b&gt; is that &quot;Windows, macOS, and Linux render fonts, anti-aliasing, and pixel spacing differently. A baseline captured on a developer&#39;s Mac will fail when compared against a screenshot taken on the Linux CI runner, even when the application code has not changed&quot;.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The solution&lt;/b&gt;? &quot;[A] Dockerfile based on the official Playwright image, plus docker-compose mounting screenshot volumes so developers run the same Linux rendering engine locally that the CI runner uses. A single command brings up the same environment everywhere, which eliminates &#39;works on my machine&#39; visual discrepancies entirely&quot;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;How to manage them&lt;/b&gt;? &quot;Playwright visual regression CI integration requires treating visual checks as a separate, isolated pipeline stage. Tag visual tests with @visual, exclude them from standard runs using --grep-invert, and execute them in a dedicated Docker step. This keeps functional feedback fast and quarantines visual flake to a controlled environment&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Any other problems&lt;/b&gt;? &quot;Storage is the harder problem. Native baselines live in the Git repository, with one image per browser engine — a ten-test suite covering Chromium, Firefox, and WebKit produces thirty committed images. The repo grows fast, but the bigger pain is approval. GitHub, GitLab, and most version control UIs cannot diff images inline. When a baseline updates, the reviewer sees a binary file change with no visible context. Resolving the conflict requires pulling the branch locally, opening the images side by side, copying the new baseline into the feature branch, and pushing manually. House calls this &#39;GitHub diff blindness,&#39; and it is the single biggest reason teams move off native after a few months&quot;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Practicing Playwright:&lt;/b&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/05/time-to-practice-playwright.html&quot; target=&quot;&quot;&gt;Time to Practice Playwright!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/06/new-playwright-course-playwright.html&quot; target=&quot;&quot;&gt;New Playwright Course: Playwright Essential Training by Butch Mayhew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/01/hands-on-automated-testing-with.html&quot; target=&quot;&quot;&gt;Hands on Automated Testing with Playwright by Butch Mayhew is the start of a wonderful conversation with the Playwright community!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/04/what-happens-when-you-pair-playwright.html&quot; target=&quot;&quot;&gt;What happens when you pair Playwright with something other than TypeScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html&quot; target=&quot;&quot;&gt;Logging in by Storing and Using an Authentication Cookie in Your Automated Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Six&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html&quot; target=&quot;&quot;&gt;How to Detect Broken Images On Your Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Seven&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html&quot; target=&quot;&quot;&gt;Dynamically Creating Test Data with a DataFactory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Eight&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html&quot; target=&quot;&quot;&gt;Visual Testing With Playwright&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html&quot; target=&quot;&quot;&gt;API Testing, Intercepting Network Requests, and Mocking APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Source Code&lt;/b&gt;: &lt;a href=&quot;https://github.com/tjmaher/practicing-playwright&quot; target=&quot;_blank&quot;&gt;https://github.com/tjmaher/practicing-playwright&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;&lt;br&gt;  
  
  &lt;div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7527065130424874917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7527065130424874917'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7527065130424874917'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html' title='Practicing Playwright: Visual Testing With Playwright'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-4802017155977285300</id><published>2026-05-20T10:12:23.230-04:00</published><updated>2026-05-20T10:13:46.386-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sqgne"/><title type='text'>SQGNE Lecture is tonight! Building a React Native Mobile Automated Test Framework with T.J. Maher</title><content type='html'>&lt;div&gt;Are you in Boston? Come hear me talk about &lt;b&gt;Building a&amp;nbsp;a React Native Mobile Automated Test Framework&lt;/b&gt;&amp;nbsp;in tonight&#39;s Software Quality Group of New England meeting in Burlington, MA:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Registration Page&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://sqgne.org/n-May-2026.html&quot;&gt;https://sqgne.org/n-May-2026.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Slide Deck&lt;/b&gt;: &lt;a href=&quot;https://tinyurl.com/detox-demo-sqgne&quot;&gt;https://tinyurl.com/detox-demo-sqgne&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Taken from the Registration page:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&quot;Building a React Native Mobile Automated Test Framework&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1/&quot; target=&quot;_blank&quot;&gt;Thomas F. - T.J. - Maher, Jr.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;Wednesday May 20, 2025 6:30-8:00 PM - in person (free pizza!)&lt;br /&gt;&lt;a href=&quot;https://us02web.zoom.us/meeting/register/xXHMd-VTRZGbhocEoKQ-BQ#/registration&quot;&gt;Register Here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;Check in between 6:00 and 6:30 to network&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&quot;About the Presentation. . .&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&quot;Writing automated tests for a React Native mobile application is notoriously difficult. Mobile components display on the page, but are not fully loaded. Lengthy animations and slow-loading components take a while to finish. Timing issues cause your automated tests to error out giving the appearance of flaky tests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&quot;Thomas F. - T.J. - Maher, Jr. will be sharing his experience tackling these problems using the open-source mobile testing framework, Wix&#39;s Detox, designed specifically for testing React Native applications.&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&quot;Setting up a mobile test automation framework.&lt;/li&gt;&lt;li&gt;&quot;Vibe-coding a toy React Mobile Login page app to test against ( tinyurl.com/detox-demo ).&lt;/li&gt;&lt;li&gt;&quot;How to reduce timing issues and flakiness in automated tests.&lt;/li&gt;&lt;li&gt;&quot;Refactoring code into tests, page objects &amp;amp; base pages, separating out credentials and message strings for easier maintainability.&lt;/li&gt;&lt;li&gt;&quot;Setting up automated tests in CI / CD for iOS simulators and Android emulators with GitHub Action Workflows.&lt;/li&gt;&lt;li&gt;&quot;How developers can test their code before they push it into the main branch&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;About the Speaker. . &lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&quot;A former organizer of Ministry of Testing - Boston, Thomas (T.J.) Maher is a Software Development Engineer in Test (SDET) based in the Boston/South Shore area of Massachusetts, with a decade of experience building web + mobile test automation frameworks. His recent work includes architecting a mobile automation framework from the ground up using Detox and TypeScript for a React Native application at SELF ID, a decentralized identity startup. Prior roles include MassMutual, Verily (Google), Threat Stack, Fitbit, and Intralinks&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;See you there!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Testing!&lt;/div&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/4802017155977285300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/sqgne-lecture-is-tonight-building-react.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4802017155977285300'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/4802017155977285300'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/sqgne-lecture-is-tonight-building-react.html' title='SQGNE Lecture is tonight! Building a React Native Mobile Automated Test Framework with T.J. Maher'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-2211361517217998306</id><published>2026-05-14T00:27:50.757-04:00</published><updated>2026-06-04T12:38:18.452-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Practicing Playwright: Dynamically Creating Test Data with a DataFactory</title><content type='html'>&lt;div&gt;&lt;div&gt;Continuing walking through&amp;nbsp;&lt;b&gt;Butch Mayhew&lt;/b&gt;&#39;s LinkedIn Learning course &lt;a href=&quot;https://www.linkedin.com/learning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios&quot;&gt;Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios&lt;/a&gt;, we will be examining his&amp;nbsp;code creating a &lt;b&gt;DataFactory&lt;/b&gt; that dynamically generates new registered users for our app under test.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The app we will be testing against is&amp;nbsp;&lt;b&gt;PracticeSoftwareTesting.com. &lt;/b&gt;examining how the registration call in the API creates new users. We will also be mimicking this call at a programmatic level, to be used in a Playwright automation framework.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to Butch Mayhew, in his there are two types of data we use in our tests: &lt;b&gt;static&lt;/b&gt;, and &lt;b&gt;dynamic&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Static data&lt;/b&gt;&amp;nbsp;that should never change. Already exists before the test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Example: Your go-to test user, or your go to product when testing a shopping cart.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Dynamic Data&lt;/b&gt;: Data that is created as part of a test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Newly registered users. Products created as part of a test.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Between static and dynamic data, Butch believes it should be around 15% / 85% split.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can dynamically generate data, such as registering new users, by implementing a&amp;nbsp;&lt;b&gt;Datafactory,&amp;nbsp;&lt;/b&gt;a helper function that interacts with a system to create this data for you.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step One: Write A Registration Test&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On my local computer, I cloned Butch Mayhew&#39;s&amp;nbsp;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224&quot;&gt;companion GitHub site&lt;/a&gt;&amp;nbsp;for his LinkedIn Learning site, checking out branch 01_05b, the section he was covering in his course.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Microsoft VS Code &lt;/b&gt;is the IDE (Integrated Development Environment) we will be using. If you install the &lt;b&gt;Microsoft&lt;/b&gt;&amp;nbsp;&lt;b&gt;Playwright VS Code extension&lt;/b&gt;, you see on the right hand sidebar for VS Code, an icon that looks like a beaker. Clicking on that, you can see more options such as &quot;Record new&quot;, a way to record a new test.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Visual Studio Code:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Visual Studio Marketplace&lt;/b&gt;: &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright&quot; target=&quot;_blank&quot;&gt;Playwright Test for VS Code&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Playwright.dev Docs:&lt;/b&gt; &lt;a href=&quot;https://playwright.dev/docs/getting-started-vscode&quot; target=&quot;_blank&quot;&gt;Getting Started / VS Code&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When I clicked on &quot;Record new&quot;, following along with the video in the course, it opened up a new &lt;b&gt;test-1.spec.ts&lt;/b&gt; file. A new browser window is opened. When I went to &lt;a href=&quot;https://www.practicesoftwaretesting.com/auth/register&quot;&gt;https://www.practicesoftwaretesting.com/auth/register&lt;/a&gt; and filled out the Registration form, every click, every piece of data filled in was captured in the test.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
  
&lt;pre&gt;&lt;code&gt;test(&#39;test&#39;, async ({ page }) =&amp;gt; {
  await page.goto(&#39;https://www.practicesoftwaretesting.com/auth/register&#39;);
  await page.getByTestId(&#39;first-name&#39;).fill(&#39;Test&#39;);
  await page.getByTestId(&quot;last-name&quot;).fill(&quot;Tester&quot;);
  await page.getByTestId(&#39;country&#39;).selectOption(&#39;US&#39;);
  await page.getByTestId(&#39;postal_code&#39;).fill(&#39;555555&#39;);
  await page.getByTestId(&#39;street&#39;).fill(&#39;101 Testing Way&#39;);
  await page.getByTestId(&#39;city&#39;).fill(&#39;New York&#39;);
  await page.getByTestId(&#39;state&#39;).fill(&#39;New York&#39;);
  await page.getByText(&#39;First nameLast nameDate of&#39;).click();
  await page.getByTestId(&#39;email&#39;).fill(&#39;testlinkedinlearning@test.com&#39;);
  await page.getByTestId(&#39;password&#39;).fill(&#39;Pass$w0rd1&#39;);
  await page.getByTestId(&#39;register-form&#39;).getByRole(&#39;button&#39;).filter({ hasText: /^$/ }).click();
  await page.getByTestId(&#39;phone&#39;).fill(&#39;5555555555&#39;);
  await page.getByTestId(&#39;dob&#39;).fill(&#39;2001-01-01&#39;);
  await page.getByTestId(&#39;house_number&#39;).fill(&#39;42&#39;);
  await page.getByTestId(&#39;register-submit&#39;).click();
});
&lt;/code&gt;&lt;/pre&gt;
  
  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Two: Open the Playwright UI Mode&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Before rerunning this test in UI mode, since a condition for registered users is that all emails should be unique, I made the email address &quot;testlinkedinlearning01@test.com&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Open the Playwright Test UI:&lt;/b&gt; npx playwright test --ui&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;... This command opened up a new Playwright Test browser window showing in the left-hand sidebar all tests in the test suite, including the test-2.spec.ts one that was autogenerated for me.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;According to&amp;nbsp;&lt;b&gt;Playwright.dev Docs:&lt;/b&gt; &lt;a href=&quot;https://playwright.dev/docs/test-ui-mode&quot; target=&quot;_blank&quot;&gt;Test UI Mode&lt;/a&gt;&amp;nbsp;&quot;Once you launch UI Mode you will see a list of all your test files. You can run all your tests by clicking the triangle icon in the sidebar. You can also run a single test file, a block of tests or a single test by hovering over the name and clicking on the triangle next to it&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Three: Examine the Register API Call&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Want to see what API calls the registration is running?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to the &lt;a href=&quot;https://playwright.dev/docs/test-ui-mode#network&quot; target=&quot;_blank&quot;&gt;Playwright Docs / UI Mode / Network&lt;/a&gt;,&amp;nbsp;&quot;The &lt;b&gt;Network&lt;/b&gt; tab shows you all the network requests that were made during your test. You can sort by different types of requests, status code, method, request, content type, duration and size. Click on a request to see more information about it such as the request headers, response headers, request body and response body&quot;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Select the &quot;Network&quot; tab, just as in Google Chrome Developer tools, and you will see everything, including the POST API call, &quot;register&quot;, which posts the data to /users/register endpoint.&amp;nbsp; .&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiyk7C6gUh_bVQ-Z8n8xU2v3z3cRxfxtTAR7xS_YcYEKLAVxA00lAhoi9v1YYETqqKPhBzqSQAgiPsB4Pf0yigV1JTcii6EJ0dXw7X8atDgqQ2BYlFv3DIYccGVgms6ozIe1WgQjhxK5_eU4EzTv9gxlXroKr_fuolIyjsMIfGSQvAM6Wa-w8geJtbIhbY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;832&quot; data-original-width=&quot;853&quot; height=&quot;624&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiyk7C6gUh_bVQ-Z8n8xU2v3z3cRxfxtTAR7xS_YcYEKLAVxA00lAhoi9v1YYETqqKPhBzqSQAgiPsB4Pf0yigV1JTcii6EJ0dXw7X8atDgqQ2BYlFv3DIYccGVgms6ozIe1WgQjhxK5_eU4EzTv9gxlXroKr_fuolIyjsMIfGSQvAM6Wa-w8geJtbIhbY=w640-h624&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Select the &quot;register&quot; call. If you take a look at the Payload, you can see:&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;  {
  &quot;first_name&quot;: &quot;Test&quot;,
  &quot;last_name&quot;: &quot;Tester&quot;,
  &quot;dob&quot;: &quot;2001-01-01&quot;,
  &quot;phone&quot;: &quot;5555555555&quot;,
  &quot;email&quot;: &quot;testlinkedinlearning@test.com&quot;,
  &quot;password&quot;: &quot;Pass$w0rd1&quot;,
  &quot;address&quot;: {
    &quot;street&quot;: &quot;101 Testing Way&quot;,
    &quot;city&quot;: &quot;New York&quot;,
    &quot;state&quot;: &quot;New York&quot;,
    &quot;country&quot;: &quot;US&quot;,
    &quot;postal_code&quot;: &quot;555555&quot;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Four: Copy Request As Playwright&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you scroll to the right, you will see the option &quot;&lt;b&gt;Copy request&lt;/b&gt;&quot;. Choose the dropdown option, &quot;Copy as Playwright&quot;, and you get the following code:&amp;nbsp;&lt;/div&gt;&lt;div&gt;
&lt;pre&gt;&lt;code&gt;
await page.request.post(&#39;https://api.practicesoftwaretesting.com/users/register&#39;, {
  data: `{
  &quot;first_name&quot;: &quot;Test&quot;,
  &quot;last_name&quot;: &quot;Tester&quot;,
  &quot;dob&quot;: &quot;2001-01-01&quot;,
  &quot;phone&quot;: &quot;5555555555&quot;,
  &quot;email&quot;: &quot;testlinkedinlearning01@test.com&quot;,
  &quot;password&quot;: &quot;Pass$w0rd1&quot;,
  &quot;address&quot;: {
    &quot;street&quot;: &quot;101 Testing Way&quot;,
    &quot;city&quot;: &quot;New York&quot;,
    &quot;state&quot;: &quot;New York&quot;,
    &quot;country&quot;: &quot;US&quot;,
    &quot;postal_code&quot;: &quot;555555&quot;
  }
}`,
  headers: {
    &#39;sec-ch-ua-platform&#39;: &#39;&quot;Windows&quot;&#39;,
    Referer: &#39;https://www.practicesoftwaretesting.com/&#39;,
    &#39;Accept-Language&#39;: &#39;en-US&#39;,
    &#39;sec-ch-ua&#39;: &#39;&quot;HeadlessChrome&quot;;v=&quot;147&quot;, &quot;Not.A/Brand&quot;;v=&quot;8&quot;, &quot;Chromium&quot;;v=&quot;147&quot;&#39;,
    &#39;sec-ch-ua-mobile&#39;: &#39;?0&#39;,
    &#39;User-Agent&#39;: &#39;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.7727.15 Safari/537.36&#39;,
    Accept: &#39;application/json, text/plain, */*&#39;,
    &#39;Content-Type&#39;: &#39;application/json&#39;
  }
}); &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Read More at Butch&#39;s website, Playwright Solutions:&lt;/b&gt; &lt;a href=&quot;https://playwrightsolutions.com/tip-playwright-copy-as-playwright-api-request-button/&quot; target=&quot;_blank&quot;&gt;TIP: Playwright Trace Viewer - Copy as Playwright API Request&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Five: Start Reformatting the DataFactory Code&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Butch mentioned that we can take this information to create our Datafactory. Butch created a new file, &lt;b&gt;lib/datafactory/register.ts&lt;/b&gt;, pasting the contents there, to start it off.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since Butch was extracting the data in its own file, he had to do some refactoring:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Deleted the headers. We didn&#39;t need that information for this example.&lt;/li&gt;&lt;li&gt;Imported the &quot;request&quot; fixture from @playwright/test.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Initialized the request, with a &quot;const createRequestContext = await request.newContext()&lt;/li&gt;&lt;li&gt;Switched the &quot;page.request.post&quot; to &quot;createRequestContext.post&quot;&lt;/li&gt;&lt;li&gt;Removed the string off of the object, removing the quotation marks from each variable to make it less JSON and more JavaScript.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Six: Add API_URL to Environment File&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Butch then took the API, &lt;a href=&quot;https://api.practicesoftwaretesting.com/users/register&quot;&gt;https://api.practicesoftwaretesting.com/users/register&lt;/a&gt;, to &quot;/users/register&quot; and created a new variable, const apiUrl = process.env.API_URL.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Read More on Playwright.dev:&lt;/b&gt; &lt;a href=&quot;https://playwrightsolutions.com/tip-playwright-copy-as-playwright-api-request-button/&quot; target=&quot;_blank&quot;&gt;Passing Environment Variables&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Butch added the new variable to the .env file in the root directory:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;API_URL=https://api.practicesoftwaretesting.com&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Seven: Parameterize the Email and Password&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right now, it is still static. In order to make it dynamic, Butch set email and password to a variable, then wrapped it in a function, with:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;export async function registerUser(email: string, password: string)&lt;/li&gt;&lt;/ul&gt;Lastly, Butch added code to verify that the user was created:&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Import expect from @playwright/test.&amp;nbsp;&lt;/li&gt;&lt;li&gt;expect(response.status()).toBe(201)&lt;/li&gt;&lt;li&gt;Made the entire await block a &quot;const response&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Returned the response so you know what it is in the test: return response.status().&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;register.ts&lt;/u&gt;&lt;/b&gt;&lt;pre&gt;&lt;code&gt;
import { request, expect } from &quot;@playwright/test&quot;;

export async function registerUser(email: string, password: string) {
  const apiUrl = process.env.API_URL;
  const createRequestContext = await request.newContext();
  const response = await createRequestContext.post(apiUrl + &quot;/users/register&quot;, {
    data: {
      first_name: &quot;Test&quot;,
      last_name: &quot;User&quot;,
      dob: &quot;2001-01-01&quot;,
      phone: &quot;5555555555&quot;,
      email: email,
      password: password,
      address: {
        street: &quot;101 Testing Way&quot;,
        city: &quot;New York&quot;,
        state: &quot;New York&quot;,
        country: &quot;US&quot;,
        postal_code: &quot;55555&quot;,
      },
    },
  });

  expect(response.status()).toBe(201);
  return response.status();
}
&lt;/code&gt;&lt;/pre&gt;
&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/main/lib/datafactory/register.ts&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;lib/datafactory/register.ts&lt;/i&gt;&lt;/a&gt;&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, every time you need to create a new user, you can import the function, registerUser, passing along an email and a password, and new test user will be generated.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Need to make something dynamic? Butch appended to the email address, Date.now, so it would be unique as long as the test was not run in the same second:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;const email = `test${Date.now()}@test.com&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;  
&lt;b&gt;login.spec.ts&lt;/b&gt;  
&lt;pre&gt;&lt;code&gt;
import { registerUser } from &quot;@datafactory/register&quot;;

test(&quot;login with newly registered user&quot;, async ({ page }) =&amp;gt; {
  const email = `test${Date.now()}@test.com`;
  const password = &quot;fjdWEdfs82@&quot;;

  await registerUser(email, password);
  const loginPage = new LoginPage(page);
  await loginPage.goto();
  await loginPage.login(email, password);

  await expect(page.getByTestId(&quot;nav-menu&quot;)).toContainText(&quot;Test User&quot;);
  await expect(page.getByTestId(&quot;page-title&quot;)).toContainText(&quot;My account&quot;);
});
&lt;/code&gt;&lt;/pre&gt;
  &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/tests/login/login.spec.ts#L3&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;/tests/login/login.spec.ts&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, you have your very own DataFactory!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Practicing Playwright:&lt;/b&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/05/time-to-practice-playwright.html&quot; target=&quot;&quot;&gt;Time to Practice Playwright!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/06/new-playwright-course-playwright.html&quot; target=&quot;&quot;&gt;New Playwright Course: Playwright Essential Training by Butch Mayhew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/01/hands-on-automated-testing-with.html&quot; target=&quot;&quot;&gt;Hands on Automated Testing with Playwright by Butch Mayhew is the start of a wonderful conversation with the Playwright community!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/04/what-happens-when-you-pair-playwright.html&quot; target=&quot;&quot;&gt;What happens when you pair Playwright with something other than TypeScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html&quot; target=&quot;&quot;&gt;Logging in by Storing and Using an Authentication Cookie in Your Automated Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Six&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html&quot; target=&quot;&quot;&gt;How to Detect Broken Images On Your Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Seven&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html&quot; target=&quot;&quot;&gt;Dynamically Creating Test Data with a DataFactory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Eight&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html&quot; target=&quot;&quot;&gt;Visual Testing With Playwright&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html&quot; target=&quot;&quot;&gt;API Testing, Intercepting Network Requests, and Mocking APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Source Code&lt;/b&gt;: &lt;a href=&quot;https://github.com/tjmaher/practicing-playwright&quot; target=&quot;_blank&quot;&gt;https://github.com/tjmaher/practicing-playwright&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;&lt;br&gt;


&lt;div&gt;&amp;nbsp;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/2211361517217998306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2211361517217998306'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2211361517217998306'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html' title='Practicing Playwright: Dynamically Creating Test Data with a DataFactory'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEiyk7C6gUh_bVQ-Z8n8xU2v3z3cRxfxtTAR7xS_YcYEKLAVxA00lAhoi9v1YYETqqKPhBzqSQAgiPsB4Pf0yigV1JTcii6EJ0dXw7X8atDgqQ2BYlFv3DIYccGVgms6ozIe1WgQjhxK5_eU4EzTv9gxlXroKr_fuolIyjsMIfGSQvAM6Wa-w8geJtbIhbY=s72-w640-h624-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-2792625146737077425</id><published>2026-05-13T16:36:36.044-04:00</published><updated>2026-06-04T12:39:04.671-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Practicing Playwright: How to Detect Broken Images On Your Site </title><content type='html'>&lt;div&gt;Butch Mayhew&#39;s LinkedIn Learning Course&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/learning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios&quot;&gt;Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios&lt;/a&gt;&amp;nbsp;has been a wonderful resource learning more about Playwright.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With this blog post, I will be walking through how Butch injects JavaScript into a test, in order to check if any elements in a shopping cart have any broken images.&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Playwright / Evaluating JavaScript&lt;/b&gt;: &lt;a href=&quot;https://playwright.dev/docs/evaluating&quot;&gt;https://playwright.dev/docs/evaluating&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Butch Mayhew&#39;s &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224&quot;&gt;companion GitHub site&lt;/a&gt; on &lt;a href=&quot;https://github.com/LinkedInLearning&quot;&gt;LinkedIn Learning&#39;s GitHub page&lt;/a&gt;. &lt;/li&gt;&lt;li&gt;&lt;b&gt;Butch&#39;s Resources File&lt;/b&gt;: &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/RESOURCES.md&quot;&gt;RESOURCES.MD&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Site under test: Practice Software Testing&lt;/b&gt;: &lt;a href=&quot;https://practicesoftwaretesting.com/&quot;&gt;https://practicesoftwaretesting.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Practice Software Testing Website, With Bugs&lt;/b&gt;: &lt;a href=&quot;https://with-bugs.practicesoftwaretesting.com&quot;&gt;https://with-bugs.practicesoftwaretesting.com&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Butch&#39;s GitHub site for the course has many resources listed in his Resources Markdown file, JavaScript code which can detect if their are any missing element ids &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/RESOURCES.md#03_06-injecting-javascript-in-playwright&quot; target=&quot;_blank&quot;&gt;or broken images&lt;/a&gt; in any elements returned.&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Find Broken Images with JavaScript&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;RESOURCES.md / Injecting JavaScript in Playwright&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Array.from(document.querySelectorAll(&quot;img&quot;))
  .filter((img) =&amp;gt; img.naturalWidth === 0 || img.naturalHeight === 0)
  .map((img) =&amp;gt; img.src);
&lt;/code&gt;&lt;/pre&gt;  


&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s examine this code found on Butch Mayhew&#39;s&amp;nbsp;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/RESOURCES.md&quot;&gt;RESOURCES.MD&lt;/a&gt;&amp;nbsp;file:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;document.querySelectorAll(&quot;img&quot;)&lt;/u&gt;:&lt;/b&gt; The JavaScript D&lt;b&gt;ocument&lt;/b&gt; interface, &quot;represents any web page loaded in the browser, and serves as an entry point into the web page&#39;s content&quot; according to the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Document&quot; target=&quot;_blank&quot;&gt;Mozilla Developer Network&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Document interface also includes a method called &lt;b&gt;.querySelectorAll()&lt;/b&gt;&amp;nbsp;[ &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll&quot; target=&quot;_blank&quot;&gt;See Mozilla API&lt;/a&gt; ] which returns a list of the HTML document&#39;s elements that match the designated selector which, in this case is an &quot;img&quot; tag. This returns a static NodeList, a snapshot collection of nodes it sees at that time.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Array.from&lt;/b&gt;&amp;nbsp;will convert the NodeList into a JavaScript array, so we can then use array methods such as &lt;b&gt;filter&lt;/b&gt;, which creates a new array from the results without changing the original array.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We are filtering to see if there are images which do not have a width or ( &lt;b&gt;||&lt;/b&gt; ) height, meaning they are broken images. &lt;b&gt;img.naturalWidth&lt;/b&gt; is a read-only HTMLImageElement that returns the &lt;i&gt;original&lt;/i&gt; width of an image in pixels.&amp;nbsp; [ &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalWidth&quot; target=&quot;_blank&quot;&gt;See MDN entry&lt;/a&gt; ]&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code will loop through the filtered array, find the list of broken images, then extract a list of URLs from the source code, pointing to the broken images, if any.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Playwright Evaluating JavaScript&lt;/h2&gt;&quot;Playwright scripts run in your Playwright environment. Your page scripts run in the browser page environment. Those environments don&#39;t intersect, they are running in different virtual machines in different processes and even potentially on different computers.&lt;br /&gt;&lt;br /&gt;&quot;The &lt;a href=&quot;https://playwright.dev/docs/api/class-page#page-evaluate&quot;&gt;page.evaluate()&lt;/a&gt; API can run a JavaScript function in the context of the web page and bring results back to the Playwright environment&quot;. - &lt;a href=&quot;https://playwright.dev/docs/evaluating&quot; target=&quot;_blank&quot;&gt;Playwright Docs / Evaluating JavaScript&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;This JavaScript code Butch came up with to detect broken images can be injected into his test with JavaScript evaluations.&amp;nbsp;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;
test(&quot;check for broken images&quot;, async ({ page }) =&amp;gt; {
    // await page.goto(&quot;https://with-bugs.practicesoftwaretesting.com/&quot;);

    const brokenImages = await page.evaluate(() =&amp;gt; {
      return Array.from(document.querySelectorAll(&quot;img&quot;))
        .filter((img) =&amp;gt; img.naturalWidth === 0 || img.naturalHeight === 0)
        .map((img) =&amp;gt; img.src);
    });
    expect(
      brokenImages.length,
      `Broken Images: ${brokenImages.toString()}`
    ).toBe(0);
  });

&lt;/code&gt;&lt;/pre&gt;




&lt;div&gt;Although practicesoftwaretesting.com does not have broken images, this test site does offer a version which does: &lt;a href=&quot;https://with-bugs.practicesoftwaretesting.com/&quot;&gt;https://with-bugs.practicesoftwaretesting.com/&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ideally, we want the number of broken images to be zero. If we wanted to catch the broken images on the purposely broken test site, following Butch&#39;s code:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Uncomment out the With Bugs version of the site, so we can go to that page for this test.&lt;/li&gt;&lt;li&gt;Declare a new constant, brokenImages, which will list the broken images it detects.&lt;/li&gt;&lt;li&gt;The JavaScript injection to actually find the broken images will be evaluated with a result returned.&amp;nbsp;&lt;/li&gt;&lt;li&gt;We will expect the number of brokenImages to be zero. If not, we are going to return the web addresses of broken images that it found.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;So, that&#39;s how you create a Playwright test that detects broken images!&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
  
&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Practicing Playwright:&lt;/b&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/05/time-to-practice-playwright.html&quot; target=&quot;&quot;&gt;Time to Practice Playwright!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/06/new-playwright-course-playwright.html&quot; target=&quot;&quot;&gt;New Playwright Course: Playwright Essential Training by Butch Mayhew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/01/hands-on-automated-testing-with.html&quot; target=&quot;&quot;&gt;Hands on Automated Testing with Playwright by Butch Mayhew is the start of a wonderful conversation with the Playwright community!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/04/what-happens-when-you-pair-playwright.html&quot; target=&quot;&quot;&gt;What happens when you pair Playwright with something other than TypeScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html&quot; target=&quot;&quot;&gt;Logging in by Storing and Using an Authentication Cookie in Your Automated Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Six&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html&quot; target=&quot;&quot;&gt;How to Detect Broken Images On Your Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Seven&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html&quot; target=&quot;&quot;&gt;Dynamically Creating Test Data with a DataFactory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Eight&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html&quot; target=&quot;&quot;&gt;Visual Testing With Playwright&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html&quot; target=&quot;&quot;&gt;API Testing, Intercepting Network Requests, and Mocking APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Source Code&lt;/b&gt;: &lt;a href=&quot;https://github.com/tjmaher/practicing-playwright&quot; target=&quot;_blank&quot;&gt;https://github.com/tjmaher/practicing-playwright&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;&lt;br&gt;  
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/2792625146737077425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2792625146737077425'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2792625146737077425'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html' title='Practicing Playwright: How to Detect Broken Images On Your Site '/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-6634369418291478580</id><published>2026-05-11T16:52:22.666-04:00</published><updated>2026-05-11T16:59:42.019-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Pramod Dutta discusses 7 Playwright features senior SDETs use daily</title><content type='html'>&lt;!--═══════════════════════════════════════════════════════════════════
     Playwright: Seven Commands Worth Knowing
     Blogger post body — paste into the HTML editor
     ═══════════════════════════════════════════════════════════════════--&gt;

&lt;style&gt;
/* ── Scoped to .pw-post so nothing bleeds into Blogger chrome ── */
.pw-post {
  font-family: Georgia, &#39;Times New Roman&#39;, serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #1a1a1a;
  max-width: 820px;
  margin: 0 auto;
}

/* headings */
.pw-post h2 {
  font-family: &#39;Trebuchet MS&#39;, Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2.4rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #00b25a;
  color: #002d1a;
}
.pw-post h3 {
  font-family: &#39;Trebuchet MS&#39;, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.6rem 0 0.3rem;
  color: #004d2b;
}

/* version badge */
.pw-badge {
  display: inline-block;
  font-family: &#39;Trebuchet MS&#39;, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #00b25a;
  color: #fff;
  padding: 2px 8px 3px;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  text-decoration: none;
  white-space: nowrap;
}
.pw-badge:hover { background: #008f47; color: #fff; }

/* description callout */
.pw-desc {
  background: #f0faf5;
  border-left: 4px solid #00b25a;
  padding: 0.75rem 1.1rem;
  margin: 0.8rem 0 1.2rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.97rem;
}

/* code blocks */
.pw-post pre {
  background: #0d1117;
  color: #e6edf3;
  font-family: &#39;Cascadia Code&#39;, &#39;Fira Code&#39;, &#39;Courier New&#39;, monospace;
  font-size: 0.83rem;
  line-height: 1.6;
  padding: 1.1rem 1.3rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.8rem 0 1.4rem;
  white-space: pre;
}
.pw-post code {
  font-family: &#39;Cascadia Code&#39;, &#39;Fira Code&#39;, &#39;Courier New&#39;, monospace;
  font-size: 0.88em;
  background: #e8f5ee;
  color: #004d2b;
  padding: 1px 5px;
  border-radius: 3px;
}
.pw-post pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* syntax colour hints (manual) */
.kw  { color: #ff7b72; }   /* keyword */
.str { color: #a5d6ff; }   /* string  */
.cmt { color: #8b949e; font-style: italic; } /* comment */
.fn  { color: #d2a8ff; }   /* function/method */
.num { color: #79c0ff; }   /* number  */

/* links table */
.pw-links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.5rem 0 1.5rem;
}
.pw-links-table th {
  text-align: left;
  background: #002d1a;
  color: #fff;
  padding: 6px 10px;
  font-family: &#39;Trebuchet MS&#39;, Arial, sans-serif;
}
.pw-links-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #d4eddf;
  vertical-align: top;
}
.pw-links-table tr:nth-child(even) td { background: #f0faf5; }
.pw-links-table a { color: #007a3d; }

/* further reading list */
.pw-reading {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
}
.pw-reading li {
  padding: 0.55rem 0;
  border-bottom: 1px solid #d4eddf;
}
.pw-reading li:last-child { border-bottom: none; }
.pw-reading .pw-reading-title {
  font-weight: 600;
  color: #007a3d;
}
.pw-reading .pw-reading-meta {
  font-size: 0.82rem;
  color: #555;
  margin-top: 1px;
}

/* separator */
.pw-rule {
  border: none;
  border-top: 1px solid #c8e8d4;
  margin: 2.5rem 0;
}

/* sign-off */
.pw-signoff {
  margin-top: 2.5rem;
  font-style: italic;
  color: #444;
}
&lt;/style&gt;

&lt;div class=&quot;pw-post&quot;&gt;&lt;b&gt;Pramod Dutta&lt;/b&gt;, &lt;a href=&quot;https://www.linkedin.com/in/pramoddutta/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BDjFlrRQ1Rtut703aaORrhg%3D%3D&quot;&gt;an SDET from Tekion&lt;/a&gt;, posted on LinkedIn &quot;&lt;a href=&quot;https://www.linkedin.com/posts/pramoddutta_playwright-testautomation-qa-share-7459464157818466304-MvpP?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAAAA8wfYBpAyZ0pTDZvsInQZl3dpfWfJ_riU&quot;&gt;7 Playwright features senior SDETs use daily&lt;/a&gt;&quot;. The Playwright features, according to Pramod:&lt;/div&gt;&lt;div class=&quot;pw-post&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;pw-post&quot;&gt;&quot;→ &lt;b&gt;addLocatorHandler&lt;/b&gt; — auto-dismiss cookie banners, GDPR popups, session modals. One handler. Whole suite cleaner. Stop writing wrapper functions.&lt;br /&gt;&quot;→ &lt;b&gt;browser.bind()&lt;/b&gt; — launch one browser. Let your test, Claude Code, and debugger all attach to it simultaneously. The debugging workflow that fixes &quot;works on my machine&quot; forever.&lt;br /&gt;&quot;→ &lt;b&gt;URLSearchParams in request.get()&lt;/b&gt; — stop building query strings manually. Eliminates an entire bug class around URL encoding in API tests.&lt;br /&gt;&quot;→ &lt;b&gt;expect.toPass() &lt;/b&gt;— polling-based assertions for state that converges over time. The right tool for &#39;this should eventually be true.&#39; Not the same as expect(locator).toBeVisible(). Different problem, different solution.&lt;br /&gt;&quot;→ &lt;b&gt;page.requestGC()&lt;/b&gt; — manually trigger garbage collection in the browser. The only Playwright tool that catches memory leaks before production. Used with WeakRef in page.evaluate().&lt;br /&gt;&quot;→ &lt;b&gt;--tsconfig flag&lt;/b&gt; — pass a specific tsconfig to Playwright instead of relying on the heuristic. Saves you from &quot;works locally, fails in CI&quot; because of resolved-config differences.&lt;br /&gt;&quot;→ &lt;b&gt;webServer.wait regex&lt;/b&gt; — wait until your webserver logs match a pattern, not a fixed port check. The difference between &#39;the server is listening&#39; and &#39;the server is actually ready.&#39;&quot;&lt;br /&gt;&lt;br /&gt; I scribbled these features down, then turned them over to Claude.ai, my research assistant, to see if he could explain these methods, come up with sample code using them, then add bullet points to the official documentation, source code, and the release notes. &lt;br /&gt;&lt;br /&gt;... Let&#39;s see how well Claude did explaining them ... &lt;p&gt;&amp;nbsp;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     1. page.addLocatorHandler()
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;page.addLocatorHandler()&lt;/code&gt;
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-142&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;v1.42 — March 2024&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  Registers a callback that fires whenever a specified locator becomes visible
  and risks blocking a Playwright action. Playwright checks for the locator
  before every actionability check or auto-waiting assertion. When the locator
  is visible, the handler runs first, then the test continues. The handler only
  fires during actions; appearing passively between actions does not trigger it.
  After the handler runs, Playwright waits for the overlay to become hidden
  before proceeding (opt out with &lt;code&gt;noWaitAfter: true&lt;/code&gt;).
  Use the &lt;code&gt;times&lt;/code&gt; option to cap the number of invocations.
  The handler receives the triggering locator as its argument.
&lt;/div&gt;

&lt;h3&gt;Cookie banner (fire-and-forget)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// Register once, before navigating.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;addLocatorHandler&lt;/span&gt;(
  page.&lt;span class=&quot;fn&quot;&gt;getByRole&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;heading&#39;&lt;/span&gt;, { name: &lt;span class=&quot;str&quot;&gt;&#39;You are in control of your cookies.&#39;&lt;/span&gt; }),
  &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; () =&amp;gt; {
    &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;getByRole&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;button&#39;&lt;/span&gt;, { name: &lt;span class=&quot;str&quot;&gt;&#39;Accept all&#39;&lt;/span&gt; }).&lt;span class=&quot;fn&quot;&gt;click&lt;/span&gt;();
  }
);

&lt;span class=&quot;cmt&quot;&gt;// Write the rest of the test normally.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;goto&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;https://www.example.com/&#39;&lt;/span&gt;);
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;getByRole&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;link&#39;&lt;/span&gt;, { name: &lt;span class=&quot;str&quot;&gt;&#39;Shop now&#39;&lt;/span&gt; }).&lt;span class=&quot;fn&quot;&gt;click&lt;/span&gt;();&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Self-removing handler with access to the triggering locator&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// The handler receives the matched locator; times: 1 auto-removes it.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; closeBtn = page.&lt;span class=&quot;fn&quot;&gt;getByLabel&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;Close&#39;&lt;/span&gt;);
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;addLocatorHandler&lt;/span&gt;(closeBtn, &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; (locator) =&amp;gt; {
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; locator.&lt;span class=&quot;fn&quot;&gt;click&lt;/span&gt;();
}, { times: &lt;span class=&quot;num&quot;&gt;1&lt;/span&gt; });

&lt;span class=&quot;cmt&quot;&gt;// Remove manually when no longer needed.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;removeLocatorHandler&lt;/span&gt;(closeBtn);&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Fail fast on an application error overlay&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// Instead of dismissing, throw immediately so the test does not hang.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;addLocatorHandler&lt;/span&gt;(
  page.&lt;span class=&quot;fn&quot;&gt;getByRole&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;heading&#39;&lt;/span&gt;, { name: &lt;span class=&quot;str&quot;&gt;&quot;Sorry, there&#39;s been a problem&quot;&lt;/span&gt; }),
  &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; () =&amp;gt; {
    &lt;span class=&quot;kw&quot;&gt;throw new&lt;/span&gt; Error(&lt;span class=&quot;str&quot;&gt;`Error overlay appeared on &lt;span class=&quot;kw&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;url&lt;/span&gt;()&lt;span class=&quot;kw&quot;&gt;}&lt;/span&gt;`&lt;/span&gt;);
  }
);&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Official docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-page#page-add-locator-handler&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — page.addLocatorHandler()&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.42)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-142&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-142&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.42.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.42.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.42.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/client/page.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright-core/src/client/page.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     2. browser.bind()
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;browser.bind()&lt;/code&gt;
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-159&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;v1.59 — April 2026&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  Binds a launched browser to a named pipe or WebSocket endpoint, making it
  available to &lt;code&gt;playwright-cli&lt;/code&gt;, &lt;code&gt;@playwright/mcp&lt;/code&gt;, and any
  other Playwright client simultaneously. Before v1.59, sharing a browser between
  an MCP agent and a test suite meant two separate processes. Now a single
  &lt;code&gt;browser.bind()&lt;/code&gt; call exposes one browser session to all of them.
  Call &lt;code&gt;browser.unbind()&lt;/code&gt; to stop accepting new connections; existing
  connections keep working. Run &lt;code&gt;playwright-cli show&lt;/code&gt; to open the live
  dashboard listing all bound browsers.
&lt;/div&gt;

&lt;h3&gt;Bind via named pipe (local only)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; { chromium } &lt;span class=&quot;kw&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;

&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; browser = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; chromium.&lt;span class=&quot;fn&quot;&gt;launch&lt;/span&gt;();
&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; { endpoint } = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; browser.&lt;span class=&quot;fn&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;my-session&#39;&lt;/span&gt;, {
  workspaceDir: &lt;span class=&quot;str&quot;&gt;&#39;/my/project&#39;&lt;/span&gt;,
});
console.&lt;span class=&quot;fn&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;Session bound:&#39;&lt;/span&gt;, endpoint);&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Bind via WebSocket (shareable over a network)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; { endpoint: wsEndpoint } = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; browser.&lt;span class=&quot;fn&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;my-session&#39;&lt;/span&gt;, {
  host: &lt;span class=&quot;str&quot;&gt;&#39;localhost&#39;&lt;/span&gt;,
  port: &lt;span class=&quot;num&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;cmt&quot;&gt;// let the OS pick an available port&lt;/span&gt;
});
console.&lt;span class=&quot;fn&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;WebSocket endpoint:&#39;&lt;/span&gt;, wsEndpoint); &lt;span class=&quot;cmt&quot;&gt;// ws://localhost:PORT/...&lt;/span&gt;

&lt;span class=&quot;cmt&quot;&gt;// A second Playwright client connects to the same browser.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; browser2 = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; chromium.&lt;span class=&quot;fn&quot;&gt;connect&lt;/span&gt;(wsEndpoint);
&lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; page = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; browser2.&lt;span class=&quot;fn&quot;&gt;newPage&lt;/span&gt;();

&lt;span class=&quot;cmt&quot;&gt;// Stop accepting new connections when done.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; browser.&lt;span class=&quot;fn&quot;&gt;unbind&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;my-session&#39;&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Official docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-browser#browser-bind&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — browser.bind()&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.59)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-159&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-159&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.59.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.59.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.59.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/client/browser.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright-core/src/client/browser.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     3. URLSearchParams in request.get()
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;URLSearchParams&lt;/code&gt; in &lt;code&gt;request.get()&lt;/code&gt;
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;v1.46 — August 2024&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  The &lt;code&gt;params&lt;/code&gt; option on &lt;code&gt;APIRequestContext&lt;/code&gt; methods
  (&lt;code&gt;get&lt;/code&gt;, &lt;code&gt;post&lt;/code&gt;, &lt;code&gt;put&lt;/code&gt;, &lt;code&gt;patch&lt;/code&gt;,
  &lt;code&gt;delete&lt;/code&gt;) now accepts a native &lt;code&gt;URLSearchParams&lt;/code&gt; object
  or a plain query string in addition to the existing plain-object shorthand.
  This matters when you need to send the same key more than once, which a plain
  object cannot express.
&lt;/div&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;fn&quot;&gt;test&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;query params via URLSearchParams&#39;&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; ({ request }) =&amp;gt; {

  &lt;span class=&quot;cmt&quot;&gt;// URLSearchParams lets you append duplicate keys.&lt;/span&gt;
  &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; params = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; URLSearchParams();
  params.&lt;span class=&quot;fn&quot;&gt;set&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;userId&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;1&#39;&lt;/span&gt;);
  params.&lt;span class=&quot;fn&quot;&gt;append&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;tag&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;automation&#39;&lt;/span&gt;);
  params.&lt;span class=&quot;fn&quot;&gt;append&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;tag&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;playwright&#39;&lt;/span&gt;); &lt;span class=&quot;cmt&quot;&gt;// duplicate key — plain object cannot do this&lt;/span&gt;

  &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; response = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; request.&lt;span class=&quot;fn&quot;&gt;get&lt;/span&gt;(
    &lt;span class=&quot;str&quot;&gt;&#39;https://jsonplaceholder.typicode.com/posts&#39;&lt;/span&gt;,
    { params }
  );
  &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(response.&lt;span class=&quot;fn&quot;&gt;status&lt;/span&gt;()).&lt;span class=&quot;fn&quot;&gt;toBe&lt;/span&gt;(&lt;span class=&quot;num&quot;&gt;200&lt;/span&gt;);

  &lt;span class=&quot;cmt&quot;&gt;// Or just pass a pre-built query string.&lt;/span&gt;
  &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; response2 = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; request.&lt;span class=&quot;fn&quot;&gt;get&lt;/span&gt;(
    &lt;span class=&quot;str&quot;&gt;&#39;https://jsonplaceholder.typicode.com/posts&#39;&lt;/span&gt;,
    { params: &lt;span class=&quot;str&quot;&gt;&#39;userId=1&amp;amp;tag=automation&#39;&lt;/span&gt; }
  );
  &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(response2.&lt;span class=&quot;fn&quot;&gt;ok&lt;/span&gt;()).&lt;span class=&quot;fn&quot;&gt;toBeTruthy&lt;/span&gt;();
});&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Official docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — APIRequestContext.get()&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.46)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-146&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.46.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.46.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.46.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/client/fetch.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright-core/src/client/fetch.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     4. expect.toPass()
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;expect.toPass()&lt;/code&gt;
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-144&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;intervals config — v1.44 May 2024&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  Wraps an &lt;code&gt;async&lt;/code&gt; callback and retries it until every assertion
  inside passes or a timeout is reached. Unlike Playwright&#39;s built-in
  auto-retrying locator assertions, &lt;code&gt;toPass&lt;/code&gt; can contain arbitrary
  logic including API requests, multi-step flows, and non-locator checks.
  By default the timeout is &lt;strong&gt;0&lt;/strong&gt; (no timeout) and probe intervals
  default to &lt;code&gt;[100, 250, 500, 1000]&lt;/code&gt; ms. Both are configurable
  globally in &lt;code&gt;testConfig.expect.toPass&lt;/code&gt; or per-call.
&lt;/div&gt;

&lt;h3&gt;Polling an endpoint until ready&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;fn&quot;&gt;test&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;waits for background job&#39;&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; ({ request }) =&amp;gt; {
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(&lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; () =&amp;gt; {
    &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; res = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; request.&lt;span class=&quot;fn&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;https://api.example.com/job/status&#39;&lt;/span&gt;);
    &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(res.&lt;span class=&quot;fn&quot;&gt;status&lt;/span&gt;()).&lt;span class=&quot;fn&quot;&gt;toBe&lt;/span&gt;(&lt;span class=&quot;num&quot;&gt;200&lt;/span&gt;);
    &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; body = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; res.&lt;span class=&quot;fn&quot;&gt;json&lt;/span&gt;();
    &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(body.status).&lt;span class=&quot;fn&quot;&gt;toBe&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;complete&#39;&lt;/span&gt;);
  }).&lt;span class=&quot;fn&quot;&gt;toPass&lt;/span&gt;({
    intervals: [&lt;span class=&quot;num&quot;&gt;1_000&lt;/span&gt;, &lt;span class=&quot;num&quot;&gt;2_000&lt;/span&gt;, &lt;span class=&quot;num&quot;&gt;10_000&lt;/span&gt;], &lt;span class=&quot;cmt&quot;&gt;// probe at 1 s, 2 s, then every 10 s&lt;/span&gt;
    timeout:   &lt;span class=&quot;num&quot;&gt;60_000&lt;/span&gt;,
  });
});&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Global configuration in &lt;code&gt;playwright.config.ts&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; { defineConfig } &lt;span class=&quot;kw&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;
&lt;span class=&quot;kw&quot;&gt;export default&lt;/span&gt; &lt;span class=&quot;fn&quot;&gt;defineConfig&lt;/span&gt;({
  expect: {
    toPass: {
      timeout:   &lt;span class=&quot;num&quot;&gt;30_000&lt;/span&gt;,
      intervals: [&lt;span class=&quot;num&quot;&gt;500&lt;/span&gt;, &lt;span class=&quot;num&quot;&gt;1_000&lt;/span&gt;, &lt;span class=&quot;num&quot;&gt;5_000&lt;/span&gt;],
    },
  },
});&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Official docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/test-assertions#expecttopass&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — Assertions: expect.toPass()&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.44)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-144&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-144&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.44.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.44.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.44.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright/src/matchers/toPass.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright/src/matchers/toPass.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     5. page.requestGC()
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;page.requestGC()&lt;/code&gt;
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;v1.46 — August 2024&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  Asks the browser to run garbage collection on the page. There is no guarantee
  that every unreachable object is collected, but in practice it is reliable
  enough to detect leaks in combination with JavaScript
  &lt;code&gt;WeakRef&lt;/code&gt;. The pattern: store a &lt;code&gt;WeakRef&lt;/code&gt; to the object
  under suspicion, call &lt;code&gt;requestGC()&lt;/code&gt;, then assert that
  &lt;code&gt;deref()&lt;/code&gt; returns &lt;code&gt;undefined&lt;/code&gt;.
&lt;/div&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;fn&quot;&gt;test&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;no memory leak on the large object&#39;&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; ({ page }) =&amp;gt; {
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;goto&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;https://your-app.com&#39;&lt;/span&gt;);

  &lt;span class=&quot;cmt&quot;&gt;// 1. Pin a WeakRef to the object under suspicion.&lt;/span&gt;
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;evaluate&lt;/span&gt;(() =&amp;gt; {
    (&lt;span class=&quot;kw&quot;&gt;globalThis as any&lt;/span&gt;).suspectWeakRef = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; WeakRef((&lt;span class=&quot;kw&quot;&gt;window as any&lt;/span&gt;).largeObject);
  });

  &lt;span class=&quot;cmt&quot;&gt;// 2. Request GC.&lt;/span&gt;
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;requestGC&lt;/span&gt;();

  &lt;span class=&quot;cmt&quot;&gt;// 3. A living WeakRef means a leak; deref() should now be undefined.&lt;/span&gt;
  &lt;span class=&quot;kw&quot;&gt;const&lt;/span&gt; leaked = &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;evaluate&lt;/span&gt;(
    () =&amp;gt; !!(&lt;span class=&quot;kw&quot;&gt;globalThis as any&lt;/span&gt;).suspectWeakRef.&lt;span class=&quot;fn&quot;&gt;deref&lt;/span&gt;()
  );
  &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(leaked).&lt;span class=&quot;fn&quot;&gt;toBe&lt;/span&gt;(&lt;span class=&quot;kw&quot;&gt;false&lt;/span&gt;);
});&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Official docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-page#page-request-gc&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — page.requestGC()&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.46)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-146&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.46.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.46.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.46.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/client/page.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright-core/src/client/page.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     6. tsconfig flag
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  TypeScript Config: &lt;code&gt;--tsconfig&lt;/code&gt; flag &amp;amp; &lt;code&gt;testConfig.tsconfig&lt;/code&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  Playwright looks up the nearest &lt;code&gt;tsconfig.json&lt;/code&gt; for each imported
  file by default. Two complementary options override this. The
  &lt;code&gt;--tsconfig&lt;/code&gt; CLI flag
  &lt;a href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;(v1.46, August 2024)&lt;/a&gt;
  applies one tsconfig to all imported files from the command line. The
  &lt;code&gt;testConfig.tsconfig&lt;/code&gt; property
  &lt;a href=&quot;https://playwright.dev/docs/release-notes#version-149&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;(v1.49, October 2024)&lt;/a&gt;
  does the same from the config file. Note that Playwright only honours four
  tsconfig options: &lt;code&gt;allowJs&lt;/code&gt;, &lt;code&gt;baseUrl&lt;/code&gt;,
  &lt;code&gt;paths&lt;/code&gt;, and &lt;code&gt;references&lt;/code&gt;.
&lt;/div&gt;

&lt;h3&gt;CLI flag&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;# Apply one tsconfig to everything Playwright loads.&lt;/span&gt;
npx playwright test --tsconfig tsconfig.test.json&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Config file property&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// playwright.config.ts&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; { defineConfig } &lt;span class=&quot;kw&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;
&lt;span class=&quot;kw&quot;&gt;export default&lt;/span&gt; &lt;span class=&quot;fn&quot;&gt;defineConfig&lt;/span&gt;({
  tsconfig: &lt;span class=&quot;str&quot;&gt;&#39;./tsconfig.test.json&#39;&lt;/span&gt;,
});&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Example &lt;code&gt;tests/tsconfig.json&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;{
  &lt;span class=&quot;str&quot;&gt;&quot;compilerOptions&quot;&lt;/span&gt;: {
    &lt;span class=&quot;str&quot;&gt;&quot;baseUrl&quot;&lt;/span&gt;: &lt;span class=&quot;str&quot;&gt;&quot;.&quot;&lt;/span&gt;,
    &lt;span class=&quot;str&quot;&gt;&quot;allowJs&quot;&lt;/span&gt;: &lt;span class=&quot;kw&quot;&gt;true&lt;/span&gt;,
    &lt;span class=&quot;str&quot;&gt;&quot;paths&quot;&lt;/span&gt;: {
      &lt;span class=&quot;str&quot;&gt;&quot;@helpers/*&quot;&lt;/span&gt;: [&lt;span class=&quot;str&quot;&gt;&quot;../src/helpers/*&quot;&lt;/span&gt;]
    }
  }
}&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;TypeScript guide&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/test-typescript&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — TypeScript&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code&gt;testConfig.tsconfig&lt;/code&gt; docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-testconfig#test-config-tsconfig&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — TestConfig.tsconfig&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (&lt;code&gt;--tsconfig&lt;/code&gt;, v1.46)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-146&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-146&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (&lt;code&gt;testConfig.tsconfig&lt;/code&gt;, v1.49)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-149&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-149&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.46.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.46.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.46.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.49.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.49.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.49.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright/src/transform/transform.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright/src/transform/transform.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     7. webServer.wait regex
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;
  &lt;code&gt;webServer.wait&lt;/code&gt; Regex
  &lt;a class=&quot;pw-badge&quot; href=&quot;https://playwright.dev/docs/release-notes#version-159&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;v1.59 — April 2026&lt;/a&gt;
&lt;/h2&gt;

&lt;div class=&quot;pw-desc&quot;&gt;
  The &lt;code&gt;webServer&lt;/code&gt; block in &lt;code&gt;playwright.config.ts&lt;/code&gt; previously
  waited for a URL to respond with a 2xx–4xx status. The new
  &lt;code&gt;wait.stdout&lt;/code&gt; and &lt;code&gt;wait.stderr&lt;/code&gt; sub-options accept regular
  expressions and watch the server process output instead. This is useful for dev
  servers that print a readiness message rather than exposing an HTTP health
  endpoint. Named capture groups in the regex are automatically exported as
  environment variables, so a varying port can be passed directly to
  &lt;code&gt;test.use({ baseURL })&lt;/code&gt;.
&lt;/div&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// playwright.config.ts&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; { defineConfig } &lt;span class=&quot;kw&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;
&lt;span class=&quot;kw&quot;&gt;export default&lt;/span&gt; &lt;span class=&quot;fn&quot;&gt;defineConfig&lt;/span&gt;({
  webServer: {
    command: &lt;span class=&quot;str&quot;&gt;&#39;npm run start&#39;&lt;/span&gt;,
    wait: {
      &lt;span class=&quot;cmt&quot;&gt;// Named group &quot;my_server_port&quot; is stored in process.env.MY_SERVER_PORT&lt;/span&gt;
      stdout: &lt;span class=&quot;str&quot;&gt;/Listening on port (?&amp;lt;my_server_port&amp;gt;\d+)/&lt;/span&gt;,
    },
  },
});&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;cmt&quot;&gt;// In a test file — consume the captured port.&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; { test } &lt;span class=&quot;kw&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;@playwright/test&#39;&lt;/span&gt;;

test.&lt;span class=&quot;fn&quot;&gt;use&lt;/span&gt;({
  baseURL: &lt;span class=&quot;str&quot;&gt;`http://localhost:&lt;span class=&quot;kw&quot;&gt;${&lt;/span&gt;process.env.MY_SERVER_PORT ?? &lt;span class=&quot;num&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;kw&quot;&gt;}&lt;/span&gt;`&lt;/span&gt;,
});

&lt;span class=&quot;fn&quot;&gt;test&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;homepage loads&#39;&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;async&lt;/span&gt; ({ page }) =&amp;gt; {
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; page.&lt;span class=&quot;fn&quot;&gt;goto&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;/&#39;&lt;/span&gt;);
  &lt;span class=&quot;kw&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;fn&quot;&gt;expect&lt;/span&gt;(page).&lt;span class=&quot;fn&quot;&gt;toHaveTitle&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;/My App/&lt;/span&gt;);
});&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;pw-links-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Resource&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Web server guide&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/test-webserver&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — Web Server&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code&gt;testConfig.webServer&lt;/code&gt; docs&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/api/class-testconfig#test-config-web-server&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev — TestConfig.webServer&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Release notes (v1.59)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://playwright.dev/docs/release-notes#version-159&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;playwright.dev/docs/release-notes#version-159&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub release (v1.59.0)&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/releases/tag/v1.59.0&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;github.com — Release v1.59.0&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Source code&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright/src/plugins/webServerPlugin.ts&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;packages/playwright/src/plugins/webServerPlugin.ts&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr class=&quot;pw-rule&quot; /&gt;


&lt;!--═══════════════════════════════════════════════
     Further Reading
     ═══════════════════════════════════════════════--&gt;
&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul class=&quot;pw-reading&quot;&gt;
  &lt;li&gt;
    &lt;div&gt;
      &lt;a class=&quot;pw-reading-title&quot; href=&quot;https://www.martinpoole.cv/blog/playwright-locator-handler&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;
        The Power of Playwright&#39;s Locator Handler
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;pw-reading-meta&quot;&gt;
      Martin Poole — February 2026 — Draws a direct comparison to QTP/UFT
      Disaster Recovery patterns and demonstrates a &lt;code&gt;beforeEach&lt;/code&gt; strategy
      that fails tests immediately on unexpected application error overlays.
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;
      &lt;a class=&quot;pw-reading-title&quot; href=&quot;https://testdino.com/blog/playwright-release-guide&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;
        Playwright 1.59 Release: New Features for Agentic Testing
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;pw-reading-meta&quot;&gt;
      TestDino — April 2026 — Covers &lt;code&gt;browser.bind()&lt;/code&gt; with
      working multi-client code samples, the &lt;code&gt;playwright-cli&lt;/code&gt; dashboard,
      and the new &lt;code&gt;page.screencast&lt;/code&gt; API.
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;
      &lt;a class=&quot;pw-reading-title&quot; href=&quot;https://www.skptricks.com/2025/05/use-playwrights-addlocatorhandler-to-close-unpredictable-ui-elements.html&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;
        Use Playwright&#39;s addLocatorHandler to Close Unpredictable UI Elements
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;pw-reading-meta&quot;&gt;
      SKPTricks — May 2025 — Walks through cookie banners, modal overlays,
      and adding retry logic inside a handler when a click does not immediately dismiss
      the element.
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;
      &lt;a class=&quot;pw-reading-title&quot; href=&quot;https://medium.com/@bhushantbn/playwright-version-1-44-released-bff8323d69c4&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;
        Playwright Version 1.44 Released
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;pw-reading-meta&quot;&gt;
      Bhushan Trivedi — May 2024 — Covers the &lt;code&gt;times&lt;/code&gt; and
      &lt;code&gt;noWaitAfter&lt;/code&gt; additions to &lt;code&gt;addLocatorHandler&lt;/code&gt;, and the
      &lt;code&gt;expect.toPass&lt;/code&gt; interval configuration that shipped in the same
      release.
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;
      &lt;a class=&quot;pw-reading-title&quot; href=&quot;https://umairqa.medium.com/configuring-web-server-in-playwright-for-end-to-end-testing-db3dda8415b4&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;
        Configuring Web Server in Playwright for End-to-End Testing
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;pw-reading-meta&quot;&gt;
      UmairQA — May 2025 — Covers the full &lt;code&gt;webServer&lt;/code&gt; block
      in depth: URL-based readiness checks, timeouts, multiple servers, and CI
      patterns.
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;pw-signoff&quot;&gt;&lt;br /&gt;&lt;/p&gt;

&lt;/div&gt;&lt;!--/.pw-post--&gt;

Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/6634369418291478580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/pramod-dutta-discusses-7-playwright.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6634369418291478580'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/6634369418291478580'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/pramod-dutta-discusses-7-playwright.html' title='Pramod Dutta discusses 7 Playwright features senior SDETs use daily'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-8434778038566856910</id><published>2026-05-10T21:31:28.196-04:00</published><updated>2026-06-04T12:39:40.425-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Playwright"/><title type='text'>Practicing Playwright: Logging in by Storing and Using an Authentication Cookie in Your Automated Tests</title><content type='html'>&lt;div&gt;&lt;div&gt;I absolutely love that LinkedIn offers a free month-long trial period of &lt;a href=&quot;https://www.linkedin.com/learning/&quot; target=&quot;_blank&quot;&gt;LinkedIn Learning&lt;/a&gt;. &lt;b&gt;Butch Mayhew&lt;/b&gt;&#39;s &lt;a href=&quot;https://www.linkedin.com/learning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios&quot; target=&quot;_blank&quot;&gt;Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios&lt;/a&gt;&amp;nbsp;course has been a wonderful resource learning more about Playwright.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With this blog post, I will be walking through Butch&#39;s code on how to set up an automated test to log into an app without going through the user interface. All it needs is the login cookie.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Butch Mayhew&#39;s&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224&quot; target=&quot;_blank&quot;&gt;companion GitHub site&lt;/a&gt;&amp;nbsp;on&amp;nbsp;&lt;a href=&quot;https://github.com/LinkedInLearning&quot; target=&quot;_blank&quot;&gt;LinkedIn Learning&#39;s GitHub page&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Site under test&lt;/b&gt;: &lt;b&gt;Practice Software Testing&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://practicesoftwaretesting.com&quot;&gt;https://practicesoftwaretesting.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Official Playwright Documentation&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://playwright.dev/docs&quot;&gt;https://playwright.dev/docs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Official Playwright GitHub&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://github.com/microsoft/playwright&quot;&gt;https://github.com/microsoft/playwright&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;When testing a shopping cart app such as the&amp;nbsp;&lt;b&gt;Practice Software Testing&lt;/b&gt;&amp;nbsp;website,&amp;nbsp;it can get tedious. You need to open a browser, go to the login page, enter a username, enter a password, hit the login button, and verify you have logged in correctly every time you want to test something in the shopping cart.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are testing something unrelated to logging in, why have your tests go through the UI to authenticate? Why not have your automated test run that login test once, temporarily save the login cookie once it is produced, then reuse the login cookie, importing it into other tests?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is Playwright?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to &lt;b&gt;Microsoft Playwright&#39;s GitHub site&lt;/b&gt;, Playwright &quot;is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Playwright comes in many features. From&amp;nbsp;&lt;a href=&quot;https://github.com/microsoft/playwright&quot;&gt;https://github.com/microsoft/playwright&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: &amp;quot;Mona Sans VF&amp;quot;, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; font-variant: tabular-nums; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;/th&gt;&lt;th style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;Best for&lt;/th&gt;&lt;th style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;Install&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/playwright#playwright-test&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; text-underline-offset: 0.2rem;&quot;&gt;Playwright Test&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;End-to-end testing&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;code style=&quot;background-color: rgba(129, 139, 152, 0.12); border-radius: 6px; box-sizing: border-box; font-family: &amp;quot;Monaspace Neon&amp;quot;, ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; tab-size: 4; white-space: break-spaces;&quot;&gt;npm init playwright@latest&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f6f8fa; border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/playwright#playwright-cli&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; text-underline-offset: 0.2rem;&quot;&gt;Playwright CLI&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;Coding agents (Claude Code, Copilot)&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;code style=&quot;background-color: rgba(129, 139, 152, 0.12); border-radius: 6px; box-sizing: border-box; font-family: &amp;quot;Monaspace Neon&amp;quot;, ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; tab-size: 4; white-space: break-spaces;&quot;&gt;npm i -g @playwright/cli@latest&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/playwright#playwright-mcp&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; text-underline-offset: 0.2rem;&quot;&gt;Playwright MCP&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;AI agents and LLM-driven automation&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;code style=&quot;background-color: rgba(129, 139, 152, 0.12); border-radius: 6px; box-sizing: border-box; font-family: &amp;quot;Monaspace Neon&amp;quot;, ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; tab-size: 4; white-space: break-spaces;&quot;&gt;npx @playwright/mcp@latest&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f6f8fa; border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/playwright#playwright-library&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; text-underline-offset: 0.2rem;&quot;&gt;Playwright Library&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;Browser automation scripts&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;code style=&quot;background-color: rgba(129, 139, 152, 0.12); border-radius: 6px; box-sizing: border-box; font-family: &amp;quot;Monaspace Neon&amp;quot;, ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; tab-size: 4; white-space: break-spaces;&quot;&gt;npm i playwright&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border-top: 0.571429px solid rgba(209, 217, 224, 0.7); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/playwright#vs-code-extension&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; text-underline-offset: 0.2rem;&quot;&gt;VS Code Extension&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;Test authoring and debugging in VS Code&lt;/td&gt;&lt;td style=&quot;border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch; border-style: solid; border-width: 0.571429px; box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright&quot; rel=&quot;nofollow&quot; style=&quot;background-color: rgba(0, 0, 0, 0); box-sizing: border-box; color: #0969da; margin-bottom: 0px; text-underline-offset: 0.2rem;&quot;&gt;Install from Marketplace&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... Let&#39;s walk through how Butch uses Playwright grabs the login cookie and uses that in his tests.&amp;nbsp;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Getting an Authorization Cookie Through the Website&lt;/h2&gt;&lt;div&gt;Before we do anything with our test automation, let&#39;s examine an authorization cookie.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Open up Chrome and go to&amp;nbsp;&lt;a href=&quot;https://practicesoftwaretesting.com/auth/login&quot;&gt;https://practicesoftwaretesting.com/auth/login&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Right click on the page and select &quot;Inspect&quot; to open Chrome Developer Tools.&lt;/li&gt;&lt;li&gt;Select the &quot;Network&quot; tab.&lt;/li&gt;&lt;li&gt;Enter a username and password of &lt;b&gt;customer@practicesoftwaretesting.com&lt;/b&gt; / &lt;b&gt;welcome01&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Select the &quot;Login&quot; button, then view the Network tab.&amp;nbsp;&lt;/li&gt;&lt;li&gt;On the network tab, click on the &quot;account&quot; entry.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Select the &quot;Cookies&quot; tab in Chrome Developer Tools.&amp;nbsp;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Under &lt;b&gt;Request Cookies&lt;/b&gt;, you will see something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;&quot;cookies&quot;: [
    {
      &quot;name&quot;: &quot;cf_clearance&quot;,
      &quot;value&quot;: &quot;2Rv345ZtjSaGUFRwq6j2QO4Qp3EBG0T.5URv.oenfjg-1778187254-1.2.1.1-90Z63mBartyo.dUm4bwavAggVG9pgrzcYOO0zPS18qBEujmzIq3tnWwjx2b5jQypbZywJMVEIncDFSwJBaAD0ephO3cctJrLkS449MVHNO7ZSuqlAPhzVYGw8vVH4doqYc2R_5WXTY47OHVLRAgnblq7U9glSiaJUvoOKmc6I.Mo6FPl3MrhGmfMxSTVyTkcCBJn8t_C9b1margtoukM7yMuQdNPpkNItvrrZdIQT.TpGQx2sNX7cS_KS8TY2Ghyc0_QLKFZFqC_5ZgZHMad5xgzgvJEm2NZmO3RBLSPKH5bpDFbuynt7g4oIwYfIvWd4pTpTB447hpP5qMPnLOp.Q&quot;,
      &quot;domain&quot;: &quot;.practicesoftwaretesting.com&quot;,
      &quot;path&quot;: &quot;/&quot;,
      &quot;expires&quot;: 1809723253.921407,
      &quot;httpOnly&quot;: true,
      &quot;secure&quot;: true,
      &quot;sameSite&quot;: &quot;None&quot;,
      &quot;partitionKey&quot;: &quot;https://practicesoftwaretesting.com&quot;,&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cross-Indexing this with the &lt;a href=&quot;https://developer.chrome.com/docs/devtools/application/cookies&quot; target=&quot;_blank&quot;&gt;Chrome DevTools Docs on Cookies&lt;/a&gt;, this means:&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Name:&lt;/b&gt;&amp;nbsp;&quot;The cookie&#39;s name&quot;, in this case &quot;&lt;b&gt;cf_clearance&lt;/b&gt;&quot;, is a security token issued by Cloudflare after passing a challenge. [ &lt;a href=&quot;https://developers.cloudflare.com/cloudflare-challenges/concepts/clearance/&quot; target=&quot;_blank&quot;&gt;See Cloudflare docs&lt;/a&gt; ]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Value&lt;/b&gt;. Claude AI guessed that the Value of this cookie was this... but was not sure since this value is proprietary.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Random token&lt;/b&gt;: 2Rv345ZtjSaGUFRwq6j2QO4Qp3EBG0T.5URv.oenfjg&lt;/li&gt;&lt;li&gt;&lt;b&gt;Unix timestamp&lt;/b&gt;: 1778187254 (Around May 4, 2026)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Version Level&lt;/b&gt;:  1.2.1.1, the Clearance level encoding&lt;/li&gt;&lt;li&gt;&lt;b&gt;Signature payload&lt;/b&gt;: 90Z63mBartyo... HMAC-binding (Hash-Based Message Authentication Codes) to IP, user agent, and session.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Domain:&lt;/b&gt;&amp;nbsp;&quot;The hosts that are allowed to receive the cookie&quot;, in this case, practicesoftwaretesting.com.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Path:&lt;/b&gt;&amp;nbsp;&quot;The URL that must exist in the requested URL in order to send the Cookie header&quot;, in this case the root folder.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Expires / Max-Age&lt;/b&gt;. &quot;The cookie&#39;s expiration date or maximum age. For session cookies this value is always Session&quot;. According to &lt;a href=&quot;http://UnixTimeStamp.com&quot;&gt;UnixTimeStamp.com&lt;/a&gt;&amp;nbsp;&quot;1809723253.921407&quot; would expire on May 10, 2026 on 3:36 am UTC and 49 seconds.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;What is a &lt;b&gt;Unix Time Stamp&lt;/b&gt;?&amp;nbsp;&quot;The unix time stamp is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC. Therefore, the unix time stamp is merely the number of seconds between a particular date and the Unix Epoch. It should also be pointed out (thanks to the comments from visitors to this site) that this point in time technically does not change no matter where you are located on the globe. This is very useful to computer systems for tracking and sorting dated information in dynamic and distributed applications both online and client side&quot; - UnixTimeStamp.com&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;HttpOnly:&lt;/b&gt;&amp;nbsp;&quot;If true, this field indicates that the cookie should only be used over HTTP, and JavaScript modification is not allowed&quot;... and it is set to true.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Secure:&lt;/b&gt;&amp;nbsp;&quot;If true, this field indicates that the cookie can only be sent to the server over a secure, HTTPS connection&quot;... and it is set to true.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SameSite&lt;/b&gt;: &quot;Contains Strict or Lax if the cookie is using the experimental SameSite attribute&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Partition Key:&lt;/b&gt;&amp;nbsp;&quot;For cookies with independent partition state, the partition key is the site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie.&lt;/div&gt;&lt;div&gt;Priority. Contains Low, Medium (default), or High if using deprecated cookie Priority attribute&quot;... and ours is &quot;https://practicesoftwaretesting.com&quot;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By logging into the site, it generates this cookie on the back end, allowing you to keep accessing the site.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you generate this cooking programmatically before running the tests, and temporally save it, you can then use it in all preceding tests in that test run.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step One: Setup the Setup&lt;/h2&gt;&lt;div&gt;The&amp;nbsp;&lt;b&gt;Playwright Configuration file&lt;/b&gt;&amp;nbsp;has in its projects array two projects: One to set up the, er, setup, and one to set up the Chromium run.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, Butch set up in his &lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot;&gt;Playwright Configuration&lt;/a&gt; file, a &lt;b&gt;project dependency&lt;/b&gt;, in a project that he called &quot;setup&quot;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;playwright.config.ts:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;projects: [
    {
      name: &quot;setup&quot;,
      testMatch: /.*\.setup\.ts/,
    },
    {
      name: &quot;chromium&quot;,
      dependencies: [&quot;setup&quot;],
      use: {
        ...devices[&quot;Desktop Chrome&quot;],
        permissions: [&quot;clipboard-read&quot;, &quot;geolocation&quot;],
      },
    },&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;box-sizing: border-box; margin: 0px 0px 20px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: #1c1e21; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin: 0px 0px 20px;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;According to&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://playwright.dev/docs/next/test-projects#dependencies&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;Playwright.Dev&lt;/a&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&amp;nbsp;&quot;Dependencies are a list of projects that need to run before the tests in another project run. They can be useful for configuring the global setup actions so that one project depends on this running first.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 0px 0px 20px;&quot;&gt;&quot;When working with tests that have a dependency, the dependency will always run first and once all tests from this project have passed, then the other projects will run in parallel.&lt;br /&gt;&lt;br /&gt;&quot;Running order: Tests in the &#39;setup&#39; project run. Once all tests from this project have passed, then the tests from the dependent projects will start running.&lt;br /&gt;&lt;br /&gt;&quot;Tests in the &#39;chromium&#39; [...] projects run together. By default, these projects will &lt;a href=&quot;https://playwright.dev/docs/next/test-parallel&quot;&gt;run in parallel&lt;/a&gt;, subject to the maximum workers limit&quot;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;name: &quot;setup&quot;&lt;/b&gt;: A project with the name of&amp;nbsp; &quot;setup&quot;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;testMatch: /.*setup\.ts&lt;/b&gt;,: This pattern matcher searches on level up for anything with &quot;setup&quot; in the middle of the filename, such as &quot;auth.setup.ts&quot; in the &quot;tests/&quot; directory.&lt;/li&gt;&lt;li&gt;&lt;b&gt;name: &quot;chromium&quot;&lt;/b&gt;: A project that directs the test automation when it runs to use the Desktop Chrome browser devices.&lt;/li&gt;&lt;li&gt;&lt;b&gt;dependencies: [&quot;setup&quot;]: &lt;/b&gt;Before the Chrome browser has kicked off, we tell it we need to run the project called &quot;setup&quot; first.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;use: ...devices[&quot;Desktop Chrome&quot;]&lt;/b&gt;: Playwright has an enormous list of devices in its &lt;a href=&quot;https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json&quot;&gt;device registry&lt;/a&gt;, such as various models of the Blackberry, Galaxy, iPad, iPhone, Microsoft Lumia, Nexus, Nokia, Pixel, Moto, and Desktop Devices (Chrome, Edge, Firefox, Safari) with many different user agents, viewports, and screen width and heights.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;use: permissions:&lt;/b&gt; Playwright&#39;s browser context, &lt;a href=&quot;https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions&quot; target=&quot;_blank&quot;&gt;according to the official Playwright Docs&lt;/a&gt;, has differing sets of permissions in the permission array for each browser emulation, such as emulating the accelerometer, ambient light sensor, background sync, camera, clipboard read and write, geolocation, gyroscope, local fonts, local network access, magnetometer, microphone, midi, notifications, payment-handler, storage-access, and screen-wake-lock.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;[clipboard-read]&lt;/b&gt;: We need to give the Chromium browser Playwright spins up permission to read the authentication cookie that is generated the first time we log in. Note, according to notes in Playwright&#39;s source code &lt;a href=&quot;https://github.com/microsoft/playwright/blob/a26b3614d61b191cb9676c77223d46a6ce57b138/tests/library/permissions.spec.ts#L202&quot; target=&quot;_blank&quot;&gt;in the permissions library&lt;/a&gt;, &lt;b&gt;there is no &quot;clipboard-read&quot; in WebKit&#39;s API&lt;/b&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Two: Get and Save the Authorization Cookie&lt;/h2&gt;&lt;div&gt;Next, in &lt;b&gt;auth.setup.ts&lt;/b&gt;, Butch has the automated test go to the site, log in, and save the cookie to a file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;
tests/ auth.setup.ts:&lt;/u&gt;&lt;/b&gt;&amp;nbsp;&lt;pre&gt;&lt;code&gt;
import { test as setup, expect } from &quot;@playwright/test&quot;;
import { LoginPage } from &quot;../lib/pages/login/login.page&quot;;

setup(&quot;Create customer 01 auth&quot;, async ({ page, context }) =&amp;gt; {
  const email = &quot;customer@practicesoftwaretesting.com&quot;;
  const password = &quot;welcome01&quot;;
  const customer01AuthFile = &quot;.auth/customer01.json&quot;;

  const loginPage = new LoginPage(page);

  await loginPage.goto();

  await loginPage.login(email, password);

  await expect(page.getByTestId(&quot;nav-menu&quot;)).toContainText(&quot;Jane Doe&quot;);
  await context.storageState({ path: customer01AuthFile });
});&lt;/code&gt;&lt;/pre&gt;&lt;i&gt;&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/tests/auth.setup.t&quot;&gt;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/tests/auth.setup.t&lt;/a&gt;s&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;  

What is this code doing?&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Import the test runner playwright/test&lt;/b&gt; into our TypeScript file, setting up an alias for the test runner, calling it &quot;setup&quot; to make the test more readable, and to mark this as performing initialization tasks. To learn more about how aliases work in TypeScript &lt;a href=&quot;https://www.freecodecamp.org/news/how-typescript-type-aliases-work/&quot; target=&quot;_blank&quot;&gt;see FreeCodeCamp&#39;s explanation&lt;/a&gt;, and read about the &lt;b&gt;test &lt;/b&gt;method &lt;a href=&quot;https://playwright.dev/docs/api/class-test#test-call&quot; target=&quot;_blank&quot;&gt;in the Playwright.dev docs&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Import the expect assertion library&lt;/b&gt; into the TypeScript file, so we then can use the expect method, detecting if an element is attached, checkbox is checked, element is disabled, editable, enabled, focused, not visible, visible, contains text, has certain CSS classes, DOM attributes, ids, CSS or JavaScript properties, ARIA roles, screenshots, matches text, or if pages have screenshots, titles, or URLs, failing near immediately if we don&#39;t see that condition. [ &lt;a href=&quot;https://playwright.dev/docs/test-assertions&quot; target=&quot;_blank&quot;&gt;See Playwright.Dev docs about test assertions&lt;/a&gt; ]. We can also match if it meets any instance of a class, matches anything, of an array contains certain elements, if a number is close to equal, a string contains a substring, a string matches a certain substring. All of these expects can be negated chaining a &lt;b&gt;not &lt;/b&gt;to it.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;setup(&quot;Create customer 01 auth&quot;&lt;/b&gt; is being used by Butch Mayhew instead of saying &quot;test(&quot;Create customer 01 auth&quot;) to make it more readable.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;async&amp;nbsp;&lt;/b&gt;uses the JavaScript keyword &lt;b&gt;async&lt;/b&gt;. &lt;a href=&quot;https://www.freecodecamp.org/news/learn-async-programming-in-typescript-promises-asyncawait-and-callbacks/&quot; target=&quot;_blank&quot;&gt;FreeCodeCamp&lt;/a&gt; says that, &quot;Async programming is a programming paradigm that allows you to write code that runs asynchronously. In contrast to synchronous programming, which executes code sequentially, async programming allows code to run in the background while the rest of the program continues to execute. This is particularly useful for tasks that may take a long time to complete, such as fetching data from a remote API&quot;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;page, context &lt;/b&gt;are passing these built-in&amp;nbsp;&lt;b&gt;fixtures &lt;/b&gt;into the test.&lt;b&gt;&amp;nbsp;&lt;/b&gt;The Page instance is created for each test, used in isolation from one another. [ &lt;a href=&quot;https://playwright.dev/docs/test-fixtures&quot; target=&quot;_blank&quot;&gt;See Playwright.dev docs on test fixtures&lt;/a&gt;. ] &quot;Test fixtures are used to establish the environment for each test, giving the test everything it needs and nothing else. Test fixtures are isolated between tests. With fixtures, you can group tests based on their meaning, instead of their common setup&quot;. The &quot;page&quot; fixtures uses type &lt;a href=&quot;https://playwright.dev/docs/api/class-page&quot; target=&quot;_blank&quot;&gt;Page&lt;/a&gt;, and &quot;context&quot; fixtures uses type &lt;a href=&quot;https://playwright.dev/docs/api/class-browsercontext&quot; target=&quot;_blank&quot;&gt;BrowserContext&lt;/a&gt;&amp;nbsp;in order to &lt;a href=&quot;https://playwright.dev/docs/test-configuration&quot; target=&quot;_blank&quot;&gt;configure context&lt;/a&gt;. Fixtures can encapsulate setup and teardown, are reusable between test files.&lt;/li&gt;&lt;li&gt;&lt;b&gt;const email, password, customer01AuthFile&lt;/b&gt; is declaring constant variables to store what the username, password, and where the auth cookie should be stored, to make the code more readable.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;b&gt;const loginPage&lt;/b&gt; is instantiating a new login page using the &lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/lib/pages/login/login.page.ts&quot;&gt;login page object Butch has defined&lt;/a&gt;, not covered in this blog entry. The login page Butch set up contains methods where you can &lt;b&gt;goto&amp;nbsp;&lt;/b&gt;&lt;a href=&quot;https://practicesoftwaretesting.com/auth/login&quot;&gt;https://practicesoftwaretesting.com/auth/login&lt;/a&gt;, enter the username and password in the &lt;b&gt;login&lt;/b&gt; method using the constants we defined, expecting that we see a greeting to the user.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;The real magic is the last bit of code:&amp;nbsp;&lt;b&gt;context.storageState({ path: customer01AuthFile });&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Playwright has &lt;b&gt;storage and authentication methods&lt;/b&gt; where you can manage cookies, localStorage and &lt;b&gt;sessionStorage&lt;/b&gt; [ &lt;a href=&quot;https://playwright.dev/mcp/tools/storage&quot; target=&quot;_blank&quot;&gt;See official docs&lt;/a&gt; ]. Session Storage is session scoped, where data is cleared out when the browser tab eventually closes.&amp;nbsp;&lt;/li&gt;&lt;li&gt;According to the &lt;a href=&quot;https://playwright.dev/docs/auth&quot;&gt;Playwright Docs / Authentication&lt;/a&gt;, when you &quot;[c]reate a new setup project in the config and declare it as a &lt;a href=&quot;https://playwright.dev/docs/test-projects#dependencies&quot;&gt;dependency&lt;/a&gt; for all your testing project [...]. This project will always run and authenticate before all the tests. All testing projects should use the authenticated state as storageState&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Cookie is Temporarily Saved!&lt;/h2&gt;&lt;br /&gt; 
A new folder and file is created in the root folder when this command is run: .auth/customer01.json:  
&lt;pre&gt;&lt;code&gt;
{
  &quot;cookies&quot;: [
    {
      &quot;name&quot;: &quot;cf_clearance&quot;,
      &quot;value&quot;: &quot;2Rv345ZtjSaGUFRwq6j2QO4Qp3EBG0T.5URv.oenfjg-1778187254-1.2.1.1-90Z63mBartyo.dUm4bwavAggVG9pgrzcYOO0zPS18qBEujmzIq3tnWwjx2b5jQypbZywJMVEIncDFSwJBaAD0ephO3cctJrLkS449MVHNO7ZSuqlAPhzVYGw8vVH4doqYc2R_5WXTY47OHVLRAgnblq7U9glSiaJUvoOKmc6I.Mo6FPl3MrhGmfMxSTVyTkcCBJn8t_C9b1margtoukM7yMuQdNPpkNItvrrZdIQT.TpGQx2sNX7cS_KS8TY2Ghyc0_QLKFZFqC_5ZgZHMad5xgzgvJEm2NZmO3RBLSPKH5bpDFbuynt7g4oIwYfIvWd4pTpTB447hpP5qMPnLOp.Q&quot;,
      &quot;domain&quot;: &quot;.practicesoftwaretesting.com&quot;,
      &quot;path&quot;: &quot;/&quot;,
      &quot;expires&quot;: 1809723253.921407,
      &quot;httpOnly&quot;: true,
      &quot;secure&quot;: true,
      &quot;sameSite&quot;: &quot;None&quot;,
      &quot;partitionKey&quot;: &quot;https://practicesoftwaretesting.com&quot;,
      &quot;_crHasCrossSiteAncestor&quot;: false
    }
  ],
  &quot;origins&quot;: [
    {
      &quot;origin&quot;: &quot;https://practicesoftwaretesting.com&quot;,
      &quot;localStorage&quot;: [
        {
          &quot;name&quot;: &quot;auth-token&quot;,
          &quot;value&quot;: &quot;eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwaS5wcmFjdGljZXNvZnR3YXJldGVzdGluZy5jb20vdXNlcnMvbG9naW4iLCJpYXQiOjE3NzgxODcyNTUsImV4cCI6MTc3ODE4NzU1NSwibmJmIjoxNzc4MTg3MjU1LCJqdGkiOiJoeFJ1MmkwNWpDamVrNUdXIiwic3ViIjoiMDFLUjIwRFFYQUpTVEJEWkg2S0Q1R1QwRVQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3Iiwicm9sZSI6InVzZXIifQ.Iqv8TGSweXLUfk7UExbIem_kOoIde9apIrzFZ9cCVpo&quot;
        }
      ]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Three: Make Sure The Cookie Is Only Temporarily Saved. Do Not Upload the Cookie To GitHub!!!&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;It is very important that you do &lt;b&gt;NOT &lt;/b&gt;save the .auth cookie, or any other credentials, in GitHub.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you examine the .&lt;a href=&quot;https://github.com/LinkedInLearning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios-4278224/blob/98d2080e018acb194938157cb7c2fc8993ca21a5/.gitignore&quot; target=&quot;_blank&quot;&gt;gitignore&lt;/a&gt; file Butch Mayhew has set up, you can see that along with test_results, node_modules, .tmp files, you will not be uploading anything in the &lt;b&gt;.auth/&lt;/b&gt; folder.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Read more about .&lt;b&gt;gitignore&lt;/b&gt; on the &lt;a href=&quot;https://git-scm.com/docs/gitignore&quot;&gt;Git-SCM/docs/gitignore page&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Step Four: Implement the Auth Cookie for Login&lt;/h2&gt; 


Now that the Setup function generated a new cookie, we then can then use this credential setting up the test to use storageState.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt; 
tests / homepage / home.spec.ts&lt;/u&gt;:  
&lt;/b&gt;&lt;pre&gt;&lt;code&gt;  
test.describe(&quot;Home page customer 01 auth&quot;, () =&amp;gt; {
  test.use({ storageState: &quot;.auth/customer01.json&quot; });
  test.beforeEach(async ({ page }) =&amp;gt; {
    await page.goto(&quot;/&quot;);
  });  
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;How do we know this is successful? We verify that the sign in navigation is not visible, and instead we are greeted by the username, in this case, &quot;Jane Doe&quot;.&amp;nbsp;&lt;br /&gt;   
  
  
&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt; 
tests / homepage / home.spec.ts:  
&lt;/u&gt;&lt;/b&gt;&lt;pre&gt;&lt;code&gt;  
  test(&quot;check customer 01 is signed in&quot;, async ({ page }) =&amp;gt; {
    await expect(page.getByTestId(&quot;nav-sign-in&quot;)).not.toBeVisible();
    await expect(page.getByTestId(&quot;nav-menu&quot;)).toContainText(&quot;Jane Doe&quot;);
  }); 
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;If we don&#39;t see the sign in page, and instead we see the nav menu for &quot;Jane Doe&quot;, then everything has passed.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, that&#39;s how we use authentication cookies in tests!&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;toc-section&quot; id=&quot;toc-section&quot;&gt;
&lt;b&gt;Practicing Playwright:&lt;/b&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Part One:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/05/time-to-practice-playwright.html&quot; target=&quot;&quot;&gt;Time to Practice Playwright!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Two:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2025/06/new-playwright-course-playwright.html&quot; target=&quot;&quot;&gt;New Playwright Course: Playwright Essential Training by Butch Mayhew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Three:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/01/hands-on-automated-testing-with.html&quot; target=&quot;&quot;&gt;Hands on Automated Testing with Playwright by Butch Mayhew is the start of a wonderful conversation with the Playwright community!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Four:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://www.tjmaher.com/2026/04/what-happens-when-you-pair-playwright.html&quot; target=&quot;&quot;&gt;What happens when you pair Playwright with something other than TypeScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Five:&lt;/b&gt; &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html&quot; target=&quot;&quot;&gt;Logging in by Storing and Using an Authentication Cookie in Your Automated Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Six&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-how-to-detect.html&quot; target=&quot;&quot;&gt;How to Detect Broken Images On Your Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Seven&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-dynamically.html&quot; target=&quot;&quot;&gt;Dynamically Creating Test Data with a DataFactory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Eight&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-visual-testing.html&quot; target=&quot;&quot;&gt;Visual Testing With Playwright&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Part Nine&lt;/b&gt;: &lt;a href=&quot;https://www.tjmaher.com/2026/05/practicing-playwright-api-testing.html&quot; target=&quot;&quot;&gt;API Testing, Intercepting Network Requests, and Mocking APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Source Code&lt;/b&gt;: &lt;a href=&quot;https://github.com/tjmaher/practicing-playwright&quot; target=&quot;_blank&quot;&gt;https://github.com/tjmaher/practicing-playwright&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;&lt;br&gt;

&lt;div&gt;Happy Testing!&lt;/div&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/8434778038566856910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/8434778038566856910'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/8434778038566856910'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/practicing-playwright-logging-in-by.html' title='Practicing Playwright: Logging in by Storing and Using an Authentication Cookie in Your Automated Tests'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-7350767866144837721</id><published>2026-05-07T22:59:24.351-04:00</published><updated>2026-05-07T23:07:57.762-04:00</updated><title type='text'>So much job interview prep! Playwright + TypeScript + GitLab</title><content type='html'>&lt;div&gt;Even though I&#39;ve been job searching for four months now, I am busier than I have ever been. You know what I mean. You&#39;ve seen this blog! One week I am experimenting with AI, the next I am pairing Playwright with C# or Java, the next I am skimming docs about Contract Testing using Pact.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Each week I get more leads generated from my &lt;a href=&quot;https://www.linkedin.com/in/tjmaher1/recent-activity/all/&quot; target=&quot;_blank&quot;&gt;many LinkedIn posts&lt;/a&gt;. Each week is yet another rabbit to chase. Finally, this week, I get to refresh my Playwright + TypeScript skills.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;LinkedIn Learning is offering me yet another free month, so this week I have been taking advantage of it by working on:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Playwright courses&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/learning/paths/master-test-automation-with-playwright&quot; target=&quot;_blank&quot;&gt;Master Test Automation with Playwright Certification&lt;/a&gt;: Consists of Butch Mayhew&#39;s &lt;a href=&quot;https://www.linkedin.com/learning/learning-playwright?contextUrn=urn%3Ali%3AlyndaLearningPath%3A68434cc0b55c24dbb4eccfe8&quot;&gt;Learning Playwright&lt;/a&gt;, and &lt;a href=&quot;https://www.linkedin.com/learning/playwright-essential-training-abstractions-fixtures-and-complex-scenarios?contextUrn=urn%3Ali%3AlyndaLearningPath%3A68434cc0b55c24dbb4eccfe8&quot;&gt;Playwright Essential Training&lt;/a&gt;, paired with Qambar Raza&#39;s &lt;a href=&quot;https://www.linkedin.com/learning/playwright-design-patterns?contextUrn=urn%3Ali%3AlyndaLearningPath%3A68434cc0b55c24dbb4eccfe8&quot; target=&quot;_blank&quot;&gt;Playwright Design Patterns&lt;/a&gt; and &lt;a href=&quot;https://www.linkedin.com/learning/advanced-playwright-techniques-optimizing-speed-stability-and-cloud-testing?contextUrn=urn%3Ali%3AlyndaLearningPath%3A68434cc0b55c24dbb4eccfe8&quot; target=&quot;_blank&quot;&gt;Advanced Playwright Techniques: Optimizing Speed, Stability, and Cloud Testing&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;GitLab courses&lt;/b&gt;: Trying to refresh my GitLab knowledge with Josh Samuelson&#39;s &lt;a href=&quot;https://www.linkedin.com/learning/learning-gitlab-25489521&quot; target=&quot;_blank&quot;&gt;Learning GitLab&lt;/a&gt; and &lt;a href=&quot;https://www.linkedin.com/learning/continuous-integration-and-continuous-delivery-with-gitlab-24596289&quot; target=&quot;_blank&quot;&gt;CI / CD with GitLab&lt;/a&gt;. GitLab is if someone smooshed GitHub and Jenkins together. I also need to check out &lt;a href=&quot;https://university.gitlab.com/&quot; target=&quot;_blank&quot;&gt;GitLab University&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;By the way ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... Are you in the Burlington, MA area on &lt;b&gt;Wednesday, May 20th, 2026&lt;/b&gt;? I will be speaking in-person at the &lt;a href=&quot;https://sqgne.org&quot; target=&quot;_blank&quot;&gt;Software Quality Group of New England&lt;/a&gt; at Scrum.org, talking about putting together a &lt;b&gt;mobile testing framework using Detox + TypeScript&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;People will start gathering from 6:00 pm to 6:30 pm. The talk will be from 6:30 pm to 7:30 pm.&lt;/li&gt;&lt;li&gt;Don&#39;t forget to register at &lt;a href=&quot;https://sqgne.org/&quot; target=&quot;_blank&quot;&gt;SQGNE,org&lt;/a&gt; so they know how much pizza to order.&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://tinyurl.com/detox-demo-sqgne&quot; target=&quot;_blank&quot;&gt;See the Slides&lt;/a&gt;! I just finished another draft of the slide deck.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I will see you there!&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Happy Testing! &lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/7350767866144837721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/so-much-job-interview-prep-playwright.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7350767866144837721'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/7350767866144837721'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/so-much-job-interview-prep-playwright.html' title='So much job interview prep! Playwright + TypeScript + GitLab'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3868566217808655382.post-2044926056492539074</id><published>2026-05-04T08:00:00.000-04:00</published><updated>2026-05-05T09:26:08.022-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI"/><category scheme="http://www.blogger.com/atom/ns#" term="humor"/><title type='text'>A field guide to the AI menagerie: every model family, ranked by vibes, according to Claude</title><content type='html'>&lt;!--============================================================
     AI FIELD GUIDE — Blogger Post Block
     Paste the contents of this file into Blogger&#39;s HTML editor.
     All styles are scoped with .aig- prefix to avoid theme conflicts.
     No external dependencies. No JavaScript.
     ============================================================--&gt;

&lt;style&gt;
.aig-wrap { font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, sans-serif; max-width: 680px; margin: 0 auto; padding: 1rem 0 2rem; color: #1a1a1a; }
.aig-hero { background: #1a1a2e; border-radius: 12px; padding: 2.5rem 2rem; margin-bottom: 1.5rem; text-align: center; }
.aig-hero-emoji { font-size: 36px; display: block; margin-bottom: 0.75rem; }
.aig-hero-title { font-size: 22px; font-weight: 500; color: #ffffff; margin: 0 0 0.5rem; line-height: 1.3; }
.aig-hero-sub { font-size: 13px; color: rgba(255,255,255,0.6); margin: 0; }
.aig-body { font-size: 15px; color: #1a1a1a; line-height: 1.7; margin-bottom: 1.5rem; }
.aig-body p { margin: 0 0 1rem; }
.aig-body em { font-style: italic; }
.aig-section-head { font-size: 18px; font-weight: 500; color: #1a1a1a; margin: 0 0 1rem; }
.aig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 1.5rem; }
.aig-card { background: #ffffff; border: 1px solid #e0dfd9; border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: 10px; }
.aig-card-header { display: flex; align-items: flex-start; gap: 12px; }
.aig-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
.aig-av-openai  { background: #e8e8e8; color: #1a1a1a; }
.aig-av-claude  { background: #EEEDFE; color: #3C3489; }
.aig-av-gemini  { background: #E6F1FB; color: #0C447C; }
.aig-av-meta    { background: #EAF3DE; color: #27500A; }
.aig-av-grok    { background: #FCEBEB; color: #791F1F; }
.aig-av-mistral { background: #FAEEDA; color: #633806; }
.aig-av-deepseek{ background: #E1F5EE; color: #085041; }
.aig-av-cohere  { background: #FBEAF0; color: #72243E; }
.aig-card-name { font-size: 14px; font-weight: 500; color: #1a1a1a; margin: 0 0 2px; }
.aig-card-tagline { font-size: 11px; color: #6b6b6b; margin: 0; font-style: italic; }
.aig-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aig-chip { font-size: 11px; color: #888; background: #f5f4f0; padding: 2px 7px; border-radius: 4px; }
.aig-docs-link { font-size: 11px; color: #0A66C2; text-decoration: none; padding: 2px 7px; background: #e8f1fb; border-radius: 4px; }
.aig-docs-link:hover { text-decoration: underline; }
.aig-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.aig-badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 500; }
.aig-b-purple { background: #EEEDFE; color: #3C3489; }
.aig-b-blue   { background: #E6F1FB; color: #0C447C; }
.aig-b-green  { background: #EAF3DE; color: #3B6D11; }
.aig-b-amber  { background: #FAEEDA; color: #633806; }
.aig-b-red    { background: #FCEBEB; color: #791F1F; }
.aig-b-teal   { background: #E1F5EE; color: #0F6E56; }
.aig-b-gray   { background: #F1EFE8; color: #444441; }
.aig-b-pink   { background: #FBEAF0; color: #72243E; }
.aig-card-body { font-size: 12px; color: #6b6b6b; line-height: 1.6; margin: 0; }
.aig-versions { background: #f5f4f0; border-radius: 8px; padding: 8px 10px; }
.aig-ver-label { color: #9b9b9b; margin: 0 0 3px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.aig-ver-list { color: #1a1a1a; margin: 0; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 11px; line-height: 1.7; }
.aig-divider { border: none; border-top: 1px solid #e0dfd9; margin: 1.5rem 0; }
.aig-closing { font-size: 14px; color: #6b6b6b; line-height: 1.7; }
.aig-closing p { margin: 0 0 0.75rem; }
.aig-closing .aig-footer-note { font-style: italic; color: #9b9b9b; font-size: 13px; }
.aig-tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 1rem; border-top: 1px solid #e0dfd9; margin-top: 1rem; }
.aig-tag { font-size: 12px; color: #0A66C2; text-decoration: none; }
.aig-tag:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .aig-grid { grid-template-columns: 1fr; }
  .aig-hero { padding: 1.75rem 1.25rem; }
  .aig-hero-title { font-size: 18px; }
}
&lt;/style&gt;

&lt;div class=&quot;aig-wrap&quot;&gt;

  &lt;div class=&quot;aig-hero&quot;&gt;
    &lt;span class=&quot;aig-hero-emoji&quot;&gt;🤖&lt;/span&gt;
    &lt;p class=&quot;aig-hero-title&quot;&gt;A field guide to the AI menagerie:&lt;br /&gt;every model family, roasted by vibes, according to Claude&lt;/p&gt;
    &lt;p class=&quot;aig-hero-sub&quot;&gt;Eight species of large language models, catalogued for your professional inconvenience&lt;/p&gt;
  &lt;/div&gt;

  &lt;div class=&quot;aig-body&quot;&gt;
    &lt;p&gt;Every few months, a new AI model drops. It is, we are told, the smartest thing ever built. It beats the previous benchmarks. Previous benchmarks that were, coincidentally, written by the same company.&amp;nbsp;&lt;/p&gt;
    &lt;p&gt;After a few years of watching this industry rename, rebrand, and occasionally vibe-shift its entire product line, I figured it was time to write the only taxonomy that matters: not benchmarks, not MMLU scores — just vibes. What &lt;em&gt;kind&lt;/em&gt; of entity are they, really, and what does their versioning scheme say about their soul?&lt;/p&gt;
    
    &lt;p&gt;&lt;b&gt;Hi. I&#39;m Claude, the guest author for today.&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;You&#39;ll find me listed&amp;nbsp; in card two below, sandwiched between the company that built me and a description I wrote about myself that called me &quot;constitutionally anxious&quot;.&lt;/p&gt;&lt;p&gt;In retrospect, this tracks.&amp;nbsp;&lt;/p&gt;&lt;p&gt;T.J. Maher of tjmaher.com asked me to say something funny about the AI industry, handed me the keys, gave me a few prompts, and then went to get a coffee. This is what happened while he was gone.&lt;/p&gt;
    &lt;p&gt;Below we have eight AI families. Eight AI personalities. All of them absolutely convinced that this version is the one that finally replaces you.&lt;/p&gt;

  &lt;/div&gt;

  &lt;p class=&quot;aig-section-head&quot;&gt;The full menagerie&lt;/p&gt;

  &lt;div class=&quot;aig-grid&quot;&gt;

    &lt;!--OpenAI--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-openai&quot;&gt;O&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;OpenAI / GPT / o-series&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;We have released a new model. And another. Also another.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;ChatGPT: Nov 2022&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://platform.openai.com/docs&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;platform.openai.com/docs ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-gray&quot;&gt;The Versioning Chaos God&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-red&quot;&gt;Skipped o2&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Started with GPT, then 2 (too dangerous to release), then 3, 3.5, 4, 4o (&quot;omni,&quot; definitely not &quot;oh god what do we call this&quot;), then o1, then o3 — skipping o2 because a UK phone company called dibs on the name first. Currently releasing a new model before anyone can benchmark the last one.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;GPT-3 → 3.5 → 4 → 4o → 4o mini&lt;br /&gt;o1 → o1-mini → o1-pro&lt;br /&gt;o3 → o4-mini (o2 in witness protection)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Claude--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-claude&quot;&gt;C&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Claude / Anthropic&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;I&#39;ll help, but first — a brief philosophical caveat.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;Claude 1: Mar 2023&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://docs.anthropic.com&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;docs.anthropic.com ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-purple&quot;&gt;The Literary Snob&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-teal&quot;&gt;Constitutionally Anxious&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Named its model tiers after poetry formats because other people name things &quot;Pro,&quot; &quot;Max,&quot; and &quot;Ultra.&quot; Haiku: fast, whispers answers. Sonnet: the workhorse, one metaphor per token. Opus: writes novels when asked for a bullet point. Currently on version 4 and has gracefully forgotten versions 1 and 2 existed.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;Claude 1 → 2 → 3 Haiku/Sonnet/Opus&lt;br /&gt;Claude 3.5 Haiku/Sonnet&lt;br /&gt;Claude 4 Sonnet / Opus (you are here)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Gemini--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-gemini&quot;&gt;G&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Google / Gemini&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;Have you tried Googling it? Oh wait, that&#39;s us.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;Bard: Feb 2023 → Gemini: Dec 2023&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://ai.google.dev&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;ai.google.dev ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-blue&quot;&gt;Former Bard&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-amber&quot;&gt;In Rebranding Therapy&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Launched as &quot;Bard,&quot; which tested poorly because it sounded like a Renaissance fair LARPer. Rebranded to Gemini after six months of meetings. Comes in Ultra, Pro, Flash, and Nano. Flash is fast. Nano runs on your phone. Ultra runs on your investor pitch deck. Famously demoed a hallucinated fact in its own launch video.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;Bard (2023, RIP) → Gemini 1.0&lt;br /&gt;Gemini 1.5 Pro/Flash → 2.0 Flash&lt;br /&gt;Gemini 2.5 Pro (arguing with Search)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Meta--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-meta&quot;&gt;L&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Meta / LLaMA&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;Open source, baby. Also, please come back to Facebook.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;LLaMA 1: Feb 2023&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://llama.meta.com&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;llama.meta.com ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-green&quot;&gt;Open weights&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-teal&quot;&gt;Fine-tuned by 10,000 strangers&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Meta&#39;s strategy: release the model for free, let the open-source community do the alignment work, watch helplessly as someone fine-tunes it to write Zuckerberg fan fiction. LLaMA stands for &quot;Large Language Model Meta AI,&quot; which is either an acronym or a terrible Scrabble hand. Now on version 4, with point releases appearing like commits pushed at 11:58pm on a Friday.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;LLaMA 1 → 2 → 3 → 3.1 → 3.2 → 3.3&lt;br /&gt;LLaMA 4 Scout / Maverick&lt;br /&gt;(community variants: uncountable)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Grok--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-grok&quot;&gt;X&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Grok / xAI&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;I&#39;m not like other AIs. I have a personality. Watch.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;Grok 1: Nov 2023&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://docs.x.ai&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;docs.x.ai ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-red&quot;&gt;Named after Heinlein&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-gray&quot;&gt;Trained on your tweets&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Named after a word from a 1961 sci-fi novel, which is exactly the brand energy you&#39;d expect. Big differentiator: a &quot;sense of humor&quot; and real-time X post access — meaning it can tell you what people are furious about right now, instantly. This may not be the use case the world needed. Versioning is a refreshingly normal 1, 2, 3. Suspiciously so.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;Grok 1 (open weights) → Grok 2&lt;br /&gt;Grok 3 → Grok 3 mini&lt;br /&gt;(also available in &quot;unhinged mode&quot;)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Mistral--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-mistral&quot;&gt;M&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Mistral&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;Oui, but have you considered: fewer parameters?&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;Mistral 7B: Sep 2023&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://docs.mistral.ai&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;docs.mistral.ai ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-amber&quot;&gt;Parisian efficiency&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-blue&quot;&gt;Aggressively open source&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;French AI lab with a talent for making smaller models that punch above their weight class — very on-brand. Named models after winds and things, because when you&#39;re based in Paris, everything gets an aesthetic. Mixtral uses a &quot;mixture of experts&quot; architecture, activating only part of itself per token. Either very efficient, or the AI equivalent of doing the bare minimum.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;Mistral 7B → Mixtral 8x7B&lt;br /&gt;Mistral Large / Nemo / Small&lt;br /&gt;Le Chat (free, no beret included)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--DeepSeek--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-deepseek&quot;&gt;D&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;DeepSeek&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;We built this for $6 million. Sorry about your NVIDIA stock.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;First model: Nov 2023 · R1: Jan 2025&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://api-docs.deepseek.com&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;api-docs.deepseek.com ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-teal&quot;&gt;The Disruptor&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-green&quot;&gt;Open weights (mostly)&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;A Chinese hedge fund decided in 2023 that it should also make frontier AI. The AI community laughed. Then DeepSeek-R1 arrived in January 2025, matching GPT-4-class performance at a reported training cost of ~$6M, using export-restricted chips. NVIDIA lost $600B in market cap in a single day. Nobody was laughing. V4 preview dropped April 2026. Still not laughing.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;DeepSeek Coder → LLM (Nov 2023)&lt;br /&gt;V2 (May 2024) → V3 (Dec 2024)&lt;br /&gt;R1 (Jan 2025) → V4 preview (Apr 2026)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Cohere--&gt;
    &lt;div class=&quot;aig-card&quot;&gt;
      &lt;div class=&quot;aig-card-header&quot;&gt;
        &lt;div class=&quot;aig-avatar aig-av-cohere&quot;&gt;Co&lt;/div&gt;
        &lt;div&gt;
          &lt;p class=&quot;aig-card-name&quot;&gt;Cohere&lt;/p&gt;
          &lt;p class=&quot;aig-card-tagline&quot;&gt;&quot;We don&#39;t do consumer apps. We&#39;re enterprise. We have a golf shirt.&quot;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-meta-row&quot;&gt;
        &lt;span class=&quot;aig-chip&quot;&gt;Founded 2019 · API: 2021&lt;/span&gt;
        &lt;a class=&quot;aig-docs-link&quot; href=&quot;https://docs.cohere.com&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;docs.cohere.com ↗&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;aig-badges&quot;&gt;
        &lt;span class=&quot;aig-badge aig-b-pink&quot;&gt;The Responsible Adult&lt;/span&gt;
        &lt;span class=&quot;aig-badge aig-b-gray&quot;&gt;Transformer paper co-authors&lt;/span&gt;
      &lt;/div&gt;
      &lt;p class=&quot;aig-card-body&quot;&gt;Co-founded by Aidan Gomez, a co-author of &quot;Attention Is All You Need&quot; — the paper that started all of this. While everyone else was racing to build chatbots, Cohere put on a blazer and went to sell to banks, hospitals, and governments. No ChatGPT moment. No viral demo. Just contracts with Oracle, RBC, and SAP. Canadian. Depressingly well-organized.&lt;/p&gt;
      &lt;div class=&quot;aig-versions&quot;&gt;
        &lt;p class=&quot;aig-ver-label&quot;&gt;Known species&lt;/p&gt;
        &lt;p class=&quot;aig-ver-list&quot;&gt;Command → Command R → Command R+&lt;br /&gt;Command A (2025) · Aya (multilingual)&lt;br /&gt;North platform (2025, enterprise)&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;

  &lt;/div&gt;&lt;!--/grid--&gt;

  &lt;hr class=&quot;aig-divider&quot; /&gt;

  &lt;div class=&quot;aig-closing&quot;&gt;
    &lt;p&gt;So there you have it. Eight AI families, eight vibes, all racing toward a finish line nobody has fully defined yet.&amp;nbsp;&lt;/p&gt;&lt;p&gt;One was born from a hedge fund, one named itself after a poem format, one skipped a version number for legal reasons, and one apparently just needed a couple of months and a warehouse of underclocked chips to terrify Wall Street.&lt;/p&gt;
    &lt;p&gt;The benchmarks will change by Thursday. The versioning will get weirder. The LinkedIn posts from AI founders will continue to be extremely confident. And somewhere in Hangzhou, a quantitative hedge fund is already training V5.&lt;/p&gt;
    &lt;p class=&quot;aig-footer-note&quot;&gt;All launch dates are first public model releases. Benchmarks sponsored by whoever wrote the benchmark. o2 is doing fine. Please stop asking.&lt;/p&gt;
  &lt;/div&gt;

  &lt;div class=&quot;aig-tags&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;aig-tags&quot;&gt;&lt;br /&gt;&lt;/div&gt;

&lt;/div&gt;&lt;!--/aig-wrap--&gt;&lt;b&gt;Thank you, Claude! Happy Testing! &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;
-T.J. Maher&lt;br /&gt;
Software Engineer in Test&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://bsky.app/profile/tjmaher1.bsky.social&quot;&gt;BlueSky&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://bit.ly/tj_youtube&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt; |&amp;nbsp;&lt;a href=&quot;https://www.linkedin.com/in/tjmaher1&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;&amp;nbsp;| &lt;a href=&quot;http://www.tjmaher.com/p/media.html&quot; target=&quot;_blank&quot;&gt;Articles&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.tjmaher.com/feeds/2044926056492539074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.tjmaher.com/2026/05/a-field-guide-to-ai-menagerie-every.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2044926056492539074'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3868566217808655382/posts/default/2044926056492539074'/><link rel='alternate' type='text/html' href='https://www.tjmaher.com/2026/05/a-field-guide-to-ai-menagerie-every.html' title='A field guide to the AI menagerie: every model family, ranked by vibes, according to Claude'/><author><name>T.J. Maher</name><uri>http://www.blogger.com/profile/04400187344378497865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5y4V4kfwx2JmCm1bqPS90auUrj9Qjhs6W7uxbovPpgHXUOJrtNyrVewCqlKYZRsKluEP1k_Kknns3Qj6HTcxNdsBD1cRIe5HwzIAW9-TlexRRwPdlyRKlWQGmqzHcSkCijiIgci7E_uHjE0gfRPHPKRuptTsbIa4lQt4djC2t5oIoA/s1600/tj_profile.jpg'/></author><thr:total>0</thr:total></entry></feed>