1
1
# Part 1: Getting started
2
2
3
- Part 1 of the workshop explains how to start testing with Playwright and pytest in Python .
3
+ Part 1 of the workshop explains how to set up a Python test automation project with pytest and Playwright .
4
4
5
5
6
6
## What is Playwright?
@@ -62,13 +62,10 @@ to manage dependency packages locally:
62
62
63
63
``` bash
64
64
$ python3 -m venv venv
65
- $ source venv/bin/activate
66
65
```
67
66
68
67
Creating a new virtual environment for each Python project is a recommended practice.
69
68
This command will create a subdirectory named ` venv ` that holds all virtual environment files, including dependency packages.
70
- After creating a virtual environment, you must "activate" it to use it using the ` source ` command shown above.
71
- You can tell if a virtual environment is active if its name appears in the bash prompt.
72
69
73
70
* A note about Python commands:*
74
71
Python has two incompatible major versions: 2 and 3.
@@ -77,6 +74,21 @@ For example, macOS comes bundled with Python 2.7.18.
77
74
Sometimes, the ` python ` executable may point to Python 2 instead of 3.
78
75
To be precise about versions and executables, we will use the ` python3 ` and ` pip3 ` commands explicitly in this workshop.
79
76
77
+ After creating a virtual environment, you must "activate" it.
78
+ On macOS or Linux, use the following command:
79
+
80
+ ``` bash
81
+ $ source venv/bin/activate
82
+ ```
83
+
84
+ The equivalent command for a Windows command line is:
85
+
86
+ ```
87
+ > venv\Scripts\activate.bat
88
+ ```
89
+
90
+ You can tell if a virtual environment is active if its name appears in the prompt.
91
+
80
92
Let's add some Python packages to our new virtual environment:
81
93
82
94
``` bash
0 commit comments