Skip to content

Commit 34a8997

Browse files
committed
docs(website): separated web testing patterns from tutorials
1 parent a1f8a8c commit 34a8997

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/docs/handbook/web-testing/your-first-web-scenario.mdx renamed to src/docs/handbook/tutorials/your-first-web-scenario.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ you're a test automation expert or just starting on your journey.
1313
If you found anything here that could have been clearer, please let me know in the comments or
1414
[submit a correction](https://github.com/serenity-js/serenity-js/tree/main/documentation/serenity-js.org/docs/web-testing/your-first-web-scenario.mdx).
1515

16-
To keep things simple, we'll use a [**Gitpod.io workspace**](/handbook/getting-started/project-templates/#serenityjs-gitpods) to work with Serenity/JS in your web browser, so there's **no need to install anything** on your computer.
16+
To keep things simple, we'll use a [**Gitpod.io workspace**](/handbook/project-templates/#serenityjs-gitpods) to work with Serenity/JS in your web browser, so there's **no need to install anything** on your computer.
1717
If you prefer to set up Serenity/JS locally instead, follow the installation instructions in [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template).
1818

1919
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/serenity-js/serenity-js-playwright-test-template)
@@ -32,8 +32,8 @@ If you get lost or stumble upon a problem you're not quite sure how to solve - a
3232

3333
## Launching your workspace
3434

35-
All [Serenity/JS project templates](/handbook/getting-started/project-templates/), such as the one we'll use in this chapter,
36-
[support Gitpod.io workspaces](/handbook/getting-started/project-templates/#serenityjs-gitpods) and are configured to
35+
All [Serenity/JS project templates](/handbook/project-templates/), such as the one we'll use in this chapter,
36+
[support Gitpod.io workspaces](/handbook/project-templates/#serenityjs-gitpods) and are configured to
3737
make it easy for you to use them in a Visual Studio Code-based development environment.
3838
Of course, since Serenity/JS tests are standards-based Node.js code, they'll work just as well in any other modern <abbr title="Integrated Development Environment">IDE</abbr>.
3939

@@ -161,7 +161,7 @@ browser interacting with the web app under test. That's because any web browsers
161161
are configured to run in "headless" mode by default so that they don't get in the way and don't interrupt your work.
162162

163163
This setting is configurable, so you can change it when you need to see what's going on under the hood
164-
or to access the developer tools offered by your browser to [debug your test scenarios](/handbook/web-testing/your-first-web-scenario/#debugging-tests-and-interactive-execution)
164+
or to access the developer tools offered by your browser to [debug your test scenarios](/handbook/tutorials/your-first-web-scenario/#debugging-tests-and-interactive-execution)
165165
or the system under test.
166166

167167
In addition to being able to interact with the browser when running the tests locally, the
@@ -344,11 +344,11 @@ over time, writing test scenarios becomes easier as you're simply re-arranging e
344344
### Using portable assertions
345345

346346
The Serenity/JS activity-based programming model applies to performing [assertions](/handbook/design/assertions) just as well as it applies
347-
to performing [tasks and interactions](/handbook/web-testing/your-first-web-scenario/#modelling-workflows-using-reusable-activities).
347+
to performing [tasks and interactions](/handbook/tutorials/your-first-web-scenario/#modelling-workflows-using-reusable-activities).
348348
In fact, the Serenity/JS assertion to [`Ensure`](/api/assertions/class/Ensure) is just another interaction
349349
you give to an actor to perform.
350350

351-
Consider the test scenario [you wrote earlier](/handbook/web-testing/your-first-web-scenario#writing-serenityjs-test-scenarios):
351+
Consider the test scenario [you wrote earlier](/handbook/tutorials/your-first-web-scenario#writing-serenityjs-test-scenarios):
352352

353353
```typescript title="spec/recording_items.spec.ts"
354354
describe('Todo List App', () => {
@@ -394,7 +394,7 @@ that are portable across web integration tools, such as Playwright, WebdriverIO,
394394
You've already seen what happens when an assertion passes. But what happens when it fails?
395395

396396
To experience how you'd go about analysing a Serenity/JS assertion failure,
397-
modify the scenario [you wrote earlier](/handbook/web-testing/your-first-web-scenario#writing-serenityjs-test-scenarios)
397+
modify the scenario [you wrote earlier](/handbook/tutorials/your-first-web-scenario#writing-serenityjs-test-scenarios)
398398
to make it fail:
399399

400400
```typescript title="spec/recording_items.spec.ts"
@@ -525,7 +525,7 @@ to performing the parameterised activity.
525525

526526
To see examples of how to define Serenity/JS questions, open [`spec/todo-list-app/TodoList/questions.ts`](https://github.com/serenity-js/serenity-js-playwright-test-template/blob/main/spec/todo-list-app/TodoList/questions.ts).
527527

528-
Among several other functions you'll spot `itemNames()`, which should be already [familiar to you](/handbook/web-testing/your-first-web-scenario#writing-serenityjs-test-scenarios):
528+
Among several other functions you'll spot `itemNames()`, which should be already [familiar to you](/handbook/tutorials/your-first-web-scenario#writing-serenityjs-test-scenarios):
529529

530530
```typescript title="spec/todo-list-app/TodoList/questions.ts"
531531
import { includes } from '@serenity-js/assertions';
@@ -548,7 +548,7 @@ export const itemCalled = (name: Answerable<string>) =>
548548
.describedAs(d`an item called ${ name }`) as QuestionAdapter<PageElement>;
549549
```
550550

551-
Just like Serenity/JS activities can be [composed into tasks](/handbook/web-testing/your-first-web-scenario#modelling-workflows-using-reusable-activities),
551+
Just like Serenity/JS activities can be [composed into tasks](/handbook/tutorials/your-first-web-scenario#modelling-workflows-using-reusable-activities),
552552
Serenity/JS [questions](/api/core/class/Question) can be composed with other questions to transform their results.
553553

554554
:::info Remember
@@ -569,7 +569,7 @@ Also note how all the questions define [custom descriptions](/api/core/class/Que
569569
### Debugging questions
570570

571571
To use the interaction to [`Debug`](/api/core/class/Debug) to analyse what a given question resolves to,
572-
modify the scenario [you wrote earlier](/handbook/web-testing/your-first-web-scenario#writing-serenityjs-test-scenarios):
572+
modify the scenario [you wrote earlier](/handbook/tutorials/your-first-web-scenario#writing-serenityjs-test-scenarios):
573573

574574
```typescript title="spec/recording_items.spec.ts"
575575
describe('Todo List App', () => {
@@ -626,7 +626,7 @@ To use it, you'll need to:
626626
- interact directly with the `page.locator` API.
627627

628628
To see how the locator tuning features work in practice,
629-
modify the scenario [you wrote earlier](/handbook/web-testing/your-first-web-scenario#writing-serenityjs-test-scenarios):
629+
modify the scenario [you wrote earlier](/handbook/tutorials/your-first-web-scenario#writing-serenityjs-test-scenarios):
630630

631631
```typescript title="spec/recording_items.spec.ts"
632632
describe('Todo List App', () => {
@@ -658,7 +658,7 @@ describe('Todo List App', () => {
658658

659659
When you run your scenario through a debugger and the execution pauses on the line where you set
660660
the breakpoint, you'll notice that you can **modify the selector** passed to `page.locator`
661-
and that your [browser](/handbook/web-testing/your-first-web-scenario#showing-the-browser-window)
661+
and that your [browser](/handbook/tutorials/your-first-web-scenario#showing-the-browser-window)
662662
highlights the matching elements **live** as you do it.
663663

664664
<Figure

src/docs/handbook/web-testing/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
sidebar_position: 4
3-
title: Web testing
2+
sidebar_position: 5
3+
title: Web Testing Patterns
44
---
5-
# Web testing
5+
# Serenity/JS Web Testing Patterns
66

77
[**Serenity/JS web module**](/api/web) is an abstraction layer on top of popular web integration tools like [WebdriverIO](/api/webdriverio), [Playwright](/api/playwright), or [Protractor](/api/protractor).
88
It helps you create **portable test code libraries** that interact with web-based interfaces and can be shared and reused across projects and teams.

0 commit comments

Comments
 (0)