Skip to content

Commit 02c8d0a

Browse files
committed
Update tutorial docs spelling
1 parent 335469b commit 02c8d0a

5 files changed

Lines changed: 64 additions & 66 deletions

File tree

‎tutorial/stage-0-baseline/playwright-e2e-from-cowboy-to-confidence.mdx‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Playwright e2e testing - from cowboy to confidence
3-
description: Outline of the Endform saas tutorial, where we will take an untested saas application and build a Playwright test suite for it.
3+
description: Outline of the Endform SaaS tutorial, where we will take an untested SaaS application and build a Playwright test suite for it.
44
sidebar:
55
order: 1
66
---
@@ -15,18 +15,18 @@ _Maybe you're a bit of a cowboy._
1515

1616
Maybe you already have unit and integration tests, but you still keep running through user flows manually in your browser.
1717

18-
Or you're a more seasoned Playwright tester, but you're looking to brush up on the latest and greatest, and improve your setup.
18+
Or you're a more seasoned Playwright tester, but you're looking to brush up on the latest and greatest, and improve your setup.
1919

20-
In this tutorial, we will end-to-end test a realistic software as a service application from scratch.
21-
We will cover all of the Playwright features that you need to be productive in your day to day.
20+
In this tutorial, we will end-to-end test a realistic software-as-a-service application from scratch.
21+
We will cover all of the Playwright features that you need to be productive in your day-to-day work.
2222

2323
So come along, and let's get you from cowboy to confidence.
2424

2525
## Source code
2626

27-
The full repository for this tutorial can be found [here](https://github.com/endformdev/playwright-tutorial).
27+
The full repository for this tutorial can be found [here](https://github.com/endformdev/playwright-tutorial).
2828

29-
The repository contains a software as a service application that has login, logout, user modification, team management and checkout functionality.
29+
The repository contains a software-as-a-service application that has login, logout, user modification, team management, and checkout functionality.
3030
The application is built with Next.js and can either be run locally from your command line or you can test against our [pre-deployed version of it](https://endform-playwright-tutorial.vercel.app).
3131

3232
## Getting started with the tutorial repository
@@ -36,7 +36,7 @@ To get started, you will need to:
3636
- [Clone the repository](https://github.com/endformdev/playwright-tutorial): `git clone https://github.com/endformdev/playwright-tutorial && cd playwright-tutorial`
3737
- Make sure you have [`pnpm` installed on your system](https://pnpm.io/installation#using-corepack)
3838
- Install the dependencies: `pnpm install`
39-
- Checkout the branch for the stage you want to start from, for example: `git checkout stage-0-baseline`
39+
- Check out the branch for the stage you want to start from, for example: `git checkout stage-0-baseline`
4040

4141
We will be testing against a realistic dummy application.
4242
You can either:
@@ -53,12 +53,12 @@ You can either:
5353
## Choose where to start
5454

5555
Each step of the tutorial has a [branch associated with it](https://github.com/endformdev/playwright-tutorial/branches), with all of the work included from the previous tutorial steps.
56-
You can choose to start from the beginning, or you can start from a specific step, depending on what you're interested in and what your previous experience with Playwright is.
56+
You can choose to start from the beginning, or you can start from a specific step, depending on what you're interested in and what your previous experience with Playwright is.
5757

5858
Here's what we'll cover in each step:
5959

6060
<LinkCard
61-
title="Practical playwright setup"
61+
title="Practical Playwright setup"
6262
description="Setting up a Playwright project to make your future testing life easier."
6363
href="/docs/tutorial/practical-playwright-setup"
6464
/>
@@ -81,4 +81,3 @@ Here's what we'll cover in each step:
8181
href="/docs/tutorial/understanding-test-results"
8282
/>
8383

84-

‎tutorial/stage-1-setup/practical-playwright-setup.mdx‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Aside, Tabs, TabItem } from '@astrojs/starlight/components';
99
import { Image } from "astro:assets";
1010
import StepOverDebug from "../../../assets/step-over-debug.png";
1111

12-
In this part of the tutorial, we will both set up a Playwright project from scratch, but we will also learn to use the most important features to be more productive with Playwright when using a real-world application.
12+
In this part of the tutorial, we will set up a Playwright project from scratch and learn to use the most important features for being more productive with Playwright in a real-world application.
1313

1414
Some Playwright features we will cover include:
1515

@@ -20,7 +20,7 @@ Some Playwright features we will cover include:
2020
Let's get started!
2121

2222
<Aside>
23-
To start from this step, checkout the [`stage-0-baseline` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-0-baseline) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
23+
To start from this step, check out the [`stage-0-baseline` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-0-baseline) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
2424
For more information about getting started with the tutorial repository, go [here](/docs/tutorial/playwright-e2e-from-cowboy-to-confidence#getting-started-with-the-tutorial-repository).
2525
</Aside>
2626

@@ -62,7 +62,7 @@ projects: [
6262
name: "chromium",
6363
use: { ...devices["Desktop Chrome"] },
6464
}
65-
// Remove the other firefox and webkit projects
65+
// Remove the other Firefox and WebKit projects
6666
]
6767
```
6868

@@ -71,7 +71,7 @@ projects: [
7171
Let's check that this works by modifying the `example.spec.ts` test file in the `tests` directory.
7272

7373
- Remove the second test "get started link"
74-
- Modify the first test to go to the default url `await page.goto("/")`
74+
- Modify the first test to go to the default URL `await page.goto("/")`
7575
- Modify the expectation to check for our page title `/Playwright Tutorial/`
7676
- Watch your test run `pnpm playwright test --debug`
7777

@@ -80,7 +80,7 @@ When you run Playwright in debug mode for the first time, the browser will open
8080
</Aside>
8181

8282
You can watch your test step by step by using the "step over" button.
83-
<Image src={StepOverDebug} alt="Step over button in Playwrights inspector" width={600} />
83+
<Image src={StepOverDebug} alt="Step over button in Playwright's inspector" width={600} />
8484

8585
## Alternatives for creating temporary test data (like users)
8686

@@ -89,20 +89,20 @@ Almost all of the tests that you will end up making will require some amount of
8989
There are two schools of thought about how to create this test data.
9090
Either you can create it by using the browser and clicking through your application to create that data, or you can use either your public API or create internal APIs in order to create this data more efficiently.
9191

92-
Playwright has two methods of globally setting up test data before your suite runs. Project dependencies, which runs a browser, or global setup, which is more like a simple script more suited to API calls.
92+
Playwright has two methods of globally setting up test data before your suite runs: project dependencies, which run a browser, or global setup, which is more like a simple script better suited to API calls.
9393

94-
If we look at [Playwrights documentation](https://playwright.dev/docs/test-global-setup-teardown), we can see that it slightly prefers using project dependencies to globally set up and tear down test data.
95-
The table in the documentation there outlines how using project dependencies provides more visibility into how the set up and tear down steps work.
94+
If we look at [Playwright's documentation](https://playwright.dev/docs/test-global-setup-teardown), we can see that it slightly prefers using project dependencies to globally set up and tear down test data.
95+
The table in the documentation there outlines how using project dependencies provides more visibility into how the setup and teardown steps work.
9696

9797
In our experience, having an API endpoint available to create data (like test users), instead of requiring a whole browser, makes your Playwright project more flexible long term.
9898
Initially you will feel like one user is enough, in which case the browser-based setup method is the simplest.
9999
However, further down the line, you will likely need to make several users, some for cases where users collide such as your "delete user" flow.
100100
When this happens, you will find that your API endpoints will make it much easier to create these tests.
101101

102-
If you learn to create and use API endpoints like this, it will be much easier for you to extend them to create more kinds of useful test data, such as organisations or organisation memberships.
103-
This will really take your ability to test end to end test your application to a whole new level.
102+
If you learn to create and use API endpoints like this, it will be much easier for you to extend them to create more kinds of useful test data, such as organizations or organization memberships.
103+
This will really take your ability to test your application end-to-end to a whole new level.
104104

105-
Today we will learn to use both kinds of set up approaches.
105+
Today we will learn to use both kinds of setup approaches.
106106

107107
### Setup & teardown with Playwright project dependencies
108108

@@ -171,7 +171,7 @@ export default defineConfig({
171171
</TabItem>
172172
</Tabs>
173173

174-
We'll talk more about generating tests in the next step, so here's the completed setup / teardonwn and modified example tests to copy for now.
174+
We'll talk more about generating tests in the next step, so here's the completed setup / teardown and modified example tests to copy for now.
175175

176176

177177
<Tabs>
@@ -299,7 +299,7 @@ export default defineConfig({
299299

300300
### Creating / deleting users through an API
301301

302-
Let's explore the alternative to creating users through the browser, which is to create and use API endpoints for our test data.
302+
Let's explore the alternative to creating users through the browser, which is to create and use API endpoints for our test data.
303303

304304
Let's make ourselves an internal API endpoint for our tests to use.
305305

@@ -338,7 +338,7 @@ export async function DELETE(request: Request) {
338338
}
339339
```
340340

341-
Let's set up a global setup and global teardown script to use these API endpoints.
341+
Let's set up a global setup and global teardown script to use these API endpoints.
342342
First we need to modify the `playwright.config.ts` file.
343343

344344
```ts
@@ -524,10 +524,10 @@ export default defineConfig({
524524

525525
## Wrapping up
526526

527-
At this point in time, we don't just have a basic playwright project set up, but we have a very practical playwright set up for our future testing needs.
527+
At this point, we don't just have a basic Playwright project set up, but we have a very practical Playwright setup for our future testing needs.
528528

529529
We have:
530530

531-
- A file structure and config file for running a Playwright suite in typescript
531+
- A file structure and config file for running a Playwright suite in TypeScript
532532
- A set of projects that depend on each other where we can create shared test data
533-
- API endpoints for easily creating more test data when needed
533+
- API endpoints for easily creating more test data when needed

‎tutorial/stage-2-generated-tests/generate-tests-playwright-mcp.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import CursorActivityTodo from "../../../assets/cursor-activity-todo.png";
1212
In this guide, we will use the Playwright MCP to generate tests for your application.
1313

1414
<Aside>
15-
To start from this step, checkout the [`stage-1-setup` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-1-setup) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
15+
To start from this step, check out the [`stage-1-setup` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-1-setup) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
1616
For more information about getting started with the tutorial repository, go [here](/docs/tutorial/playwright-e2e-from-cowboy-to-confidence#getting-started-with-the-tutorial-repository).
1717
</Aside>
1818

@@ -41,7 +41,7 @@ For example for Cursor, your `mcp.json` file could look like this:
4141

4242
## Authenticating with the Playwright MCP Server
4343

44-
At the time of writing, the Playwright MCP server doesn't have support for the projects or storage states that we set up in our Playwright config in the previous step.
44+
At the time of writing, the Playwright MCP server doesn't have support for the projects or storage states that we set up in our Playwright config in the previous step.
4545

4646
You can achieve something similar by using the following flags to the MCP server:
4747

@@ -431,14 +431,14 @@ Other classic problems with the tests that the AI generated:
431431

432432
- Strict mode violations / more than one element on the page that matches a locator
433433
- Adding manual timeouts to tests instead of crafting good assertions
434-
- Hardcoding urls instead of using relative paths
435-
- Not using Playwright `test.step` to label steps in the test & excessive comments
434+
- Hardcoding URLs instead of using relative paths
435+
- Not using Playwright `test.step` to label steps in the test and using excessive comments
436436

437437
## Areas for improvement for our test setup at the moment
438438

439439
It's been fantastic to generate a few tests using this method.
440-
When creating this tutorial, I was able to go from one test to ten tests in the space of just an hour or two, but that also should give us a little space to reflect over what we've done.
440+
When creating this tutorial, I was able to go from one test to ten tests in the space of just an hour or two, but that should also give us a little space to reflect on what we've done.
441441

442442
At the moment:
443443

444-
- Have lots of duplicated selectors in tests where better practice would be to have [page object models](https://playwright.dev/docs/pom) so that we can reduce the amount of places we need to update selectors when changes are needed.
444+
- We have lots of duplicated selectors in tests where better practice would be to have [page object models](https://playwright.dev/docs/pom), so that we can reduce the number of places we need to update selectors when changes are needed.

‎tutorial/stage-3-endform-integration/speeding-up-with-endform.mdx‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Speeding up with Endform
3-
description: Use endform to speed up your test suite.
3+
description: Use Endform to speed up your test suite.
44
sidebar:
55
order: 4
66
---
@@ -9,17 +9,17 @@ import { Aside, Tabs, TabItem } from '@astrojs/starlight/components';
99
import { Image } from "astro:assets";
1010
import TestTimeChart from "../../../assets/test-time-chart.png";
1111

12-
In this guide, we will use endform to speed up your test suite.
12+
In this guide, we will use Endform to speed up your test suite.
1313

1414
<Aside>
15-
To start from this step, checkout the [`stage-2-generated-tests` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-2-generated-tests) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
15+
To start from this step, check out the [`stage-2-generated-tests` branch](https://github.com/endformdev/playwright-tutorial/tree/stage-2-generated-tests) of the [tutorial repository](https://github.com/endformdev/playwright-tutorial).
1616
For more information about getting started with the tutorial repository, go [here](/docs/tutorial/playwright-e2e-from-cowboy-to-confidence#getting-started-with-the-tutorial-repository).
1717
</Aside>
1818

19-
At this point in time, we have a pretty decent Playwriht end to end testing suite that can test most of the dummy features in this application.
20-
We can test complex multi user flows like inviting, and we have the ability to create new users on demand when the user data conflicts with other tests.
19+
At this point, we have a pretty decent Playwright end-to-end testing suite that can test most of the dummy features in this application.
20+
We can test complex multi-user flows like inviting, and we have the ability to create new users on demand when the user data conflicts with other tests.
2121

22-
Since this a very simple application, our tests are thankfully very fast to run. Let's explore their performance.
22+
Since this is a very simple application, our tests are thankfully very fast to run. Let's explore their performance.
2323

2424
## Running the tests
2525

@@ -35,9 +35,9 @@ Let's try running the tests with Endform also to get a benchmark:
3535
pnpm endform test
3636
```
3737

38-
On my machine (M2 Macbook Pro), the tests ran in 20 seconds with Playwright, and 25 seconds with Endform.
38+
On my machine (M2 MacBook Pro), the tests ran in 20 seconds with Playwright and 25 seconds with Endform.
3939

40-
With these very fast, very small, and few tests - uploading and running the tests on Endform's remote runners aren't giving us much of a speedup.
40+
With these few, very fast tests, uploading and running the tests on Endform's remote runners isn't giving us much of a speedup.
4141

4242
## Cranking up the heat
4343

@@ -72,13 +72,12 @@ while Endform will keep the speed constant.
7272

7373
### Other influential factors
7474

75-
This is one case of the speed of this particular suite, but lots of things have an impact on the speed of a suite.
76-
Like:
75+
This is one case of the speed of this particular suite, but lots of things have an impact on suite speed, including:
7776

7877
- How reliable or flaky the tests are
7978
- How long the tests take to run
8079
- How slow the slowest test is
81-
- How performant the app the tests are run against is
80+
- How performant the app under test is
8281

8382
We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like.
8483

@@ -126,8 +125,8 @@ jobs:
126125
127126
Here we used the [`repository_dispatch` event](https://vercel.com/docs/git/vercel-for-github#repository-dispatch-events) to trigger the workflow when the Vercel deployment is successful.
128127

129-
Some other thigns you could try are:
128+
Some other things you could try are:
130129

131130
- Just trigger on commits to the main branch
132131
- Triggering on pull requests
133-
- Sending a message to a Slack channel when the tests are successful or fail
132+
- Sending a message to a Slack channel when the tests are successful or fail

0 commit comments

Comments
 (0)