How good is GitHub Copilot at generating Playwright code?
AI Summary
In this video, Stefan Judis explores the effectiveness of GitHub Copilot in generating Playwright test scripts compared to ChatGPT and Playwright Codegen. He demonstrates a workflow starting with simple test cases where Copilot leverages project files as context, showing improved Playwright test generation with better locators and code quality after adding custom Copilot instructions (a new preview feature). Stefan also presents a more complex test scenario involving YouTube links, highlighting conversations with Copilot to refine locators and assert conditions, including handling Playwright’s strict mode issues. He concludes that while Copilot excels in code refactoring and simple test generation, using AI for very simple cases might not be time effective compared to Playwright Codegen. Custom instructions and clear prompts are crucial for high-quality AI-generated Playwright code. He emphasizes that Copilot is a helpful tool but the developer remains responsible for understanding and reviewing generated code. The video also briefly mentions Checkly for synthetic monitoring using Playwright.