Skip to content

Commit d37a99f

Browse files
WIP
1 parent ee096e3 commit d37a99f

9 files changed

+40
-3
lines changed

docs/getting-started/1_Understanding_Playwright_Python.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ through a browser to generate the code for a test. You can access the `codegen`
106106
This will bring up a browser window, with the Playwright code generator running alongside, like so:
107107

108108
<!-- vale off -->
109-
![An image of the Playwright codegen tool](./img/1-codegen.png "Playwright codegen")
109+
![An image of the Playwright codegen tool](./img/1-1_codegen.png "Playwright codegen")
110110
<!-- vale on -->
111111

112112
When using the `codegen` tool, it is recommended to do the following:
@@ -124,7 +124,7 @@ basic assertions using the `codegen` tool:
124124
These are accessible via the floating menu when using the `codegen` tool, as highlighted in green here:
125125

126126
<!-- vale off -->
127-
![An image of the Playwright codegen options](./img/2-codegen_tools.png "Playwright codegen tools")
127+
![An image of the Playwright codegen options](./img/1-2_codegen_tools.png "Playwright codegen tools")
128128
<!-- vale on -->
129129

130130
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
@@ -149,7 +149,7 @@ To open a trace file, use the following command (replacing `<path-to-file>` with
149149
A trace file when opened looks like this:
150150

151151
<!-- vale off -->
152-
![An image of the Playwright trace file](./img/3-show_trace.png "Playwright trace file view")
152+
![An image of the Playwright trace file](./img/1-3_show_trace.png "Playwright trace file view")
153153
<!-- vale on -->
154154

155155
The primary information provided within the trace is:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Getting Started #3: From Codegen To Maintainable Tests
2+
3+
This guide outlines the process of taking a test generated using the `playwright codegen` tool to a state where it
4+
will be easy to maintain going forward.
5+
6+
## Contents
7+
8+
- [Getting Started #3: From Codegen To Maintainable Tests](#getting-started-3-from-codegen-to-maintainable-tests)
9+
- [Contents](#contents)
10+
- [Setting The Scene](#setting-the-scene)
11+
- [Using `codegen` For A Test](#using-codegen-for-a-test)
12+
13+
## Setting The Scene
14+
15+
For this guide, we will look at refactoring a test that we've initially generated using the `codegen` utility provided
16+
by Playwright into a format that will make it easy to maintain going forward.
17+
18+
To start, here is our application under test for the purposes of this guide:
19+
20+
- Login Screen: A simple username / password login screen.
21+
22+
<!-- vale off -->
23+
![An image of the Example Application login screen](./img/3-1_example_login.png "Example login screen with a username and password field")
24+
<!-- vale on -->
25+
26+
- Main Menu: The landing page once logged in.
27+
28+
<!-- vale off -->
29+
![An image of the Example Application home screen](./img/3-2_example_home.png "Example home screen with a navigation menu, news and alerts section")
30+
<!-- vale on -->
31+
32+
- Search Patient: Some functionality to search for patients in our application.
33+
34+
- View Patient: A page for viewing the patient we have selected from the search menu.
35+
36+
## Using `codegen` For A Test
37+
File renamed without changes.
File renamed without changes.
9.88 KB
Loading
21.7 KB
Loading
19.7 KB
Loading
18.6 KB
Loading

0 commit comments

Comments
 (0)