Skip to content

feat(playwright): support for worker-scope actors and improved reporting #2788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Jun 20, 2025

Conversation

jan-molak
Copy link
Member

@jan-molak jan-molak commented Mar 17, 2025

  • The ability to BrowseTheWebWithPlaywright now separates the BrowserContextOptions parameter, available when creating an ability using the Playwright browser but not the page, from the ExtraBrowserContextOptions, available for both the browser and the page. This change tightens the API and clarifies that certain options are not available when passing an already-configured page.

  • SerenityOptions and SerenityFixtures are now merged and available as SerenityFixtures to be used with defineConfig<SerenityFixtures> to follow the current Playwright Test convention

  • New type SerenityWorkerFixtures introduced to allow for separating test-scoped and worker-scoped Serenity fixtures in future releases

  • Retried tests aggregated, similar to scenario outlines

  • Repeated tests reported individually

  • Enabled filtering by project name in Serenity BDD reports

@jan-molak jan-molak changed the title feat(playwright): improved test fixtures refactor(playwright): removed unused parameter Mar 21, 2025
@jan-molak jan-molak self-assigned this Mar 21, 2025
…WithPlaywright parameters

- The ability to BrowseTheWebWithPlaywright now separates the BrowserContextOptions parameter,
available when creating an ability using the Playwright browser but not the page, from the
ExtraBrowserContextOptions, available for both the browser and the page. This change tightens the
API and clarifies that certain options are not available when passing an already-configured page.

- SerenityOptions and SerenityFixtures are now merged and available as SerenityFixtures to be used
with defineConfig\<SerenityFixtures\> to follow the current Playwright Test convention

- New type SerenityWorkerFixtures introduced to allow for separating test-scoped and worker-scoped
Serenity fixtures in future releases
@jan-molak jan-molak changed the title refactor(playwright): removed unused parameter feat(playwright): separated test- and worker-scoped fixture, tightened the APIs Mar 29, 2025
…as optional

to follow Playwright configuration conventions
to demonstrate usage of the new SerenityFixtures and SerenityWorkerFixtures
…r scope

This will enable using actors in beforeAll and afterAll hooks
… afterAll hooks

This change enables using actors to perform worker-scope setup and teardown tasks
…ght Test IDs

This refactoring will help to simplify Serenity/JS reporting mechanism for Playwright Test
moved the old tests to the new directory structure and cleaned up the promise handling to make the
tests easier to understand
…d" if they pass upon first try

Previously, retryable test scenarios were incorrectly tagged as "retried" in the Serenity BDD report
even if they passed upon first attempt. With this change, a test is only marked as retried if it has
failed at least once.
Moved the failure reporting integration tests to the new directory structure and cleaned up the code
this allows for the actors who were active before calling `configure` to be correctly dismissed when
the scenario is finished
@jan-molak jan-molak force-pushed the features/playwright-fixtures branch from 491067a to 03f74bf Compare May 14, 2025 19:31
jan-molak added 2 commits May 18, 2025 23:52
…nism

instead of using Playwright attachments to share the information about domain events that occurred
during the test scenario, Serenity/JS test fixtures will now automatically write the events to files
under test-results and use Playwright-provided testIds to associate the events with the correct
test. This meachanism simplifies the original implementation and avoids making the internal Serenity
events visible as attachments in the Playwright HTML report. This new mechanism will also make
extending Serenity/JS reporting capabilities easier in the future.
jan-molak added 7 commits May 20, 2025 10:36
…y project

Previously, retried test scenarios were reported separately, which could make anylysing the report
challenging. Now, even though the results are still reported separately, the test reports for
retried tests are aggregated and presented together, making it easier to spot common failure
patterns.

Playwright Test project name is now highlighted in the Serenity BDD using a dedicated project tag.
This allows for filtering test results by project they belong to.
tests repeated via Playwright Test --repeat-each=N are now reported individually
@jan-molak jan-molak changed the title feat(playwright): separated test- and worker-scoped fixture, tightened the APIs feat(playwright): support for worker-level actors and improved reporting Jun 5, 2025
@jan-molak jan-molak changed the title feat(playwright): support for worker-level actors and improved reporting feat(playwright): support for worker-scope actors and improved reporting Jun 20, 2025
@jan-molak jan-molak merged commit fb5ddac into main Jun 20, 2025
1 of 2 checks passed
@jan-molak jan-molak deleted the features/playwright-fixtures branch June 20, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant