Skip to content

Commit 8227661

Browse files
committed
Add readme justifying why existence of playgrounds
1 parent 120f7e7 commit 8227661

3 files changed

Lines changed: 46 additions & 5 deletions

File tree

playgrounds/jasmine/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Jasmine Playground
2+
3+
This is a playground for E2E testing with the `@wdio/jasmine-framework` to ensure compatibility with `expect-webdriverio`.
4+
5+
## Features and Limitations
6+
7+
* **Soft Assertions**: `SoftAssertionService` is not supported, as Jasmine provides similar behavior natively.
8+
* **Snapshots**: Basic snapshot testing currently does not work well.
9+
* **Visual Snapshots**: The `@wdio/visual-service` does not work properly due to a lack of compatible hooks in Jasmine.
10+
* **Options Configuration**: Global configurations (like `setOptions({ wait: 500 })`) are fully supported.
11+
* **Asymmetric Matchers**: Native Jasmine asymmetric matchers (like `jasmine.any()`) are properly supported.
12+
13+
## Test Structure
14+
15+
* `test/specs/expect-wdioImport/`: Tests using the direct import of `expect-webdriverio` (Jest-based).
16+
* `test/specs/globalImport/`: Tests using the global import, which pulls the Jasmine `expect` by default.

playgrounds/jest/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Jest Playground
2+
3+
This is a playground for E2E testing with Jest, ensuring the compatibility of `expect-webdriverio` and primarily serving to test Jest augmentation.
4+
5+
## Notes and Limitations
6+
7+
* **Framework**: There is no official WebdriverIO framework for Jest (e.g., no `@wdio/jest-framework`).
8+
* **Matcher Registration**: WebdriverIO custom matchers need to be manually registered via Jest augmentation to work with Jest's global `expect`.
9+
* **Snapshots**: Basic snapshot testing can work fine, but it may conflict with Jest's native snapshot mechanism.
10+
* **Visual Snapshots**: Visual snapshot testing works successfully.
11+
12+
## Test Structure
13+
14+
* `test/`: Tests demonstrating integration with Jest using global matcher augmentation.
15+
* **TODO**: Add a `test/expect-wdioImport` folder showing how to use `expect-webdriverio` by importing it directly as a standalone module without global Jest augmentation.

playgrounds/mocha/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
# expect-webdriverio Playground - Mocha
1+
# Mocha Playground
22

3-
This playground project uses the local build of expect-webdriverio with WebDriverIO and Mocha framework.
3+
This playground project uses the local build of `expect-webdriverio` with WebDriverIO and the Mocha framework. It serves as the default, out-of-the-box experience where all features are fully supported and work easily.
4+
5+
## Features and Support
6+
7+
Because Mocha is the standard framework for `expect-webdriverio`, all features work natively without conflicts:
8+
9+
* **Soft Assertions**: Fully supported using the `SoftAssertionService` plugin in the `wdio.conf.ts` services.
10+
* **Snapshots**: Basic text/data snapshot testing works seamlessly.
11+
* **Visual Snapshots**: Visual snapshot testing directly integrates via `@wdio/visual-service`.
12+
* **Global Options Configuration**: Easily set global wait times and other configurations (e.g., `setOptions({ wait: 250 })` in the `before` hook).
413

514
## Setup
615

@@ -21,9 +30,10 @@ This playground project uses the local build of expect-webdriverio with WebDrive
2130

2231
## Structure
2332

24-
- `test/specs/` - E2E test files
25-
- `wdio.conf.ts` - WebDriverIO configuration with Mocha
26-
- Uses local build from `../../lib/index.js`
33+
- `test/specs/` - E2E test files covering various feature sets (basic matchers, soft expectations, snapshots, visual comparisons).
34+
- `wdio.conf.ts` - WebDriverIO configuration demonstrating how to wire up the `SoftAssertionService`, the Visual service, and global `expect-webdriverio` options.
35+
- `visual-snapshot/` - Directory for storing and comparing visual screenshot baselines and temp images.
36+
- Uses local build from `/expect-webdriverio/lib/index.js`.
2737

2838
## Tests
2939

0 commit comments

Comments
 (0)