Skip to content

Commit 0bfad1a

Browse files
committed
docs(website): revised and updated test runner guides
1 parent ae09b12 commit 0bfad1a

File tree

3 files changed

+315
-262
lines changed

3 files changed

+315
-262
lines changed

src/docs/handbook/test-runners/playwright-test.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ with **their unique domain**. Seamlessly integrating with Playwright and Playwri
1515
Serenity/JS also offers **advanced reporting** that provides clear insights into test results,
1616
aiding both technical teams and business stakeholders in assessing system quality.
1717

18-
1918
**Benefits of integrating Playwright Test with Serenity/JS:**
2019

2120
- [Enhanced Reporting](/handbook/reporting/) – Use Serenity/JS to augment [Playwright Test reports](#reporting) and generate living documentation with [Serenity BDD](/handbook/reporting/serenity-bdd-reporter/).
2221
- [Reusable Code](/handbook/design/screenplay-pattern/) – Leverage the [Screenplay Pattern](/handbook/design/screenplay-pattern/) to write maintainable test code, facilitate collaboration, and implement multi-actor, multi-interface test scenarios.
23-
- [Integration Libraries](/api/) – Interact seamlessly with [REST APIs](/api/rest/), [local Node.js servers](/api/local-server/), and verify [complex workflows](/api/assertions/) using prebuilt integration libraries.
24-
22+
- [Integration Libraries](/api/) – Interact seamlessly with [REST APIs](/api/rest/), [local Node.js servers](/api/local-server/), and verify [complex workflows](/api/assertions/) with ready-to-use integration libraries.
2523

2624
**In this guide, you will learn how to:**
2725

src/docs/handbook/test-runners/protractor.mdx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ This configuration enables the [`@serenity-js/protractor`](/api/protractor/) tes
265265
- [Artifact Archiver](/handbook/reporting/artifact-archiver/) - Stores the `json` reports and screenshots captured by the Photographer to disk.
266266

267267
Note that the above configuration assumes the following directory structure of your project:
268-
- `./spec` - stores your test scenarios and is the top-most directory of your [requirements hierarchy](/handbook/reporting/serenity-bdd-reporter/#the-requirements-hierarchy).
268+
- `./spec` or `./features` - stores your test scenarios and is the top-most directory of your [requirements hierarchy](/handbook/reporting/serenity-bdd-reporter/#the-requirements-hierarchy).
269269
- `./target/site/serenity` - stores any test report artifacts, like the `.json` files and screenshots.
270270

271271
If you'd like to use different locations for your tests or the test reports, adjust the `specDirectory` and `outputDirectory` settings accordingly.
@@ -300,9 +300,10 @@ The most commonly used Screenplay Pattern APIs come from the following modules:
300300
- [`@serenity-js/protractor`](/api/protractor) - Provides Protractor-specific interactions.
301301
- [`@serenity-js/core`](/api/core) - Provides interface-agnostic interactions, such as [waiting and synchronisation](/handbook/design/waiting-and-synchronisation/), [control flow](/handbook/design/control-flow/), or [logging](/handbook/design/logging/).
302302

303-
304303
### Using actors in test scenarios
305304

305+
A test scenario following the Screenplay Pattern models workflows of one or multiple [actors](/api/core/class/Actor/) representing people and external systems interacting with the system under test.
306+
306307
When you configure [Serenity/JS Protractor](/api/protractor)
307308
as the [Protractor `framework`](/handbook/test-runners/protractor#configuring-serenityjs),
308309
Serenity/JS automatically creates and makes available a default [cast](/api/core/class/Cast) of [actors](/api/core/class/Actor/),
@@ -312,10 +313,13 @@ where every actor has the abilities to:
312313
- [`CallAnApi`](/api/rest/class/CallAnApi/) - Enables interaction with RESTful APIs using an Axios HTTP client configured
313314
with configured with `baseUrl`.
314315

315-
To use an actor in your Protractor test scenario, refer to it using the
316-
[`actorCalled`](/api/core/function/actorCalled) function, which returns an instance of the actor with the given name,
317-
or use the [`actorInTheSpotlight`](/api/core/function/actorInTheSpotlight) function to refer to the last accessed actor.
318-
All the default actors already have access to the Protractor-managed browser instance.
316+
:::tip Overriding abilities
317+
An actor can only have **one instance of each ability** type at a time.
318+
Therefore, providing a new instance of the same type via the [`actor.whoCan`](/api/core/class/Actor/#whoCan) method overrides any existing ability of that type
319+
:::
320+
321+
To use an actor in your test scenario, refer to it using the [`actorCalled`](/api/core/function/actorCalled/) or [`actorInTheSpotlight`](/api/core/function/actorInTheSpotlight/) functions
322+
and they'll automatically use the configured cast of actors to create or retrieve the actor you need.
319323

320324
```ts title="specs/example.spec.ts"
321325
import 'jasmine'
@@ -342,11 +346,6 @@ describe('My awesome website', () => {
342346
})
343347
```
344348

345-
:::tip Overriding abilities
346-
An actor can only have **one instance of each ability** type at a time.
347-
Therefore, providing a new instance of the same type via the [`actor.whoCan`](/api/core/class/Actor/#whoCan) method overrides any existing ability of that type
348-
:::
349-
350349
Since Protractor uses Jasmine, Mocha, or Cucumber to run your test scenarios, please refer to their
351350
dedicated guides to learn more about using Serenity/JS actors with:
352351
- [Cucumber](/handbook/test-runners/cucumber#referring-to-actors-in-test-scenarios)
@@ -784,12 +783,11 @@ npm uninstall protractor @serenity-js/protractor --save
784783
Learn more:
785784
- [Serenity/JS WebdriverIO Test Runner Adapter](/handbook/test-runners/webdriverio/)
786785

787-
788786
## Integration architecture
789787

790788
To recap, Serenity/JS integrates with Protractor through the [`@serenity-js/protractor`](/api/protractor) module,
791789
which acts as a [test runner adapter](/handbook/architecture/#serenityjs-test-runner-adapters) and:
792-
- Captures test execution events from Playwright Test
790+
- Captures test execution events from Protractor and its test runners
793791
- Translates them into [Serenity/JS domain events](/handbook/reporting/domain-events)
794792
- Makes them available to [Serenity/JS reporting services](/handbook/reporting/)
795793

0 commit comments

Comments
 (0)