Skip to content

Commit df0f656

Browse files
updated documentation
1 parent d178199 commit df0f656

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

docs/getting-started/1_Understanding_Playwright_Python.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ This guide outlines how Playwright works in Python, and how to start writing tes
44

55
## Contents
66

7-
- [Getting Started #1: Understanding Playwright Python](getting-started-1-understanding-playwright-python)
8-
- [The Basics](the-basics)
7+
- [Getting Started #1: Understanding Playwright Python](#getting-started-1-understanding-playwright-python)
8+
- [Contents](#contents)
9+
- [The Basics](#the-basics)
10+
- [How Does pytest Work](#how-does-pytest-work)
11+
- [Executing Tests](#executing-tests)
12+
- [Using pytest Logic](#using-pytest-logic)
13+
- [Utilising Playwright `codegen`](#utilising-playwright-codegen)
14+
- [Appendix](#appendix)
15+
- [Info: What Is Chromium](#info-what-is-chromium)
916

1017
## The Basics
1118

@@ -80,17 +87,26 @@ When using the `codegen` tool, it is recommended to do the following:
8087
- Pass in a starting URL where possible to set the window at your starting location (e.g. `playwright codegen https://github.com/nhs-england-tools/playwright-python-blueprint`)
8188
- When using the Playwright Inspector window, set the target value to Pytest as it'll automatically format any generated tests into the pytest format we recommend using in this blueprint
8289

83-
The `codegen` tool is particularly powerful, as it also allows you to consider assertions on the page you are hoping to test.
90+
The `codegen` tool is particularly powerful, as it also allows you to consider assertions on the page you are hoping to test. Currently, you can do the following
91+
basic assertions using the `codegen` tool:
8492

85-
*** TODO - Talk about assertion management
93+
- Assert visibility of an element on the page
94+
- Assert specific text is present within an element on the page
95+
- Assert an element on the page has a specific value
96+
97+
These are accessible via the floating menu when using the `codegen` tool, as highlighted in green here:
98+
99+
<!-- vale off -->
100+
![An image of the Playwright codegen options](./img/2-codegen_tools.png "Playwright codegen tools")
101+
<!-- vale on -->
86102

87103
Whilst the `codegen` tool will provide you with the basic code to get started, it's recommended that once you've got a working test, you consider refactoring any
88104
code that has been provided and refine as needed. Having the ability to generate the code in this fashion allows you to create tests quickly and build up
89105
understanding of how to construct tests using Playwright Python, but you will soon discover that they may not be the most efficient in their raw state!
90106

91107
## Appendix
92108

93-
### Info: What is Chromium
109+
### Info: What Is Chromium
94110

95111
[Chromium](https://www.chromium.org/Home/) is one of the open source browser that comes bundled with Playwright on install (if using the instructions
96112
within the [README](../../README.md) of this blueprint) but also more importantly, serves as the base code for both Google Chrome and Microsoft Edge.
115 KB
Loading

0 commit comments

Comments
 (0)