{"repo":"kettanaito/playwright-persona","free":true,"listed":false,"github":"https://github.com/kettanaito/playwright-persona","clone":"git clone https://github.com/kettanaito/playwright-persona.git","description":"Authentication in Playwright using personas.","language":"TypeScript","stars":135,"topics":["auth","persona","playwright","setup","test"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"Playwright Persona 🎭 Authentication in Playwright using personas. Motivation Testing authentication-dependent behaviors requires you to set up authentication in your tests. Playwright comes with some great APIs and recommendations when it comes to Authentication. However, I found a few problems with the official recommendations: - It's imperative. You have to (1) create a separate auth project; (2) describe the authentication steps there; (3) store and restore the session state manually; (4) mark a subset of tests dependent on that auth project. This feels more like orchestrating Playwright APIs than saying \"authenticate as user XYZ\". - It promotes authentication as a part of a global test setup. I strongly believe that by doing so, authentication becomes a facilitator of a shared state between test cases, leading to flakiness. You've got one test that adds an item to cart and another that ensures that the cart page is empty by default. If they happen to run with the same user but in the wrong order, one of them is bound to fail. Ouch! - It's unopinionated. Arguably, as a low-level API should be! However, there are only a handful authentication strategies in tests and I believe this is a perfect place for strong opinions in favor of predictable experience. And that's why playwright-persona exists—to address the issues above and also wrap the following best practices in a lean and accessible API: 1. Declarative . From how you define different user roles to the authentication ","default_branch":null,"files":null,"tree":[],"storefront":"/r/kettanaito","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kettanaito/playwright-persona/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}