How do you send test results to a Microsoft Teams channel when Playwright tests finish? In the previous article I showed off how to use the playwright-slack-report package to send slack notification from within your Playwright Test run. One of the followup questions people were asking was is it possible to send notifications to Microsoft Teams as well? At the moment this isn't possible with
How do you send Slack messages to a channel when Playwright Tests Finish? - Playwright-Slack-Report There are a few ways to tackle this problem I'll start with the easiest solution first in this post which is only for Typescript/Javascript projects. 💡Part 2 to this guide can be found here, which covers sending results to slack via GitHub actions. Playwright-Slack-Report Ryan Rosello has created playwright-slack-report
Is there a way to conditionally skip the Playwright Visual Comparison toMatchSnapshot() based on if the test is running in headed or headless mode? I recently ran into a scenario where I was attempting to have a Visual Comparison test within a login test, and ran into a slight difference in the way headless and headed versions of chrome handled a scroll bar. * I get a scrollbar from screenshot when running headless: false * I
Use Playwright getByTestId() locator with your own custom test id name. One of the new page locators that was released with v1.27 was await page.getByTestId("username") makes utilizing custom test attributes easy! Take the example HTML below for a login. In the 3 input fields there is a custom data attribute data-test-id below. Login Nov 21, 2022 2 min read Is there a way for GitHub Action to Cache the Playwright Browser Binaries? 💡I've recently updated this as of 11/16/2022! If you've ever run into a situation where you find that you are running your Playwright tests multiple times a day as a GitHub Action, you can save time and money by caching  the downloaded binaries. To understand how Playwright installs How do I make a GitHub Action trigger Playwright Tests to run in a different repo? 💡These same steps can be used to programatically kick off Github Actions job in any repo regardless of the Test Automation Framework. If you ever find yourself with your Playwright Test Automation code in a separate repository than the service or application under test, have no fear! This post will Is it possible to use Playwright to do Accessibility Testing? Yes it's possible! Deque labs provides a tool called axe to assist with this. For use in playwright they specifically provide the axe-core/playwright package, and getting started is easier than ever. The below code snippet walks through how to use AxeBuilder function from the axe-core/playwright package. Calling analyze( Is there a way to capture a value out of a test.step() in Playwright? When using the Playwright Test Runner, you have access to test steps, which can be used when reporting steps of certain tests. Here you can define a title to describe the step, and the body which is a function that runs whatever code you want to run during this step. How do I find a locator that keeps disappearing in Chrome for a Playwright UI Test? I know I've run into this issue many times before. It feels like I am in a race to select the element and get a glimpse of the console to actually get the element name. This simple tip may help you keep that drop down or popup visible while interacting What's the Difference Between ">", ">>" and " " Separators in Locators When Using Playwright? If you've ever wondered how to use > or >> in your Playwright Locators look no further. This question was recently asked in the Playwright Slack hi everyone, is there any explanation or article about how should/could I use ">", ">>" and " " separators in locators? Eg. what is the difference between this page. How can I get Slack notifications when a new version of Playwright is released? One of the many reasons I'm in love with Playwright is the constant updates the tool receives. With these frequent releases there may be a few days or weeks where I may miss out on the latest features that are available. To remedy this problem I created a 'Version-Checker' github How to conditionally use afterEach in your Playwright Tests There are certain scenarios that you may run into where you want to use an afterEach in a test to clean up data, but not every scenario needs this data cleaned up. My specific example was a test where I was testing a POST endpoint. We have both positive and How to block ads during the execution of Playwright tests Recently a site that I used for building out test automation examples added google ads to their site, which actually caused all of the tests I had written to fail. The ad one that popped up from the bottom and overlaid on top of the inputs the automation was interacting Is there a way to list all the Playwright tests without running them? Yes, yes there is! The below command can be run and will give you a list of all the tests that would be run. Listing out the tests gives you access to the file name and location of the test, test name, total number of tests, and total number of How can I run multiple groups of tags with Playwright Test Runner? If you are using Playwright Test there is this sweet sweet option to tag the tests you are writing with a single or multiple tags [https://playwright.dev/docs/test-annotations#tag-tests]. The challenge may come with you have multiple tags you would like to run together. Let's say you have In Playwright Test is there an easy way to loop the test multiple times to check for flakiness? I've found it to be a good practice to run new automated tests or edits to existing tests a few times on a pull request to check for flakiness prior to merging the new code into the main branch of the test suite. To do this you can build out What's an easy way to tell how many Playwright Tests I can comfortably run in parallel? The good news, is by default Playwright takes a stab at running tests in parallel based on your computer specs. The even better news is you may be able to get faster feedback when running your Playwright Tests by increasing or decreasing the worker count. You can learn a whole Is There a Way for Playwright Tests to Include Additional Information in HTML Report After a Run? I've found as the automation suite grows, typically you need a way to easily surface information to the testers or developers who are reviewing the test run reports. Thankfully the playwright team has given us this functionality within the @playwright/test runner. There is an info() method that is available Access a Table Row With Unique Text From a Cell in Playwright There are a ton of different ways to interact with tables, this is the first of many examples of different ways you can extract/confirm data exists where it should in your Playwright Tests. For this example we will use the table found at https://letcode.in/table For this Playwright API POST request to upload a file with Content-Type: multipart/form-data When writing automation against my API, I ran into an issue attempting to make a post using playwright api to upload a file. The answer came in the form of a slack thread [https://playwright.slack.com/archives/CSUHZPVLM/p1638175756183800?thread_ts=1638175752.183700&cid=CSUHZPVLM] , I figured I would
Is there a way for GitHub Action to Cache the Playwright Browser Binaries? 💡I've recently updated this as of 11/16/2022! If you've ever run into a situation where you find that you are running your Playwright tests multiple times a day as a GitHub Action, you can save time and money by caching  the downloaded binaries. To understand how Playwright installs
How do I make a GitHub Action trigger Playwright Tests to run in a different repo? 💡These same steps can be used to programatically kick off Github Actions job in any repo regardless of the Test Automation Framework. If you ever find yourself with your Playwright Test Automation code in a separate repository than the service or application under test, have no fear! This post will
Is it possible to use Playwright to do Accessibility Testing? Yes it's possible! Deque labs provides a tool called axe to assist with this. For use in playwright they specifically provide the axe-core/playwright package, and getting started is easier than ever. The below code snippet walks through how to use AxeBuilder function from the axe-core/playwright package. Calling analyze(
Is there a way to capture a value out of a test.step() in Playwright? When using the Playwright Test Runner, you have access to test steps, which can be used when reporting steps of certain tests. Here you can define a title to describe the step, and the body which is a function that runs whatever code you want to run during this step.
How do I find a locator that keeps disappearing in Chrome for a Playwright UI Test? I know I've run into this issue many times before. It feels like I am in a race to select the element and get a glimpse of the console to actually get the element name. This simple tip may help you keep that drop down or popup visible while interacting
What's the Difference Between ">", ">>" and " " Separators in Locators When Using Playwright? If you've ever wondered how to use > or >> in your Playwright Locators look no further. This question was recently asked in the Playwright Slack hi everyone, is there any explanation or article about how should/could I use ">", ">>" and " " separators in locators? Eg. what is the difference between this page.
How can I get Slack notifications when a new version of Playwright is released? One of the many reasons I'm in love with Playwright is the constant updates the tool receives. With these frequent releases there may be a few days or weeks where I may miss out on the latest features that are available. To remedy this problem I created a 'Version-Checker' github
How to conditionally use afterEach in your Playwright Tests There are certain scenarios that you may run into where you want to use an afterEach in a test to clean up data, but not every scenario needs this data cleaned up. My specific example was a test where I was testing a POST endpoint. We have both positive and
How to block ads during the execution of Playwright tests Recently a site that I used for building out test automation examples added google ads to their site, which actually caused all of the tests I had written to fail. The ad one that popped up from the bottom and overlaid on top of the inputs the automation was interacting
Is there a way to list all the Playwright tests without running them? Yes, yes there is! The below command can be run and will give you a list of all the tests that would be run. Listing out the tests gives you access to the file name and location of the test, test name, total number of tests, and total number of
How can I run multiple groups of tags with Playwright Test Runner? If you are using Playwright Test there is this sweet sweet option to tag the tests you are writing with a single or multiple tags [https://playwright.dev/docs/test-annotations#tag-tests]. The challenge may come with you have multiple tags you would like to run together. Let's say you have
In Playwright Test is there an easy way to loop the test multiple times to check for flakiness? I've found it to be a good practice to run new automated tests or edits to existing tests a few times on a pull request to check for flakiness prior to merging the new code into the main branch of the test suite. To do this you can build out
What's an easy way to tell how many Playwright Tests I can comfortably run in parallel? The good news, is by default Playwright takes a stab at running tests in parallel based on your computer specs. The even better news is you may be able to get faster feedback when running your Playwright Tests by increasing or decreasing the worker count. You can learn a whole
Is There a Way for Playwright Tests to Include Additional Information in HTML Report After a Run? I've found as the automation suite grows, typically you need a way to easily surface information to the testers or developers who are reviewing the test run reports. Thankfully the playwright team has given us this functionality within the @playwright/test runner. There is an info() method that is available
Access a Table Row With Unique Text From a Cell in Playwright There are a ton of different ways to interact with tables, this is the first of many examples of different ways you can extract/confirm data exists where it should in your Playwright Tests. For this example we will use the table found at https://letcode.in/table For this
Playwright API POST request to upload a file with Content-Type: multipart/form-data When writing automation against my API, I ran into an issue attempting to make a post using playwright api to upload a file. The answer came in the form of a slack thread [https://playwright.slack.com/archives/CSUHZPVLM/p1638175756183800?thread_ts=1638175752.183700&cid=CSUHZPVLM] , I figured I would