1
- ![ Workshop card ] ( workshop /images/workshop-card.png )
1
+ ![ Playwright banner ] ( tutorial /images/playwright-banner.jpeg )
2
2
3
- # tau-playwright-workshop
4
3
5
- This repository contains the instructions and example code for the Playwright workshop
6
- for [ TAU: The Homecoming] ( https://applitools.com/tau-homecoming/ )
7
- on December 1, 2021.
8
- The workshop will be done in [ Python] ( https://www.python.org/ ) .
4
+ # Tutorial: Web Testing with Playwright in Python
9
5
10
6
11
- ## Instructions
7
+ ## Abstract
12
8
13
- Please try to attend the workshop * live* on the day of the event.
14
- However, if you cannot make it, never fear!
15
- ** You can still take the workshop as a self-guided tutorial.**
16
- Start by reading this README.
17
- Then, follow the guides in the ` workshop ` folder.
18
- Each part of the workshop has a ` workshop ` guide with full instructions.
19
- Feel free to open issues against this repository if you have any trouble completing the workshop independently.
9
+ Everybody gets frustrated when web apps are broken,
10
+ but testing them thoroughly doesn't need to be a chore.
11
+ [ Playwright] ( https://playwright.dev/python/ ) ,
12
+ a new open-source browser automation tool from Microsoft,
13
+ makes testing web apps fun!
14
+ Playwright outperforms other browser automation with a slew of nifty features
15
+ like automatic waiting, mobile emulation, and network interception.
16
+ Plus, with isolated browser contexts,
17
+ Playwright tests can set up * much* faster than traditional Web UI tests.
20
18
19
+ In this tutorial, we will build a [ Python] ( https://www.python.org/ )
20
+ test automation project from the ground up using Playwright.
21
+ We will automate web search engine tests together step-by-step
22
+ using Playwright for interactions and pytest for execution.
23
+ We'll also explore Playwright tricks
24
+ like cross-browser testing, capturing videos, and even running tests in parallel!
25
+ By the end of this tutorial, you'll be empowered to test modern web apps with modern web test tools.
26
+ You'll also have an example project to be the foundation for your future tests.
21
27
22
- ## Abstract
23
28
24
- [ Playwright] ( https://playwright.dev/python/ )
25
- is a hot new browser automation tool from Microsoft.
26
- With bindings for .NET, Java, JavaScript, and Python, it’s a strong alternative to Selenium WebDriver for end-to-end web app testing.
29
+ ## What is Playwright?
27
30
28
- This workshop will be an introduction to Playwright using [ Python ] ( https://www.python.org/ ) .
29
- We will automate a test scenario together that performs a [ DuckDuckGo ] ( https://duckduckgo.com/ ) search .
30
- As we code along the test together, we will learn :
31
+ Playwright is a fairly new test automation framework from Microsoft .
32
+ It is open source, and it has bindings in TypeScript/JavaScript, Python, .NET, and Java .
33
+ Some of the nice features Playwright offers include :
31
34
32
- * How to install and configure Playwright
33
- * How to integrate Playwright with [ pytest] ( https://docs.pytest.org/ ) , Python’s leading test framework
34
- * How to perform interactions through page objects
35
- * How to conveniently run different browsers, capture videos, and run tests in parallel
35
+ * concise, readable calls
36
+ * easy out-of-the-box setup
37
+ * very fast execution times (compared to other browser automation tools)
38
+ * cross-browser and mobile emulation support
39
+ * automatic waiting
40
+ * built-in API calls
41
+ * screenshots and video capture
36
42
37
- Come prepared with Python 3.7 or higher installed on your machine.
38
- By the end of the workshop, you will have a solid foundation in Playwright as well as a Python project you can extend with new tests !
43
+ Microsoft is actively developing Playwright,
44
+ so new features are coming all the time !
39
45
40
46
41
- ## Prerequisites
47
+ ## Tutorial Instructions
42
48
43
- To code along with this workshop, your machine must have Python 3.7 or higher.
44
- You should also have a decent Python editor like
45
- [ Visual Studio Code] ( https://code.visualstudio.com/docs/languages/python )
46
- or [ PyCharm] ( https://www.jetbrains.com/pycharm/ ) .
49
+ You can take this tutorial independently by following the instructions
50
+ in this ` README ` and in the [ ` tutorial ` ] ( tutorial ) folder.
51
+ Feel free to open issues against this repository if you have any trouble completing the tutorial independently.
47
52
48
- The command line shown in examples below is [ bash] ( https://en.wikipedia.org/wiki/Bash_(Unix_shell) ) .
49
- If you are using a different shell or a Windows command line, some commands may need to be different.
53
+ I also have given (or will be giving) this tutorial as a live workshop at the following events:
50
54
55
+ * [ TAU: The Homecoming] ( https://applitools.com/on-demand-videos/tau-the-homecoming-2021/ ) (December 1, 2021)
56
+ * [ Python Web Conference 2022] ( https://2022.pythonwebconf.com/tutorials/end-to-end-testing-with-playwright ) (March 22, 2021)
57
+ * [ STAREast 2022] ( https://stareast.techwell.com/program/tutorials/web-ui-testing-playwright-python-stareast-2022 ) (April 26, 2022)
58
+ * [ PyCon US 2022] ( https://us.pycon.org/2022/schedule/presentation/35/ ) (April 28, 2022)
51
59
52
- ## Agenda
53
60
54
- This workshop has five main parts, each with three sections:
61
+ ## Outline
62
+
63
+ This tutorial has five main parts, each with three sections:
55
64
56
65
1 . Getting started
57
66
1 . What is Playwright?
@@ -75,10 +84,25 @@ This workshop has five main parts, each with three sections:
75
84
3 . Running tests in parallel
76
85
77
86
87
+ ## Prerequisites
88
+
89
+ You must have basic Python programming skills to complete this tutorial.
90
+ If you are new to Python, check out the free
91
+ [ Python Programming] ( https://testautomationu.applitools.com/python-tutorial/ ) course
92
+ on Test Automation University.
93
+
94
+ Your machine must also have Python 3.7 or higher installed.
95
+ You can download the latest version of Python from [ Python.org] ( https://www.python.org/ ) .
96
+
97
+ You should also have a decent Python editor like
98
+ [ Visual Studio Code] ( https://code.visualstudio.com/docs/languages/python )
99
+ or [ PyCharm] ( https://www.jetbrains.com/pycharm/ ) .
100
+
101
+
78
102
## Example code branches
79
103
80
- Each workshop part has a corresponding branch in this repository containing the part's example code and ` workshop ` instructions.
81
- The branches allow you to check your progress at any point during the workshop .
104
+ Each tutorial part has a corresponding branch in this repository containing the part's example code and ` tutorial ` instructions.
105
+ The branches allow you to check your progress at any point during the tutorial .
82
106
The branch names are:
83
107
84
108
| Part | Branch |
0 commit comments