Playwright: How to run last failed tests only?

Playwright: How to run last failed tests only?

Understanding the Need:

Rerunning only failed test cases saves time and resources. It allows for focused debugging and re-execution without unnecessary re-running of successful tests.


The method to rerun failed tests varies based on the testing framework used.


Playwright also supports for rerunning all the failed tests at one shot and you need to use playwright version >= 1.44.


Step1: I am using playwright version 1.46.0

playwright version 1.46.0

Step2: Let's run the tests using command

npx playwright test

or 

npx playwright specfilename        

Out 6 tests 2 are failed


test results


playwright test report

Step3: Now we will rerun failed tests using below commands

npx playwright test --last-failed        

Still our tests are failing

Let me fix the issues & i will rerun failed tests using same command

npx playwright test --last-failed        
playwright report

All the failed tests have been executed successfully. This is how we need to rerun failed set of tests using playwright.


Reference: https://playwright.dev/docs


TO RECEIVE DAILY UPDATES, SUBSCRIBE CHANNEL - https://www.youtube.com/c/BakkappaN_SoftwareTesting_Videos?sub_confirmation=1


===== Playwright Automation Full Courses =====

-> Playwright Full Course - https://youtube.com/playlist?list=PLUeDIlio4THEgPRVJRqZRS8uw8hhVNQCM&si=65JRAAG-SkkfphDm

-> Playwright API Testing Crash Course - https://youtube.com/playlist?list=PLUeDIlio4THF3rnYZ63qkbHwMTXiG67vz&si=hNd_ji_kXVmIAr_R

-> Playwright with Azure DeveOps Pipeline - https://youtube.com/playlist?list=PLUeDIlio4THG8irTXJn-Z02nYzmi6dUOF&si=3b4G5tvemlPy0--j

-> Playwright with CRM application testing - https://youtu.be/WwovRRp0f4o?si=w0rzJlUI9BhfP4KS


===== Playwright GitHub Repositories =====

-> Playwright Full Course - https://github.com/BakkappaN/PlaywrightTutorialFullCourse

-> Playwright API Testing Crash Course - https://github.com/BakkappaN/PlaywrightAPITestingTutorial

-> Playwright with Azure DeveOps Pipeline - https://github.com/BakkappaN/PlaywrightAzureDevopsPipeline

-> Playwright with CRM application testing -https://github.com/BakkappaN/MicrosoftD365CRMPlaywrightFramework

-> Playwright with JavaScript Framework [UI + API] - https://github.com/BakkappaN/PlaywrightBaseAutomationFramework

-> Playwright with TypeScript Framework [UI + API]- https://github.com/BakkappaN/Playwright-TypeScript-Framework


Learn more about Playwright:


-> Playwright API Testing Crash Course



-> Playwright with Azure DevOps Complete guide


-> Testing Microsoft CRM application using Playwright


#playwright #apitesting #qa #softwaretesting #crm #javascript #typescript #ado #azuredeveops #framework #fullcourse #codegen #test #e2e #testing #automation #testerstalk #bakkappan #git #github #testautomation #selenium #cypress #microsoftplaywright #microsoft #opensource


SUBSCRIBE CHANNEL TO GET LATEST SOFTWARE TESTING UPDATES - https://www.youtube.com/c/BakkappaN_SoftwareTesting_Videos?sub_confirmation=1


要查看或添加评论,请登录

Bakkappa N的更多文章