Skip to content

Add Playwright Python test generation custom instructions #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 6, 2025

Conversation

dgh06175
Copy link
Contributor

@dgh06175 dgh06175 commented Aug 5, 2025

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, or chat mode file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, or chat mode with GitHub Copilot.
  • I have run node update-readme.js and verified that README.md is up to date.

Description

This PR introduces a custom instruction file for generating Playwright E2E tests in Python with pytest, aligned with the official Playwright documentation. It enforces modern best practices for locators, assertions, and test organization.

What’s included

  • Use of role-based locators and expect-based assertions
  • Recommended pytest structure and fixtures
  • Naming conventions and file organization
  • Tips for avoiding flakiness and debugging failures
  • Preference for expect over assert

Why

To guide GitHub Copilot toward generating Playwright tests that align with the latest official recommendations—moving Copilot away from legacy syntax and ensuring consistency across teams.

File

instructions/playwright-python.md


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New chat mode file.
  • Other (please specify):

Additional Notes


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 13:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds custom instructions for GitHub Copilot to generate Playwright Python E2E tests following official documentation best practices. The instructions emphasize modern locator strategies, web-first assertions, and proper test organization to improve test reliability and maintainability.

  • Introduces comprehensive guidelines for Playwright Python test generation
  • Provides practical examples demonstrating role-based locators and expect assertions
  • Establishes consistent file organization and naming conventions for test projects

Copy link
Contributor

@aaronpowell aaronpowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run the script to update the readme

@dgh06175
Copy link
Contributor Author

dgh06175 commented Aug 6, 2025

Please run the script to update the readme

I ran the script. changes are applied.

@aaronpowell aaronpowell merged commit 4d91148 into github:main Aug 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants