560 blogs tracked4,950 posts indexed

#playwright

12 posts · 1 company · newest first

1

Publishing Playwright HTML reports on GitLab Pages (opens on the source site)

We've added a lot to our demo project, bun--create-playwright. We've explored setting up a Playwright framework using bun, a new package manager bundled into Claude Code. We've added typechecking, and formatting and linting. We've set up a CI/ CD pipeline for our tests using GitLab, one with three stages: Quality: We check that the formatting, linting and typechecking is correct for any changes we attempt to push to the code base. Test: We run the smoke and then the regression tests to make sure that everything still works. Report: We bundle an archive of the Playwright generated HTML report,…

bun-create-playwrightgitlabexcerpt only · body stays at the source
From the web
2

Examining the artifacts job of a Playwright GitLab CI / CD pipeline (opens on the source site)

You may have noticed that in the GitLab CI / CD Pipeline for our Playwright project, in the .gitlab-ci.yml file, after our scripts has run, in the Test stage, there is a subsection called "artifacts" with certain paths to something called "playwright-report", "test-results", and "reports". The Playwright -> Artifacts -> Reports stage playwright: extends: .bun_playwright stage: test timeout: 30 minutes ... ... artifacts: when: always paths: - playwright-report/ - test-results/ - reports/ reports: junit: reports/junit/results.xml expire_in: 30 days…

bun-create-playwrightgitlabexcerpt only · body stays at the source
From the web
3

How Developers Can Test Their Feature Branch Against Various Playwright Configurations Before Creating a Merge Request in GitLab CI/CD (opens on the source site)

Developers need the option to test out their feature branch before merging it into main. In the last section, we set up a GitLab CI/CD Pipeline in our bun-create-playwright project to check every GitLab Merge Request. Now, we will be giving developers option to create a new pipeline where they can choose: Which feature branch to test against. Which test suite to execute (LoginPage tests? Secure Area? Or all of them?) Which Playwright browser to use: Chromium, Firefox, WebKit, or all. All these features can be set up using our .gitlab-ci.yaml file! Go to to bun-create-playwright, view the…

bun-create-playwrightgitlabexcerpt only · body stays at the source
From the web
4

Setting up a CI/ CD pipeline with GitLab: Quality, Test and Report (opens on the source site)

So far, we have reviewed how to review code with ES Lint + Prettier and Typecheck, how to set up and run smoke tests, how to run all Playwright + TypeScript tests, and reviewed the HTML report of results. In this post, we are going to set up a three stage GitLab CI/ CD pipeline that will run against every merge request: Quality (lint, typecheck, prettier) --> Test ( smoke + regression ) --> Report ( Downloadable ) I haven't used GitLab since when I worked at ThreatStack back in 2020. ( See my blog entry Getting to Know GitLab and How They Test the UI ) GitLab reads .gitlab-ci.yml from the…

bun-create-playwrightgitlabexcerpt only · body stays at the source
From the web
5

How to Configure Playwright Test to run smoke tests, headed tests, and debug versions through scripts in package.json (opens on the source site)

Earlier, we went over how we could create scripts in the package.json file of our Playwright framework to add typechecking, linting, and formatting your code with prettier. Want to see the entire bun-create-playwright project? It is on tinyurl.com/bun-create-playwright! 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. ... and shortcuts for all of these can be set up in the scripts in your package.json! If you are using "bun" as a package manager, as we are in bun-create-playwright, just type out…

bun-create-playwrightgitlabexcerpt only · body stays at the source
From the web
6

Implementing Page Objects in Playwright (opens on the source site)

Picture a login screen, such as The-Internet / Login. On this LoginPage, there is: a heading: Login Page a user name textbox with the label, "Username" a password textbox with the label, "Password" a login button, with the role of a button, and the name of "Login" a flash message that appears if you enter invalid credentials such as "NotAUser" and "NotAPassword". If you successfully log in with "tomsmith" and "SuperSecretPassword!, there is a SecureArea: a heading: "Secure Area" a flash message "You logged into a secure area!" a Logout button. Sure, you could interact with each web element in…

bun-create-playwrightpage-objectexcerpt only · body stays at the source
From the web
7

How Playwright Frameworks get configured with playwright.config.ts (opens on the source site)

When we installed bun, a new package manager owned by Anthropic, then ran "bun create playwright", 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: playwright.config.ts. 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's examine just the code generated below. If you need to see the whole file, you can see it here: https://playwright.dev/docs/test-configuration…

bun-create-playwrightplaywrightexcerpt only · body stays at the source
From the web
8

Running Tests with Playwright Test Explorer and Generating Tests with Codegen (opens on the source site)

Finding the best locator for a web element can be a hassle: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't a clear test id. 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. "Playwright will look at your page and figure out the best locator, prioritizing role, text and test id locators. If the generator finds multiple elements matching the locator, it will improve the locator to make it resilient that uniquely identify…

bun-create-playwrightplaywrightexcerpt only · body stays at the source
From the web
9

Add Type Checking and TSConfig to Bun-Create-Playwright (opens on the source site)

Now that we have installed bun, Anthropic's package manager, and scaffolded a Playwright framework and closely examined the results, we are going to explore with our Bun-Create-Playwright project ways to check if our code is correct. The first method we will be exploring is typechecking. Why Typechecking? As the Playwright.dev / Node.js Introduction mentions: "[...] 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. "[...] Note that Playwright only supports the…

bun-create-playwrightplaywrightexcerpt only · body stays at the source
From the web
10

What happens when you scaffold a Playwright framework and run installed tests using bun? (opens on the source site)

We covered in the last blog post how to install bun, a new package manager. In this blog post, we will look into using bun to install a new Playwright framework. Create the Playwright Framework Once I installed bun on my Windows PC and was up and running I created a new folder, "bun-create-playwright". I opened up that folder in VS Code, along with a new PowerShell terminal. In that terminal I entered: bun create playwright This activated the interactive Playwright installer that Playwright comes with. I selected I wanted it to create for me a TypeScript project, placing the tests in the…

bun-create-playwrightplaywrightexcerpt only · body stays at the source
From the web
11

Practicing Playwright: API Testing, Intercepting Network Requests, and Mocking APIs (opens on the source site)

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? We will be walking through Butch Mayhew's code that answers all of these questions, part of his LinkedIn Learning course: Playwright Essential Training. We will be examining the shopping cart test site PracticeSoftwareTesting.com and looking at code on Butch's companion GitHub site on how to mock out the API and use them in the UI tests. Playwright has a lot…

playwrightexcerpt only · body stays at the source
From the web
12

Practicing Playwright: Visual Testing With Playwright (opens on the source site)

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'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. Caution: 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…

playwrightexcerpt only · body stays at the source
From the web
12 shown

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.