Skip to content

Commit 7490494

Browse files
Added Quick Reference Guide (#20)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> This adds a quick reference guide (aka a cheat sheet) for easy reference to many commands that may be useful. ## Context <!-- Why is this change required? What problem does it solve? --> Provides an easy reference for users to experiment with functionality. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [ ] Refactoring (non-breaking change) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I am familiar with the [contributing guidelines](../docs/CONTRIBUTING.md) - [x] I have followed the code style of the project - [ ] I have added tests to cover my changes - [x] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent 68ac523 commit 7490494

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Once you've confirmed your installation is working, please take a look at the fo
6262
1. [Understanding Playwright Python](./docs/getting-started/1_Understanding_Playwright_Python.md)
6363
2. [Blueprint File Breakdown](./docs/getting-started/2_Blueprint_File_Breakdown.md)
6464

65+
We've also created a [Quick Reference Guide](./docs/getting-started/Quick_Reference_Guide.md) for common commands and actions you may regularly perform using this blueprint.
66+
6567
For additional reading and guidance on writing tests, we also recommend reviewing the [Playwright Python documentation](https://playwright.dev/python/docs/writing-tests).
6668

6769
## Contacts
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Playwright Python Quick Reference Guide
2+
3+
This page outlines some common functions / utilities that may be useful for users of this blueprint.
4+
5+
## Table of Contents
6+
7+
- [Playwright Python Quick Reference Guide](#playwright-python-quick-reference-guide)
8+
- [Table of Contents](#table-of-contents)
9+
- [CLI: Playwright Utilities](#cli-playwright-utilities)
10+
- [CLI: Pytest Execution Options](#cli-pytest-execution-options)
11+
12+
## CLI: Playwright Utilities
13+
14+
The following outlines some useful commands to use with the `playwright` command in the following format:
15+
16+
playwright <command-to-use>
17+
18+
|Name|Command to use|Description|
19+
|----|--------------|-----------|
20+
|Use code generator|`codegen <url (optional)>`|Opens the code generator and a browser window ready to navigate. If a URL is provided, the browser will open on the provided page.|
21+
|Show trace details|`show-trace <path-to-zip-file>`|Opens the trace file generated by Playwright if generated. You need to provide a path to the trace.zip file for it to open.|
22+
|Install MS Edge|`install msedge`|Installs Microsoft Edge for use by Playwright.|
23+
|Install Chrome|`install chrome`|Installs Google Chrome for use by Playwright.|
24+
25+
## CLI: Pytest Execution Options
26+
27+
The following outlines some useful commands to use with the `pytest` command in the following format:
28+
29+
pytest <command-to-use>
30+
31+
|Name|Command to use|Description|
32+
|----|--------------|-----------|
33+
|Tracing on|`--tracing on`|Runs all the tests with tracing enabled, generating trace.zip files for each.|
34+
|Headed mode|`--headed`|Runs the tests in headed mode (browser will display on-screen while the test is running).|
35+
|Run specific markers|`-m "marker-name"`|Runs tests with the specified marker / tag (denoted with @pytest.marker.marker-name before the test function).|
36+
|Exclude specific markers|`-m "not marker-name"`|Runs tests without the specified marker / tag (denoted with @pytest.marker.marker-name before the test function).|
37+
|Run in slow motion|`--slowmo <value-in-ms>`|Slows down each operation Playwright conducts by the amount of milliseconds specified.|
38+
|Generate video|`--video <on/retain-on-failure>`|Records a video for each test. If set to on, will keep for all videos. If set to retain-on-failure, only failed test videos are kept.|
39+
|Run tests in Edge|`--browser chromium --browser-channel msedge`|Runs the specified tests in Microsoft Edge.|
40+
|Run tests in Chrome|`--browser chromium --browser-channel chrome`|Runs the specified tests in Google Chrome.|
41+
|Run tests in Firefox|`--browser firefox`|Runs the specified tests in Mozilla Firefox.|
42+
43+
Further information can be found in the [Playwright documentation](https://playwright.dev/python/docs/test-runners#cli-arguments).

0 commit comments

Comments
 (0)