{"id":21372401,"url":"https://github.com/automationpanda/playwright-python-tutorial","last_synced_at":"2025-09-09T15:35:32.929Z","repository":{"id":37395492,"uuid":"431635613","full_name":"AutomationPanda/playwright-python-tutorial","owner":"AutomationPanda","description":"A tutorial for learning how to automate tests with Playwright in Python","archived":false,"fork":false,"pushed_at":"2023-06-21T13:54:38.000Z","size":10243,"stargazers_count":343,"open_issues_count":3,"forks_count":95,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-26T06:11:40.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AutomationPanda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-24T21:42:33.000Z","updated_at":"2025-05-23T11:34:32.000Z","dependencies_parsed_at":"2023-02-09T03:16:34.563Z","dependency_job_id":"a30e79ca-5318-4baa-956a-4720b5dbc507","html_url":"https://github.com/AutomationPanda/playwright-python-tutorial","commit_stats":null,"previous_names":["automationpanda/tau-playwright-workshop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AutomationPanda/playwright-python-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AutomationPanda%2Fplaywright-python-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AutomationPanda%2Fplaywright-python-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AutomationPanda%2Fplaywright-python-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AutomationPanda%2Fplaywright-python-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AutomationPanda","download_url":"https://codeload.github.com/AutomationPanda/playwright-python-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AutomationPanda%2Fplaywright-python-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274318351,"owners_count":25263077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T08:19:34.709Z","updated_at":"2025-09-09T15:35:32.867Z","avatar_url":"https://github.com/AutomationPanda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Playwright banner](tutorial/images/playwright-banner.jpeg)\n\n\n# Tutorial: Web Testing with Playwright in Python\n\n*Warning: Many parts of this tutorial have fallen out of date. I hope to update it sometime in the future.*\n\n\n## Abstract\n\nEverybody gets frustrated when web apps are broken,\nbut testing them thoroughly doesn't need to be a chore.\n[Playwright](https://playwright.dev/python/),\na new open-source browser automation tool from Microsoft,\nmakes testing web apps fun!\nPlaywright outperforms other browser automation with a slew of nifty features\nlike automatic waiting, mobile emulation, and network interception.\nPlus, with isolated browser contexts,\nPlaywright tests can set up *much* faster than traditional Web UI tests.\n\nIn this tutorial, we will build a [Python](https://www.python.org/)\ntest automation project from the ground up using Playwright.\nWe will automate web tests together step-by-step\nusing Playwright for interactions and pytest for execution.\nWe'll also explore Playwright tricks\nlike cross-browser testing, capturing videos, and even running tests in parallel!\nBy the end of this tutorial, you'll be empowered to test modern web apps with modern web test tools.\nYou'll also have an example project to be the foundation for your future tests.\n\n\n## What is Playwright?\n\nPlaywright is a fairly new test automation framework from Microsoft.\nIt is open source, and it has bindings in TypeScript/JavaScript, Python, .NET, and Java.\nSome of the nice features Playwright offers include:\n\n* concise, readable calls\n* easy out-of-the-box setup\n* very fast execution times (compared to other browser automation tools)\n* cross-browser and mobile emulation support\n* automatic waiting\n* screenshots and video capture\n* built-in API calls\n\nMicrosoft is actively developing Playwright,\nso new features are coming all the time!\n\n\n## Tutorial Instructions\n\nYou can take this tutorial independently by following the instructions\nin this `README` and in the [`tutorial`](tutorial) folder.\nFeel free to open issues against this repository if you have any trouble completing the tutorial independently.\n\nI also have given (or will be giving) this tutorial as a live workshop at the following events:\n\n* [TAU: The Homecoming](https://applitools.com/on-demand-videos/tau-the-homecoming-2021/) (December 1, 2021)\n* [Python Web Conference 2022](https://2022.pythonwebconf.com/tutorials/end-to-end-testing-with-playwright) (March 22, 2022)\n* [STAREast 2022](https://stareast.techwell.com/program/tutorials/web-ui-testing-playwright-python-stareast-2022) (April 26, 2022)\n* [PyCon US 2022](https://us.pycon.org/2022/schedule/presentation/35/) (April 28, 2022)\n\n\n## Outline\n\nThis tutorial has six main parts, each with three sections:\n\n1. Getting started\n   1. What is Playwright?\n   2. Our web search test\n   3. Test project setup\n2. First steps with Playwright\n   1. Browsers, contexts, and pages\n   2. Navigating to a web page\n   3. Performing a search\n3. Writing assertions\n   1. Checking the search field\n   2. Checking the result links\n   3. Checking the title\n4. Refactoring using page objects\n   1. The search page\n   2. The result page\n   3. Page object fixtures\n5. Nifty Playwright tricks\n   1. Testing different browsers\n   2. Capturing screenshots and videos\n   3. Running tests in parallel\n6. Testing with APIs\n   1. API setup\n   2. Writing a pure API test\n   3. Writing a hybrid UI/API test\n\n\n## Prerequisites\n\nYou must have basic Python programming skills to complete this tutorial.\nIf you are new to Python, check out the free\n[Python Programming](https://testautomationu.applitools.com/python-tutorial/) course\non Test Automation University.\n\nYour machine must also have Python 3.7 or higher installed.\nYou can download the latest version of Python from [Python.org](https://www.python.org/).\n\nYou should also have a decent Python editor like\n[Visual Studio Code](https://code.visualstudio.com/docs/languages/python)\nor [PyCharm](https://www.jetbrains.com/pycharm/).\n\nIf you wish to complete Part 6 (\"Testing with APIs\"),\nthen you will need a [GitHub](https://github.com/) account.\n\n\n## Example code branches\n\nEach tutorial part has a corresponding branch in this repository containing the part's example code and `tutorial` instructions.\nThe branches allow you to check your progress at any point during the tutorial.\nThe branch names are:\n\n| Part     | Branch              |\n| ------   | ------------------- |\n| Start    | 0-initial-project   |\n| Part 1   | 1-getting-started   |\n| Part 2   | 2-first-steps       |\n| Part 3   | 3-assertions        |\n| Part 4   | 4-page-objects      |\n| Part 5   | 5-playwright-tricks |\n| Part 6   | 6-api-testing       |\n| Complete | main                |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomationpanda%2Fplaywright-python-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautomationpanda%2Fplaywright-python-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomationpanda%2Fplaywright-python-tutorial/lists"}